Saturday, April 5, 2014

OpenPanTilt, a DIY 3D-printed Pan and Tilt head for DSLR timelapse photography

I hereby present OpenPanTilt, a 3D-printed Pan/Tilt head for timelapse photography with DSLR. This is a project I have been working on for some months. It is still not finished (i guess it will not ever be completely finished), but at least it is working. The above video shows a a video produced by OpenPanTilt. Scroll down to the end of this blog post to see a video demonstrating how the OpenPanTilt looks like. 


Timelapse videos gets alot more interesing once some camera movement is introduced. There are mainly two methods to perform movement. The first is by using a camera dolly, an the second is by using a Pan/tilt head. Each method have their advantages and disadvantages. A dolly can typically create more interesting shots if there is an object in the foreground, while a Pan/tilt head can be useful regardless of the scene and it can also be more portable. I have created my own Pan/tilt head for timelapse purpose: OpenPanTilt. The source code and the design files are all available for download, and can be freely modified and hacked, hence the "Open".
OpenPanTilt is inspired by the design of Steven Brace and consists of similar worm drives and stepper motors as his design. However, OpenPanTilt is also inspired by RepRap 3D-printers, meaning that most of the parts can be 3D-printed, whereas the rest of the parts (except the gears) can be easily sourced from a nearby hardware store.


The unit consists of nine 3D-printed parts (the part numbers in the list correspond to those in the above figure):
  1. Camera mount with mounting holes for quick-release plate
  2. Left part of the cradle
  3. Right part of the cradle. The left and right parts are identical.
  4. Tilt mount which holds the left part of the cradle and a NEMA17 stepper motor.
  5. Right tilt mount
  6. An upper pan mount which connects the two tilt mounts with M8 Rods and space for a lazy susan bearing.
  7. Top cover for the pan stepper motor box, which also has a space for the second half of the lazy susan bearing.
  8. The pan stepper motor box, containing the second NEMA17 motor.
  9. The bottom cover of the pan stepper motor box. A quick release mount can be printed as a part of the cover as an option. 

My 3D-printer (as seen above printing part 5) has a relatively small build volume (140x140x100mm), so the size of the parts are somewhat smaller than they should be. For example, by printing the tilt mounts (part 4 and 5 in the figure) a bit taller, it would be possible to tilt the camera some additional degrees before it crashes with the upper pan mount (part 6). However, the freedom of tilt movement depends heavily on the type of camera that is attached to OpenPanTilt. A small compact camera can be tilted 360 degrees with no problems at all whereas a DSLR with a huge lens will be more restricted in terms of movement. 


The hardware pieces are as follows:
  • 2x A-1Y-5MYK08RA Worm (from sdp-si)
  • 2x A-1P-6MYK08R030 Worm Gear (from sdp-si)
  • 2x NEMA17 stepper motor (The Pan engine should be max 40mm to fit inside part 8)
  • 1x 25x42x11mm Axial Ball Thrust Bearing (a.k.a Lazy Susan bearing) (between part 6 and 7)
  • 4x 8x16x5mm Axial Ball Thrust Bearing (on each side of part 4 and 5)
  • 6x 5x12x4mm Bearing (2 each inside parts 4, 5 and 8) 
  • 60cm 8mm threaded rod, to connect parts 4,5,6 (length depends on the size of the camera)
  • 60cm 6mm threaded rod, to connect parts 1,2,3 (length depends on the size of the camera)
  • 20cm 5mm threaded rod, to connects parts 4,2 and 3,5
  • 12 M8 nuts
  • 12 M6 nuts
  • 12 M8 locking washer
  • 12 M6 locking washer
  • 5 M5x75mm hex bolts, to assemble the parts 7,8 and 9, and one for connecting the pan motor to 6.
  • 4 M5 nuts
  • 4 M5 washers
  • 8 M3x15mm screws (for motor mounts)
  • 1 Camera Tripod Quick Release Plate 1.5x2 Inches, such as this one
  • Some M5 washers to align the worm gears
  • M2 bolt to secure the tilt axis to the M5 rod connected to the tilt stepper motor.


The assembly is straightforward. Just as when assembling a RepRap printer, the parts, and particularly the holes, might need some adjustments after printing. This video describes the process. When that is done, there are many ways to assemble the unit. Below I describe my method:

  1. Start with cutting the M6 rods into two pieces. These two pieces connects the pars 1, 2 and 3 Make sure that the rods has sufficient length to ensure that your camera fits between 2 and 3, even with cables (such as power and remote control) attached. Then, assemble the cradle with M6 nuts and washers.
  2. The second step is to cut the M8 rods in adequate lengths and assemble the parts 4,6 and 5 with M8 nuts and washers. 
  3. The third step is to mount the pan stepper motor and the gears into 8 and mount the lid (7) to the pan unit (6) with the axial thrust bearing in between. 
  4. The fourth, and final step, is to mount the tilt stepper motor with its gears into 4, and use two M5 rods and some bearings to connect the cradle (i.e., parts 1,2,3) to the left and right tilt unit (4 and 5). Part 2 must be fastened to the M5 rod connected to the tilt gearing by drilling a hole in the rod and fitting a M2 bolt through the hole in part 2.
  5. Voila, the OpenPanTilt is finished!

The verdict

The units works excellent. I have also created the electronics to control the unit, consisting of a Atmel ATMega328, a couple of stepper motor controllers, power supply, and some opto couplers. A future blog post will describe the electronics and provide some timelapse videos created with the unit.

Wednesday, March 26, 2014

Stopping and starting a pendulum clock with an Arduino.

The purpose of this simple build is to stop the pendulum clock from ringing every hour during the night. At about 10 in the evening the pendulum stops, and it starts again at 10 in the morning. The electronics is simply a micro servo driven directly from an Arduino Leonardo.

The idea was inspired by this video This design is using a stepper motor rather than a servo, and is admittedly a better design. Nevertheless, my prototype works, and it does the job. Before attempting to build a similar device, you should read the discussion on regarding whether starting and stopping the clock every day is harmful for the mechanism or not. Your mileage may vary.

It is worth noting that this is a build I did a couple of years ago, and the Arduino Leonardo used in the project is now used in  a completely different project. In other words, the above video is all that remains of the small project. However, I might build a new one in the future, since it was very helpful in keeping the house quiet during nighttime.

Wednesday, February 12, 2014

Building a x0xb0x synthesizer

I just finished my x0xb0x synth. It is a Roland TB-303 clone which was originally developed (or reverse engineered) by Limor Fried at adafruit. The kit I built was from
The timelapse video below shows the complete build. It took me about 10 hours to complete the synth, and luckily it worked straight away.

I am sorry about the rubbish soundtrack in the video. It was just about the first sound coming out of the box recorded and produced live in a really amateurish way (in other words, it is DIYcrap).

Anyway, it was a really fun kit to build. Although the kit consists of more than 500 components, it is fairly simple to build as long as you keep everything in order. All parts came in clearly labeled bags and not a single piece was missing from the kit. Willzyx is highly recommended!

Sunday, February 2, 2014

Noise Toaster

A couple of months ago I purchased the book  Analog Synthesizers by Ray Wilson. I was intrigued by the book and quickly decided to build the beginners kit of a DIY Analog Synthesizer presented in the book, the Noise Toaster.

I already had a plastic enclosure and a bunch of components, so I decided to order just the PCB from Ray Wilson, and not the whole kit. Ray Wilson is sort of a DIY analog synth guru and runs the web page The web page consist of all the information you need to build the Noise Toaster. However, I highly recommend to buy the book. It is well written, and I think the guy deserves some extra dollars for running his highly informative web-page.

The Noise Toaster consists of about 150 components, and is a fairly easy build. The only thing i forgot while ordering parts was that the design uses a lot of E24 resistors (which I did not have) and some bipolar capacitors (which are hard to get). Besides that, the components are fairly standard.

The only problem I had after the assembly was that the white noise generator did not work at all. I traced it down to the 2n3904 transistor Q5 which was not actually generating noise. I recommend to breadboard the white noise generator to make sure you select a 2n3904 which generates sufficient white noise. Two of the transistors I tried did not actually work as white noise generators. After soldering up the PCB and mounting the switches and pots, I fired it up and enjoyed the nice sound of the synth with all its squeals and noises.

The Noise Toaster runs of a 9V battery, which must be mounted securely inside the box. I downloaded a design for a 9V battery holder from Thingiverse, printed it on my 3D-printer and "glued" it to the bottom plate with sugru. For the speaker, I drilled a 50mm hole and mounted the speaker (again with sugru).

Since my plastic enclosure was way smaller that the design presented in the book, I had to design my own front panel. I did this in gimp based on Wilsons design. As I do not have a laminating machine, I printed the front panel on a 20x15cm photo paper and cut it to its proper size. It is not scratch-safe, but seems to work just fine.

The next step is to build some additional synth boxes to accompany the toaster. Together they will rule the world of noisy analog music.

Monday, January 20, 2014

Fluke 8050A display repair

I had an old Fluke 8050A from 1979 with a broken LCD display laying around. LCD-problems are very common with these old units, and since there are no replacement parts to be found, I tried to rescue the unit from the junkyard by replacing the LCD with a 7-segment LED display.

A few people have done similar repairs successfully (e.g this one and this guy), but i found this one particularly interesting since it uses a ATMega328 to interface with the Fluke, and I happen to have most of the components laying around.

Fluke 8050A with a new LED display.

In short, the 8050A uses multiplexed data from a 3870 microcontroller. The multiplexed data lines are all available on connector J1 on the display board. These are connected to the ATMega, which demultiplexes the data and communicates to a MAX7219 LED driver which again drives six common cathode 7-segment leds. You should read The Belfry blog for instructions on how to do this. I just downloaded his code and did not change anything.

Breadboarding the circuit connected to the Fluke 8050A
The first I did was to breadboard the circuit. I did this mainly to make sure the display was working and to familiarize myself with the MAX7219. I found that the power supply on the 8050 was very unstable, and traced the problem down to the NiCad batteries. They were from 1979, so no wonder they had to be replaced. Original battery-packages are hard to find, but I replaced them with four sub C 2500mAh 1.2V NiCads, and after some hours of charging, the meter was running fine.

The circuit soldered on two stripboards. It is a tight fit.

The circuit was then soldered on two stripboards, one which contained the ATMega328, 16Mhz crystal, capacitrors and the MAX7219 with some mandatory components; and a second stripboard with the six 7-segment LEDs. The two circuit boards were fitted (almost) in the same space as the original display. I used the glass and the plastic frame from the original LED, and with some sugru, it all fitted quite nicely and sturdy inside the Fluke 8050A.

So, I now have a 1979 Fluke with fresh batteries and a brand new display which is way better than the original LCD, ready for another 30 years of duty.

Monday, November 25, 2013

ReprapPro Huxley Bed Leveling

Leveling the bed of the 3D-printer is extremely important to ensure quality prints. The process can, however, be intrinsically difficult and tedious.
I have always used this guide to help me in the leveling process. As the guide is made for a Mendel, it does not quite fit my Huxley.

Here is my process for leveling the Reprappro Huxley.

The home position (X0, Y0) is at the bottom left and the bed on the Huxley is approximately 140x140mm. Hence, the positions are as follows (given by the G-codes).

P1 G1 X15   Y75   Z0
P2 G1 X140 Y75   Z0
P3 G1 X15   Y15   Z0
P4 G1 X15   Y135 Z0

The numbers are approximate positions for my Huxley. Your mileage may vary.
Notice that the Z is zero, so if your bed is totally misaligned, the extruder might crash to the bed creating a total havoc. Use Z5 or Z10 if you are unsure.

Since the materials in the bed and the extruder expand with higher temperature, the both the bed and the extruder should be heated.

  1. Start by setting the bed to 60C and the extruder to 150C
  2. Move hotend to position P1 (G1 X15 Y75 Z5). Use a z height of 5mm while moving the hot end across the bed, at least if you are not the brave one.
  3. Home Z and adjust the Z-axis end stop until the hot end is a paper thickness above the bed.
  4. Move hotend to P2 (G1 X140 Y75 Z5) and home Z
  5. Adjust the screws S2 and S3 until the distance between the hot end and the bed is the thickness of a paper.
  6. The bed is now initially leveled in the X direction. Now we need to check if the bed tilts in the Y direction. Move the hot end to P3 (G1 X15 Y15 Z5) and home Z.
  7. Adjust the height using screw S2.
  8. Move the hot end to P4 (G1 X15 Y135 Z0) and home Z.
  9. Adjust the height using the screw S3.
  10. Go back to step 2 and check that the P1 position is still fine.
  11. To be sure, check the P2, P3 and P4 again, and check that the height at middle of the bed (G1 X77 Y75 Z0) is a thickness of a paper.
  12. Make sure the screws are tightened. Be careful, as the tightening can make your bed out of level and you have to go back to step 2 again.

Wednesday, October 30, 2013

Halloween pumpkin LEDs and IR project

What's Halloween without a carved pumpkin? And what's the point of lighting the pumpkin with a candle when we have LEDs?

The LEDs flicker for 30s when someone is close to the pumpkin. Notice the IR-detector in the nose

In this post I will show how I built my pumpkin powered with a ATtiny85 microcontroller, some LEDs and an IR detector.

Firstly, I soldered 10 LEDS in two groups of five, driven by BC547 transistors. The transistors are driven by two pins on the ATtiny85. A third pin on the ATtiny is used to read a IR sensor (similar to the Parallax PIR). The electronics is driven by three 1.5V AA batteries.

10 LEDs driven by ATtiny85. The IR electronics is wrapped in plastics to protect it from pumpkin juice.


The purpose of the code is to let the LEDs flicker for 30s when the IR sensor is activated. The code is super simple and should not need any further comment. 

int led = 1;
int led2 = 0;
int pirPin = 2;
int calibrationTime = 10;

void setup() {               
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT); 
  pinMode(pirPin, INPUT);
  digitalWrite(pirPin, LOW);
  for(int i = 0; i < calibrationTime; i++){

void loop() {
  if(digitalRead(pirPin) == HIGH){
    for(int i=0;i<300;i++){
      analogWrite(led, random(120)+135);
      analogWrite(led2, random(120)+135);
    digitalWrite(led, LOW);
    digitalWrite(led2, LOW);


The LEDs are PWM driven with some random functions inspired by the Realistic Flickering Flame Instructable. The ATtiny was programmed using the Arduino IDE and my DIY programmer.

Once the electronics is completed it is time to carve the pumpkin. I used a template I found on the Internet to create the scary(?) face. It sure helped a lot.

After the pumpkin is carved and the face is completed, the pumpkin is washed, and the electronics is fitted. The IR detector was fitted in the nose of the face.

Once the pumpkin head is assembled, you might want to roast the pumpkin seeds. If you threw them away, you can enjoy a cup of tea instead. I followed this recipe and was fairly happy with the result.

Roasted pumpkin seeds (or what's left of them anyway)