I'd like to know which would be the easiest and best arduino oriented module/circuit to convert a variable DC voltage output (example 0.5-2.1V) to an audible audio output for an headphone or something like a 3W amplifier with a speaker.
The idea was having an audio output similar to a metal detector or a geiger/emf meter audible sound. The circuit giving out the voltages should have a detection slope of -25 mV / dB.
As much as I understand of audio stuff, DC voltages should not be connected to speakers directly even if I've heard sound coming from speakers of someone trying with those low voltages, but I imagine it would break after a while.
What about a LM331 circuit based solution? It seems there're already built voltages to frequency boards to use but I don't understand how I would connect the output to a speaker itself.
The Arduino has an analog-to-digital converter that (by default) reads zero to +5VDC. And, there is a tone() function to make sound. But, there is no digital-to-analog converter so you can't (easily) control the volume digitally.
You could use the map() function to convert voltage to frequency (pitch).
You can connect the digital "tone" output to an amplifier through a series capacitor (to block the DC component) and you usually need a volume control.
The Arduino can't directly drive speakers or headphones without an amplifier or driver circuit. (It can drive a piezo transducer.) The minimum resistance/impedance is 125 Ohms (40mA at 5V). You can add a resistor in series with the speakers/headphones and that will reduce the volume, but with headphones it still may he loud enough. And yes, you should also have a capacitor to block the DC. But the DC voltage also gets knocked-down but the resistor so there will be no damage.
The circuit giving out the voltages should have a detection slope of -25 mV / dB.
Do you mean dB SPL? Acoustic loudness depends on amplifier gain/power, the sensitivity/efficiency of your speakers or headphones, and if you're using speakers it depends on how far you are from the speakers and room reflections if you're indoors. The bottom like is that you have to calibrate the system with an SPL meter.
And like I said, the Arduino doesn't have a DAC so you can't (easily) control the volume digitally.
DVDdoug:
And like I said, the Arduino doesn't have a DAC so you can't (easily) control the volume digitally.
Thank for the answer. It sounds like quite some work to do it in the software code. Would it be easier if I'd use an external IC like the LM331 to make it outside the arduino? The mV/DB is the slope for the frequency range from the antenna; the circuit is for a power rf meter called AD8318. It seems that the Vout could be connected to an amplifier from the specifications but in a more complex config, in the one I'll have I see only the two Vout pins and the Vcc of the module.
DVDdoug:
The Arduino can't directly drive speakers or headphones without an amplifier or driver circuit. (It can drive a piezo transducer.) The minimum resistance/impedance is 125 Ohms (40mA at 5V). You can add a resistor in series with the speakers/headphones and that will reduce the volume, but with headphones it still may he loud enough. And yes, you should also have a capacitor to block the DC. But the DC voltage also gets knocked-down but the resistor so there will be no damage.
I think I will follow you method to try to make something out of that circuit. I received it and there's a newer "problem" I wasn't expecting. The AD8318 chip depending on the configuration seems to give out an inverse voltage output compared to the power of the input. So the voltages goes from 2.10 volts to 0 something volts.
So I'd need or something to convert it on a different circuit or use the arduino to actually map the right convertion on the sound output.
One thing I'd like to ask you is how to calculate the right values of the resistors and capacitors to block the DC before connecting to which headphones.