I have an input on audio level with low noise. When this input is activated and has signal on a measurable level I want the Arduino to be activated. Any suggestions on how to make this...?
What do you mean “ activated” ? Powered up ? Digital output set high ?
The audio signal will be an AC signal , you will need to do something about that as Arduino can only accept DC signals .
And what do you regard as a "measurable level"? 2mV, 50V, somewhere in between? Numbers are useful, terms like "measurable" and "audio level" are not.
Steve
Yes... What kind of signal? A microphone signal (a few millivolts), a line-level signal or headphone signal (about 1V), a speaker signal (maybe several volts)?
In any case, you'll need to [u]bias the input[/u] (two resistors and a capacitor). You have to do that because audio is AC and it swings negative. The Arduino can't read negative signals, and in-fact it can be damaged by negative signals. And/or the negative-half of the audio signal can be "damaged" (distorted).
With the analog input biased at 2.5V (half of the 5V range) the ADC will read about 512 with silence. With audio signals the readings will "jump around" above and below the bias level. The louder the sound the greater the readings will deviate from ~512.
In most cases you'll want to subtract-out the bias, but that depends on how you want your program to work.
Once you are "reading" the audio, it's simply a matter of using an [u]if-statement[/u] to do one thing when the signal is above your chosen threshold and do something else if it's below the threshold.
Ok, sorry for the delay...
The signal is an ac, 1 Volt peak to peak. The Arduino should be in "sleep" mode and when the signal is above a certain level, to wake up...
1v pk/pk will need amplifying and converting to DC if you want to make a signal to
Wake up the Arduino, and the AC at least needs biasing so it’s 0 to +2v pk/pk.
Why does the Arduino need to sleep ? - do you really mean that it so you just want it to do nothing below a certain audio level ?
Your signal conditioning circuit is going to take power anyway
Have a study of Arduino sleep , and methods of waking it up
.
It might save time to say exactly what u are trying to do .
I've never used sleep mode but on the hardware side consider an [u]analog comparator[/u]. I can give you a "digital pulse" when the analog voltage is above the threshold (which you can set with a pair of resistors).
...The Arduino itself can work as a comparator, which is pretty-much what I described above, but it can't compare while it's sleeping.
Ok...
Also in case I want to use Arduino Pro Mini 3.3V, here:
using-the-arduino-pro-mini-33v
it says:
"If you have a supply that’s greater than 3.3V (but less than 12V), you’ll want to connect that to the RAW pin on the Mini. This pin is akin to the VIN pin, or even the barrel jack, on the Arduino Uno. The voltage applied here is regulated to 3.3V before it gets to the processor."
So in order to achieve longer time duration on the circuit, it is better to use a 6V Sealed Lead Acid battery or a 3.7V Lipo?
DVDdoug:
I've never used sleep mode but on the hardware side consider an [u]analog comparator[/u]. I can give you a "digital pulse" when the analog voltage is above the threshold (which you can set with a pair of resistors)....The Arduino itself can work as a comparator, which is pretty-much what I described above, but it can't compare while it's sleeping.
Ok, the RMS of the AC signal should be over a threshold, or the mean value of the AC signal?
Ok, the RMS of the AC signal should be over a threshold, or the mean value of the AC signal?
Neither, it is the peak level which should be over the threshold.
The enclosed wll provide a negative-going trigger when an audio input > ~ 1v p-p occurs, and use almost no current until then
Allan
ps just noticed - R2 should be eg 22k
mictrg.pdf (19 KB)
allanhurst:
The enclosed wll provide a negative-going trigger when an audio input > ~ 1v p-p occurs, and use almost no current until thenAllan
ps just noticed - R2 should be eg 22k
Thank you...
On "arduno input set for -ve trigger interrupt" what kind of signal do I get?
A number of negative goings pulses depending on the audio signal.
The sw's up to you.
Allan
allanhurst:
A number of negative goings pulses depending on the audio signal.The sw's up to you.
Allan
I suppose these pulses will be used to provoke interrupt on the Arduino? But does Arduino work with negative pulses? Don't I need positive pulses? Thank you...
No. Look in the reference section.
Or, of course, the end of a negative pulse is a positive edge, so you'd catch it either way.
Allan
allanhurst:
No. Look in the reference section.Or, of course, the end of a negative pulse is a positive edge, so you'd catch it either way.
Allan
Ok I have simulated and it works just fine.
Something I wanted to ask, is what happens with the frequency of the signal? What is the max frequency signal that Arduino can handle?
It depends on what your ISR is doing but you can go up to 1MHz, which is more than enough for your needs.
allanhurst:
The enclosed wll provide a negative-going trigger when an audio input > ~ 1v p-p occurs, and use almost no current until thenAllan
ps just noticed - R2 should be eg 22k
In case the signal sometimes is between 0.5 V p-p and 1.5 V p-p what modifications should I do to the circuit? Can I use a pot and adjust it, concerning what p-p I have?
You need at least 0.7v p-p to turn the transistor on. Above that it doesn't matter up to many volts.
If you need greater sensitivity I'll have a go.
Allan
allanhurst:
You need at least 0.7v p-p to turn the transistor on. Above that it doesn't matter up to many volts.If you need greater sensitivity I'll have a go.
Allan
Ok, between 0.7 to 1.5 Volt p-p then, no problem. What modifications should I do on the circuit?