This year’s Halloween project is a useless machine built with 555 timers. It’s a coffin with a switch. When you flip it off, a dark force rises from the coffin and flips it back on. This project uses two 555 timers to control the position of a servo motor, which was a fun challenge in itself.
Check out the video below to see the result:
Controlling a Servo with 555 Timers
The idea for this project came after we published the simple 555 PWM circuit that controls a DC motor using a PWM signal created by a 555 Timer. I started thinking about the idea of controlling a servo instead.
After some experimentation, I realized that the frequency changed too much when I changed the duty cycle. So my servo would only move at random times.
I decided to use two 555 timers instead: one in astable mode to set the frequency to a steady 50 Hz. And one in monostable mode that would set the duty cycle. With this setup, I was able to control the servo without any issues.
The value of the resistors R3 and the capacitor C2 sets the standard duty cycle. This position is when the arm is hidden.
When you push the pushbutton SW1, R4 is connected in parallel with R3 which reduces the duty cycle and moves the servo to its other position. This is the position that should make the arm flip off the toggle switch.
I used a pushbutton for this experiment. But in the useless machine setup, SW1 would be a toggle switch.
Build Something Practical This Evening
Download this tutorial that shows you step by step how to build an old-school USB charger for your mobile.
Adding a Delayed “button push”
The switching between the two positions happened a bit too fast. I was barely able to remove my finger before the servo arm moved into position to flip the switch back off. So I needed a way to delay things before the arm switched positions.
I tried a few different things before I ended up with the following: A pMOS to replace SW1. And a capacitor and resistor to add a delay from the toggle switch is flipped to the pMOS turns on.
Basically, what this circuit does is that it places R4 in parallel with R3, just like SW1 did before. But it does so after a short delay of a couple of seconds. The values of C3 and R5 sets the delay time.
The Final Circuit
The delay circuit worked perfectly. And below you can see the full schematic for this project:
The only part of the circuit that is not shown above is a 7805 voltage regulator that converts my 9V battery to 5V, which was the VCC voltage I used to make everything compatible with my servo.
Components Needed
- Servo motor (I used SG90)
- Toggle switch
- Box to put everything into
- 2 x 555 Timer
- 1 x pMOS transistor
- 5 x Resistors (See below for values)
- 3 x Capacitors (See below for values)
To choose values for the first 555 timer, use this 555 calculator in astable mode and try different values until you find the frequency you want.
Note that the time low you get will be the lowest possible duty cycle.
To choose values for the second 555 timer, use this 555 calculator in monostable mode and try different values until you find the resistance you need for the two different servo positions.
Use the highest resistance value for R3. Figure out what R4 needs to be in order to get the lowest resistance value (this calculator might be of help).
More Circuits & Projects Tutorials
Build Something Practical This Evening
Download this tutorial that shows you step by step how to build an old-school USB charger for your mobile.
It could also have been put together using a 12volt supply, a 4017 clocked by a 555 output at Pin 3 with a PNP or NPN transistor to the output device using a doorbell coil with armature for active features. One active output pin on the 4017 with a continuous clocking input could be set to to vibrate the box or have the armature appear, etc., depending on timing and imagination of the builder. Still in all these are nice circuit configurations with the 555 timers.