Pages: [1]   Go Down
Author Topic: Arduino(1) PWM into Arduino(2) Analog in  (Read 765 times)
0 Members and 1 Guest are viewing this topic.
North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 74
Posts: 2225
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 74
Posts: 2225
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A small value resistor (100ohm) is usually a good idea.  It helps prevent against the situations you forgot about (aka mistakes.)
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 74
Posts: 2225
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Cheers, always good to be safe.
Logged


Pages: [1]   Go Up
Jump to: