I’m currently using my cRIO as a test bench, as opposed to driving it around like an RC car.
I thought it’d be fun if it made a “ding” when it finishes a test. (a buzz or a beep would be fine too; some kind of distinct sound)
What’s a good way to do this?
These are the options I see:
wire something up to a solenoid output (requires the robot to be enabled)
create a circuit to amplify a digital output and wire up a buzzer or beeper to that
I suppose if there’s something over SPI or I2C, that could work as well. I’m using the RS232 port for CAN.
Thanks!
It says 300-500hz, so I’m guessing it includes a switcher.
Apparently the digital module can put out 64mA, but I think I’ll use a small transistor to amplify it. 6V*20mA = 120mW. A 2N2222 should do fine, but I hope the buzzer will run on 5V.
My experience with these is they include very rudimentary, very noisy types of signal generators (see one person’s teardown), so I suspect the range is in fact a range, and the frequency depends on the specific amount of voltage/current being supplied to the device, environmental factors, etc. 5 volts should work fine.
You can connect a small speaker and a 555 timer to make a cheap beeper. Radio Shack had a three wire piezo on the shelf for a long time. This would self oscillate or could be connected with a 2N2222 for feedback operation. The feedback made it highly efficient. I could not find it on their website though.
As Ether pointed out, a digital output could make a nice beeper if you couple it to an LM386 or equivalent and a speaker.
Do you think it makes a difference in this case if I use a linear op-amp vs a transistor? I would expect them to perform the same if there’s only 2 states: 0v and 5v.
How do you determine the capacitor size? (Because the GPIO are pulled high, I could burn up the speaker without a capacitor if I was running a program that didn’t set that channel low. I suppose the other way would be to use a MOSFET. I have plenty of those from Jaguar’s I’ve burnt up.)
EDIT:
I’ve never heard of a piezoelectric speaker having 3 wires. How does that work?
Could you just connect the tweeter to the RTS or DTR pin of the cRIO’s RS232 port and toggle it at a sufficiently annoying frequency? (like perhaps the tweeter’s resonant frequency - if it’s low enough to hear
I suggested the LM386 since it is designed for low impedance loads. A speaker connected across one of the digital outputs will likely exceed the current rating on the driver trying to sink current with an 8 ohm load. A 1mmf/16v electrolytic cap in series with the input should handle most frequencies you send it. The chip is self biased for single polarity power and can operate down to 4 volts.
If you are using one of the piezo devices, a simple single transistor driver should work fine.
Do you remember Monty Python’s “The Meaning of Life” movie. The pregnant woman in the delivery room and the machine that goes “PING”. You should have your own machine that goes “PING”. I like machines that go “PING”. They intimidate non-techies.
Yeah, it might not be able to source enough current to an 8 ohm load to be as loud as you might want.
It shouldn’t hurt the transceiver though. RS-232 drivers and receivers must be able to withstand indefinite short circuit to ground or to any voltage level up to ±25 volts.
*I was referring to the RTS pin on the cRIO’s RS232 port.
On the PCs I have tested here, I can connect a small speaker directly to the RS232 port’s RTS pin and – by toggling the RTS line at an appropriate frequency – get a sound loud enough to grab your attention from across a large room.