Go Down

Topic: Analogue pass through (Read 1 time) previous topic - next topic

idrisdraig

I want to use an arduino to control where analogue audo signals are routed. Input them on one pin and output them on one of a choice of other pins.

I can't find much information on using mics as anything other than sensors.

Obviously there needs to be some sort of amplifeier between the mic capsule itself and the Arduino. But are the sensor boards like the KY-038 sufficient, and having got a voltage onto the Arduino, is it simply a case of coding voltage at pin A = Voltage at pin B?

Grumpy_Mike

#1
Feb 09, 2018, 05:08 pm Last Edit: Feb 09, 2018, 05:09 pm by Grumpy_Mike
Quote
is it simply a case of coding voltage at pin A = Voltage at pin B?
No.
What do you want to do with the audio signal?
You might be better using an analogue multiplexer chip like a 4051 or 4052. Make sure your audio is biased to 2.5V and does not exceed 5V peak to peak.

DVDdoug

#2
Feb 09, 2018, 06:52 pm Last Edit: Feb 09, 2018, 06:57 pm by DVDdoug
What do you want to do with that "routed" signal?   

What's the Arduino going to do with the signal?

What are you really-really trying to do, before you go-off in the wrong direction?


Quote
I want to use an arduino to control where analogue audo signals are routed. Input them on one pin and output them on one of a choice of other pins.
Not the Arduino because the Arduino doesn't have any analog outputs.

If you don't really need to switch, you can  connect multiple inputs  together so you could run an audio signal into the Arduino and into an amplifier at the same time, or into two amplifiers at the same time, etc.   (As a general rule, you should NEVER connect two outputs  together.)

Quote
I can't find much information on using mics as anything other than sensors.

Obviously there needs to be some sort of amplifeier between the mic capsule itself and the Arduino.
Yes, you need a preamp.   A microphone puts-out a few-millivolts depending on the loudness of the sound, the distance from the sound source, and the microphone sensitivity.

For example, audio mixers have built-in preamps.  Soundcards and audio interfaces also have built-in preamps.   

Line Level (and headphone level) signals are in the ballpark of 1V (again depending on loudness, etc.).    The audio signals in & out of your TV or stereo are line-level.   

The Arduino analog input is 0 to +5V, which is in the same ballpark as line level (except audio signals are AC, so they swing negative).

An electret condenser microphone capsule also needs to be "powered".  All condenser mics need power.   Studio condensers use 48V phantom power.   Electret mics run from lower voltage and computer mics get 5V  from the soundcard.  Dynamic mics (like the famous Shure SM57/58) don't need power (but they still need a preamp).

Since the Arduino can't read the negative-half of the AC audio waveform, the signal has to be biased at 2.5V (if it's actually an audio signal). 

Quote
But are the sensor boards like the KY-038 sufficient, and having got a voltage onto the Arduino, is it simply a case of coding voltage at pin A = Voltage at pin B?
Maybe...  I couldn't find the "real specs" or a schematic for that board.  It has a binary digital output that goes high when the sound is above the threshold (set by the pot).   

It has an analog output but I don't know how that works.   It could be an amplified & biased audio signal or it could be a varying DC signal that's proportional to the loudness.
 

idrisdraig

Sorry. Obviously not enough pertinent information.
I'm trying to build something a bit a like a multi-room intercom system.

The mics thefore don't need to be anything more than simple electret capsules. (I may just buy cheap wired intercoms and link those to the "router", and then add add the other necessary features.)

The Adruino would primarily just control which locations can talk to eachother.

Grumpy_Mike


DVDdoug

Quote
I'm trying to build something a bit a like a multi-room intercom system.
Relays, or analog switch chips, or analog multiplexer/demultiplexer chips.

Relays are simply electrically-controlled switches so they are the least-likely to cause you trouble, but you need a driver circuit because the Arduino can't directly power a relay coil.   You can get relay boards with multiple relays and drivers on a board.

Relays can switch the signal to the speakers.   The "little chips" can't handle that power so you'd have to route the line-level signal to the speaker and put a separate power amplifier on each speaker.

Quote
The mics thefore don't need to be anything more than simple electret capsules.
Of course, you still need the preamp and the preamp needs to power the capsule.     And, you'll need one or more (small) power amplifiers to drive the speakers.    (You can find schematics for both online.)

CrossRoads

Small telecom relays would be good for switching audio signals, and Ardiuono can drive them directly.
Example:
https://www.digikey.com/product-detail/en/te-connectivity-potter-brumfield-relays/D3223/PB1107-ND/1633993
Don't forget a diode across the coil.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

idrisdraig

Thanks to all for the advice.

Am I right in thinking what defines a telecoms relay (as linked to by CrossRoads) is one that operates two "switches" concurrently?
If that's correct ...

In the context of the above advice, I'm now looking at using cheap commercially available intecoms, and just using the Arduino to act as a router. As these are unlikely to be duplex units, is something like the Arduino 4 Relay Shield a satisfactory solution?
https://store.arduino.cc/arduino-4-relays-shield

manju075

I want to play a song using ultrasonic sensor but while playing time i want to interrupt through button to play a another song
And even i want to control the sensing distance through pot.
            so anyone can help me in this........pls


Grumpy_Mike

Quote
Am I right in thinking what defines a telecoms relay (as linked to by CrossRoads) is one that operates two "switches" concurrently?
Any relay that operates two switches at the same time is known as a double pole relay DP. And if the contacts have a normally open and normally closed contacts is known as a double throw, or DT. So the relay you want is defined as a DPDT relay.

idrisdraig

So what defines these as telecoms relays? Their max current?


PerryBebbington

idrisdraig

Not sure if you are still reading...

I have always worked in telecoms. I would not recognise any modern relay as a 'telecoms relay'. Relays used to be used extensively in telecoms to provide the intelligence and control for switching phone calls. AFAIK Relays were not used to do the actual switching, other than reed relays used in the semi electronic exchanges of the 1970s and 1980. In the days of purely electromechanical switching specialist electromechanical switches (calling them 'relays' would be like calling a jumbo jet a 'light aircraft') were used, search for Strowger and Crossbar for more information. The relays themselves were quite robust and of a modular design incorporating a range of different contact and coil arrangements. I imagine you would only see them in a museum or a collector's garage these days.

If I were doing what you want to do I'd follow the examples given by Grumpy_Mike, 4051, 4052 or similar analogue switches. Have a look at my post in Telephone for an example of a relay based switch matrix. The example I have given can easily be implemented in CMOS switches instead of relays.

Go Up