I hadn't even realised that we were on to Doug's DIY Test Equipment Challenge and, look, shabaz has finished already with his Cyclops-1000: An Electronic Eye for Rotational Speed Measurement. I bet he's sitting there thinking he's won. We can't let that go unchallenged, so here's my first try. I don't expect it will win; not just because I'm posting it in the wrong place and technically I can't win, but also because I've just thrown it together without all the careful thought and consideration that Shabaz put into his (and I'm not even going to try and match all his fancy graphics).
I proudly present the ByEar 2000. It's a logic probe and its unique selling point is that the output isn't LEDs but rather sounds from a loudspeaker. It's not a new idea (I build something similar back in the 1980s and it wasn't original even then) and you probably don't even need a logic probe anyway but, it's a nice simple circuit, it will cost you hardly anything to build, and it can be the basis for experimenting with comparators even if you don't have boards full of logic to test. (It's 2000 because I reckoned we needed to get some name-inflation into this competition and 2000 is twice as good as 1000, isn't it.)
The other thing about it is that there's no processor and no programming - this is just pure hardware. [Sorry if you were looking forward to seeing me struggle to install IDEs and mangle code into shape - somebody else will have to do that one.]
Here's the circuit diagram
The parts represented by triangles are comparators. Operation of a comparator is quite simple, the two inputs are compared and the output driven depending on which is higher than the other. This part that I've chosen is a quad comparator - that just means that there are four of them in the package and they share the power connections. The LM339 is very low cost and is available in a DIP package, so it's nice to experiment with. One thing you need to know is that I've drawn the circuit using the TI-TINA simulator that's available from TI and that package isn't intended for PCB layout, so each comparator you see on the circuit has been given the same pin numbering (a proper layout package would understand about multiple comparators in a single package and allocate the pin numbers accordingly). I've drawn on the pinning that I used for the prototype.
How does the circuit work? We can consider it composed of two halves. U1 and U2 compare the input to fixed voltages from the potential divider made up of R1, R7, and R8. If the input is below 30% of the supply voltage the output of U2 is set low. If the input is above 70% of the supply voltage the output of U1 is set low. If the input is between those two levels, both outputs are off (they are off rather than high because the output can't go high - it's just the collector of a transistor and the output would only go high if there was a pull-up resistor there). The other half of the circuit is U3 which is working as a relaxation oscillator - this is what is producing the waveform that will be turned to sound by the loudspeaker. The frequency of oscillation is controlled by R2 and a capacitor to ground. In this case, the outputs of U1 and U2 connect either C1 or C2 to ground, so we get a different tone for the high logic level to the low level (the high level sound will be about an octave above the low level sound). When the input is between the logic levels, no capacitor is selected and the output will be silent. For the output, I used a miniature 40 ohm loudspeaker.
Power comes from the circuit being tested (so the logic levels will relate to that supply voltage). The comparators will operate on anything from 3V up to 30V, so you could even use it with old 4000-series CMOS designs working on voltage rails higher than 5V. The levels here are for CMOS. If you wanted to use it with TTL levels you'd need to adapt it a bit - I'm going to leave that as an exercise for the reader.
Before I built it I tried in in a simulator. Here's the first half - the logic level comparison - with voltmeters to tell us what the output of each comparator is doing.
Here are the waveforms with a triangle wave as an input. You can see how U1 output goes low when it gets above about 3.5V and U2 goes low when it's below about 1.5V. That gives me confidence that it will work when I build it.
Here is the second half - the oscillator. I've just connected it with the 22nF capacitor. There's a voltmeter to measure the voltage across the speaker and an ammeter to show us the current through it.
Here are the waveforms. The waveform in the middle is computed by the simulator - I just asked it to multiply the volts by the amps to show power. It looks like the average power to the speaker is about 7mW. That's not all that much but we should be able to hear it and it keeps the power consumption of the probe quite low.
Now for the proof of the pudding. Here's the circuit built on a prototyping block
And, finally, here's the video of it beeping just to prove that it works. It's not very good but it will have to do. I'm touching the input (the yellow wire) on to the positive and negative supply wires in turn so you can hear the sound.
If you don't like the design decisions I've made then it's simple - change it! The simplest starting point for experimentation is with the two capacitors that set the tone. Try different values and see what happens. If you've got an oscilloscope, maybe probe around the oscillator and see if you can understand what it's doing and why it oscillates. There's also a spare comparator in the package, so there's scope for adding functionality if you think it should be more capable. If you want to experiment further with comparators, download the datasheet here
http://www.ti.com/lit/ds/symlink/lm339.pdf
and you'll see that there are lots of handy circuit suggestions in it there that you can use directly or adapt. Any questions? Ask in the comments and I'll do my best to answer.
Top Comments