Go Down

Topic: Arduino(1) PWM into Arduino(2) Analog in (Read 852 times) previous topic - next topic

pYro_65

Hi all, just a quick one, I have to produce some frequencies on my Uno to help develop another app on a Mega.
I'm looking around for a simple circuit to connect the Arduino to a headphone jack, but for now PWM will be suitable.

My initial problem is I'm sampling a little mic setup ( freetronics module ) but it has incredible noise on the line, so for testing purposes I want a clean signal.

Is it fine to simply connect the grounds together and wire the Uno PWM pin directly into the analog in pin?
Or is a resistor needed to prevent a short circuit?

Also anybody tried and had good results with any headphone jack circuits, everything I have looked at seems to be a variation of some sort of peak detector, whereas I want raw audio biased for Arduino voltages.

James C4S

Connecting a PWM directly into an Anlaog Pin won't in analog.

You'll get 0 (or close to it) or 1024 (or close to it) depending on when you sample the signal.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

pYro_65

Yeah, thats cool, I'm using the max and min values to configure graphs on a tft and play with things like zero crossing calculations.

I plan to use a pot to vary the amplitude if needed, I was just wondering if the connection needs some sort of over current protection.

James C4S

A small value resistor (100ohm) is usually a good idea.  It helps prevent against the situations you forgot about (aka mistakes.)
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

pYro_65


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy