Go Down

Topic: How to shortcut pwm and analog pins (Read 440 times) previous topic - next topic

luky83

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!

CrossRoads

Something like this should work.
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.

luky83


Magician

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/

Go Up