Go Down

Topic: TRSS Breakout (Read 1 time) previous topic - next topic

WendelTytan

hello guys, i'm having some doubts and some problems, first i wanted to do this breakout to be able to read the signal input on an arduino eg: how am i going to use the input trrs i wanted to put a song to play on my cell phone for example, and read this signal input on the arduino. in my project the tip input is connected to the A0 input, but it is oscillating without even me connecting the cable, I would like to know how to act on that point, what they recommend, or how to do it


WendelTytan

hello guys, i'm having some doubts and some problems, first i wanted to do this breakout to be able to read the signal input on an arduino eg: how am i going to use the input trrs i wanted to put a song to play on my cell phone for example, and read this signal input on the arduino. in my project the tip input is connected to the A0 input, but it is oscillating without even me connecting the cable, I would like to know how to act on that point, what they recommend, or how to do it

SteveMann

You don't provide much information, like the sketch and a wiring diagram.  Off the top of my head, I would point out that A0 measures 0V to Vcc (depending on the board), and you are sending it an AC signal, likely at 1V P-P.

But without more details, I am just guessing.
Fritzing pictures are NOT schematics. I don't speak Fritzing.

Please do not ask for help by PM. I will not respond. If you need help, post a question on the appropriate forum.

Click on Add Karma if I helped you.

DVDdoug

There are a couple of considerations -

The Arduino input shouldn't be "floating".    It should be pulled-up, pulled-down, or in the case of audio it should normally be biased at about 2.5V so the audio signal can swing positive and negative around the bias.

Audio signals are AC (they go positive and negative).  The Arduino can't read the negative half of the waveform and it can actually be damaged by negative voltages.

There is a bias circuit at the bottom of this post.

With the bias and silence (or no connection) should read about 512.   You can subtract-out the bias in software if you wish.

Quote
in my project the tip input is connected to the A0 input,
Don't forget to connect the grounds.

Quote
and read this signal input on the arduino.
You may know this already but since you are sampling a wave your readings will "look random", even with a constant tone.   But, you will get bigger deviations from the bias with louder sounds.


pert

I've merged/deleted your cross-posts @WendelTytan.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

WendelTytan

@pert

sorry, I didn't know that in many forums it would be considered duplicate, my sincere apologies

You don't provide much information
xD my bad, in the attachment I will leave the demonstration of how I set up the scheme

The Arduino input shouldn't be "floating".    It should be pulled-up, pulled-down, or in the case of audio it should normally be biased at about 2.5V so the audio signal can swing positive and negative around the bias.


huuummm... I wanted to use the oscillation exactly to be able to create some loops in the program

Audio signals are AC (they go positive and negative).  The Arduino can't read the negative half of the waveform and it can actually be damaged by negative voltages.

oh...


There is a bias circuit at the bottom of this post.


I had seen your scheme, but I had searched the internet and found this one with the diode, and talking to my electricity teacher "don't blame her, she is not an expert in creating xD projects" we came to the conclusion that maybe, the diode it would be the safest to assemble, that's what I as a layman thought, but even so, I don't see any changes in the entrance beyond the noise that the entrance gives

of course, I have the pieces you used in the "since I bought it at the time thinking about yours too" scheme to see, I was just frustrated and abstracted, and I was thinking about other problems

You may know this already but since you are sampling a wave your readings will "look random", even with a constant tone.   But, you will get bigger deviations from the bias with louder sounds.


yes, so i thought i had some other problem besides imput

DVDdoug

#6
Mar 19, 2020, 09:07 am Last Edit: Mar 19, 2020, 09:10 am by DVDdoug
There is a way to use a diode.    Take a look at the 2nd schematic here.

D3 is for excess positive voltage so you can leave that one out.

Resistor R1 should be between 1K & 10K for audio signals.   (With a line-level signal use 10K.  1K is fine with headphone signal.)

If the input floats-up with no signal, put a resistor to ground on the input (the output of your phone).  Almost any resistor value is OK (1K -100K).  Again, 10K or more if you have a line-level signal.)

Ideally, the diode should be a Schottky diode.   There are already "small" protection diodes inside the ATmega chip.   Schottky diodes have lower forward voltage than standard silicon diodes so that insures that all of the current goes through the external Schottky.   Or if R1 is 10K Ohms, the internal diode alone would be OK. and you could just skip the external diode. 

That circuit will "kill" the negative half of the signal.   That's fine if you just need amplitude because the negative & positive halves are virtually identical.   But it distorts the signal into the Arduino so you can't use FFT or any kind of frequency analysis, etc.

There is actually an advantage to the protection diode method (compared to the bias method).    If the signal voltage is low, you can switch to the optional 1.1V analog reference for more sensitivity and more resolution.




Grumpy_Mike

The very big problem here is that you have not said what you want to do with this audio signal once it is in the Arduino.

Knowing that we could tell you what sort of interface you need and whether this is practical.

MarkT

The pinout for a TRRS connector from a phone is NOT normally sleeve=ground as you might think.

You need to read up on the various standards, modern phones are usually _CTIA_

https://en.wikipedia.org/wiki/Phone_connector_(audio)#PDAs_and_mobile_phones

You can get CTIA -> TRS adaptor cables if you're not interest in the microphone signal.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

Paul__B


WendelTytan

The very big problem here is that you have not said what you want to do with this audio signal once it is in the Arduino.

Knowing that we could tell you what sort of interface you need and whether this is practical.

the idea of my project is to take the input to make a variation on a led strip (at the moment it's just a rgb led)
for example:
if the input is 100, the led will light up: (106.90,205).
if the input is 120, the led will light up: (72,61,139).
if the input is 150, the led will light up: (25,25,112).

the idea would be to technically transform the music into colors based on the scale and loop that I created oscillating in real time or with the shortest delay possible

There is a way to use a diode.    Take a look at the 2nd schematic here.

D3 is for excess positive voltage so you can leave that one out.

Resistor R1 should be between 1K & 10K for audio signals.   (With a line-level signal use 10K.  1K is fine with headphone signal.)

I will mount it here later to test, interesting :)

Ideally, the diode should be a Schottky diode.   There are already "small" protection diodes inside the ATmega chip.   Schottky diodes have lower forward voltage than standard silicon diodes so that insures that all of the current goes through the external Schottky.   Or if R1 is 10K Ohms, the internal diode alone would be OK. and you could just skip the external diode.  

I didn't take into account that the Arduino itself would have protection systems, my bad.
Schottky diode, I don't have :s, I will have to order if it is extremely necessary :s

That circuit will "kill" the negative half of the signal

killing half the negative wave, it was one of my setbacks while I was thinking about the project, but even so I tried to do it with the diode see the diagram without caring about it because I wanted to see some result first, then I thought of another possibility, but at this point, it seems that if I assemble correctly it will have to be like this

The pinout for a TRRS connector from a phone is NOT normally sleeve=ground as you might think.

You need to read up on the various standards, modern phones are usually _CTIA_

https://en.wikipedia.org/wiki/Phone_connector_(audio)#PDAs_and_mobile_phones

You can get CTIA -> TRS adaptor cables if you're not interest in the microphone signal.
my phone and my pc are: motorola / lenovo, so i used the omtp pattern, because there it is saying that it is the motorola pattern, and on the website i bought the part, so i did as i had seen, now i don't know kkkk i have to use the standard as android then?


//

it's already the second time that i write this post, so if there are mistakes it's because i hurried xD

Grumpy_Mike

Quote
the idea of my project is to take the input to make a variation on a led strip (at the moment it's just a rgb led)
for example:
if the input is 100, the led will light up:
So you are saying the colours follow the amplitude of the input. Then in that case the circuit in reply #5 would be a good start, providing you correctly place the 100K resistor, which should be across the capacitor not totally disconnected from anything else in the circuit. What you have there is called an envelope follower.

WendelTytan

I understand, I think it's according to the image I'm sending, confirm me if that's right.

if it is, i still have the same problems since there is noise, but okay, but if it wasn't that i'm not seeing anything at the entrance :c




Grumpy_Mike

Yes that is better. However the 100K resistor seems to have changed to a 220R resistor.

Quote
i still have the same problems since there is noise,
This is normally caused by the ground not making contact in the circuit. The arrangement of solderless bread board is notorious for things not actually having the wiring you think you have.

This is especially true of the connections to any break out board.

TomGeorge

Hi,
Welcome to the forum.

Have you googled;

arduino music light show

There are numerous examples of what you want to do.

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up