Pages: [1]   Go Down
Author Topic: How to shortcut pwm and analog pins  (Read 281 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I connected an Arduino output (pwm) pin to the gate of a mosfet. The same gate is connected to another circuit (with its own logic, common ground with the arduino) that can source power in the 0/5V range.
Despite i'm not sure the Arduino board is safe with this connection, I already tried to power it up and everything seems fine and work as expected.

Now Id like to extend my setup with the possibility to read the voltage level on the same mosfet's gate. My first thought was to connect an analog pin directly to the gate but before doing that I realized that I'm trying to read an analog value on a square wave, hence my reading would always be either very near to 0 or very near to 1024. I read somewhere that I need a low pass filter to do so. Do you have any advice on the resistor and capacitor I need, in order to achieve a nice measure?
Also can I connect the analog pin straight to gate ( causing a shortcut between the pwm and the analog pin ) or I risk to damage the board? What about simply adding a resistor?

p.s. I'm quite sure I already read something about this but I couldn't find it anymore!
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23769
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Something like this should work.


* PWMmonitor.jpg (40.13 KB, 960x720 - viewed 23 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you! I'll give it a try
Logged

Montreal
Offline Offline
Edison Member
*
Karma: 23
Posts: 2486
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Probably, you should read Drain voltage or voltage across current sensing resistor in the Source path. Filtered out voltage at the Gate, would be in direct proportion to analogwrite value and has not much meaning
http://coolarduino.wordpress.com/2013/02/05/mosfet-tracer/
Logged

Pages: [1]   Go Up
Jump to: