I've copied my project pages to my website at http://www.jnchen.com
You can also find my email address there. Feel free to email me with any questions about these projects.
Nothing for now
Sunday, August 28, 2011
Monday, February 28, 2011
555 Contest - "Whack-a-mole" Style Game

My second entry to the 555 contest is a game similar to the "whack-a-mole" games. By replacing the "moles" with LEDs and the hammer with your finger, this game discourages violence against underground critters, hopefully. The only ICs used are six 556 chips.
Here's how the game looks:
The rule is simple. During the game, the LEDs will light up randomly. You have a certain amount of time to turn off the lit LEDs by touching the electrodes next to them. Every time, you will get less and less time available. When a LED is not turned off by the time limit, the game ends and all the LEDs will light up. Turn them off to restart the game.
This is the overall schematic, and I will explain each individual block below:


Each of the nine cell blocks is responsible for sensing touch input and controlling one LED.
- Touch input takes advantage of the Darlington input stage of the 555 trigger pin, just like a regular Darlington pair that can turn on a LED with a touch. The diode is there on the trigger pin to prevent a negative voltage spike that falsely triggers the other 555 timer on a 556 chip (learned it the hard way!). The trigger pin makes the output high, turning off the LED and releasing the discharge pin.
- The LED is driven through the 555 output. When no LED is lit, each capacitor is charged by a constant current through the PNP, until one capacitor is at the control voltage, at which point the output and discharge pins go low, and the LED turns on.
- When a LED is on, the /CONT signal goes high and charging stops. This pauses the game and prevents other LEDs from turning on before the player has turned off the on-LED. The /LIT signal connected to the discharge pin is used to tell the control circuit that a LED has turned on. All of the discharge pins for the 9 555s are connected together, taking advantage of the open collector output to form a wired-OR logic.
- Whenever a LED is on, a random current will be fed from the DIS signal. This discharges the capacitor at a random speed, effectively setting a random delay before this LED is triggered again. To make sure that we only discharge the capacitors for LEDs that are on, the emitter of the NPN is connected to the 555 output.


- The 555 output is directly connected to the reset pins of the 9 LED 555s, which means if this 555 goes low, the game ends.
- The capacitor is charged by a constant current source, but as you can see, when WAIT is high, meaning no LED is on, the capacitor is kept low. When a LED does turn on, the capacitor charges until the game ends or until all LEDs are turned off.
- The charging current not only charges the 555 capacitor, it also slowly charges a larger, secondary capacitor. If the voltage on this capacitor is low, it shares some of the 555 capacitor charging current, taking it longer to charge up that capacitor. However, as the secondary capacitor voltage rises, it is able to share less and less of the current, which means the 555 capacitor will charge faster and faster, shortening the timeout period before the game ends. When the game does end, the RST signal goes low and the secondary capacitor voltage is reset.
- The RST signal is only active for a short time before the trigger pin makes the RST signal high. This lets the user turn off the LEDs to start a game. Otherwise the RST signal will keep all of the LEDs on forever. The short pulse also makes a nice signal to control the reset buzzer sound.




And that's how the circuit works in a nutshell! When all the different circuit blocks are combined, the game works quite well. Then I get too excited playing and kept knocking transistors loose from the breadboard. Seems like I've lost too many rounds this way.
Thanks for reading and feel free to comment!
Tuesday, February 22, 2011
555 Contest - Simple Electric Guitar Tuner

The tuner only tunes to the A2 note (110Hz) which is the fifth string on the standard EADGBE tuning, so it's a very basic tuner. But for the number of components used I think it's pretty good.
The tuner works by outputting the beats between a reference 110Hz signal and the signal from the guitar. Basically, when two signals of different frequencies are added together, they interfere such that the resulting signal oscillates between high and low amplitudes. The frequency of this oscillation is the same as the difference between the two source frequencies. For example, if a 110Hz signal and a 112Hz signal are mixed together, the output will have a beat at 2Hz.
So in this circuit, the first 555 runs in the standard astable mode, and generates the reference signal at 110Hz. It's very important to trim the frequency accurately because the accuracy of the reference signal determines the accuracy of tuning. (Protip: not doing this also makes you look silly on video.)
The second 555 is where the magic happens: the reference signal is combined with the guitar signal.
The first problem is conditioning the guitar signal for the 555. Because the guitar output is floating, in this circuit I've attached the guitar ground to the control voltage pin of the 555. The output line goes directly to the threshold pin. This effectively level-shifts the signal so that the threshold pin now simply responds to the polarity of the guitar signal. A guitar has a relatively large output impedance of up to 10kOhms. This is no problem for the threshold pin which has an input impedance in the mega-ohms range. The large output impedance can also be used as part of a low-pass input filter by simply adding a capacitor. This helps filtering out harmonics present in the signal
The second problem is combining the two signals. In this circuit, the reference signal is connected to the trigger pin and keeps trying to make the output high with every cycle. However, the guitar signal is connected to the threshold pin and keeps trying to make the output low. The result is that whenever the two signals have different frequencies, the output will have a changing pulse width, resulting in a visible beat when shown on the output LED.
The second 555 drives the output LED directly, and there is a capacitor across it to filter out any potential high-frequency beats that cannot be perceived by the eye.To tune a guiar, you play the fifth string, and look for the beats on the LED. Adjust the tuning knob so that the beat happens at a slower and slower frequency, until you can no longer notice it - the LED will be at a constant brightness. The fifth string is now tuned. The other strings can be tuned based on the A note.
And that's how this circuit works! Here's a recap in motion pictures form:
Of course, there are still a lot of things that can be improved. First, the reference signal has to be trimmed and is unstable. It can vary a lot with supply voltage and temperature differences, directly affecting the accuracy of tuning. The output is also a little hard to read. But still, using only two 555's and a handful of passive components, it's probably as simple as it gets!
Thanks for reading!
Subscribe to:
Posts (Atom)