Pages: [1]   Go Down
Author Topic: PWM as ground...is it possible?  (Read 782 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys, can i use pwm to connect to ground?
For example, when i set pwm to be 0, can the pwm pin receive current? Can it be used to saturate a PNP BJT by acting as a ground for the transistor's base? If yes, how many mA can it handle as a ground?

Thank you in advance and have a great day smiley
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys, can i use pwm to connect to ground?
For example, when i set pwm to be 0, can the pwm pin receive current? Can it be used to saturate a PNP BJT by acting as a ground for the transistor's base? If yes, how many mA can it handle as a ground?

 First, the maximum current (flowing in either direction) that any Arduino pin (including a PWM pin) configured as an output can withstand without potentially damaging pin's internal circuitry is 40 mA, and it generally a good idea to keep the current 10 mA to 20 mA below that if you can.  So put a resistor of at least 220 Ω between the pin you are going to use and the transistor.

Second, to make any I/O pin low (i.e. have the same voltage as the Arduino's ground) you just set the pin to be an output with pinMode() and use the digitalWrite() function.
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2811
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Third, the voltage cannot exceed Vcc for the Arduino... Even with a 220 ohm resistor. Dire things will happen.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the answer and the info but you haven't really answered my question.

What i am basically asking is this:

http://arduino.cc/en/Reference/Constants
"When a pin is configured to OUTPUT with pinMode, and set to LOW with digitalWrite, the pin is at 0 volts. In this state it can sink current, e.g. light an LED that is connected through a series resistor to, +5 volts, or to another pin configured as an output, and set to HIGH. "

Can i achieve the exact same thing by setting a pwm pin to 0? In other words, if a pwm pin is set to 0 then can it sink current?

Again thanks :>
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2811
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Farseeker answered your question, so did I neither of us said it was impossible. We did state the conditions. The pin can either source or sink 40 mA. At 50% duty cycle or 1/2 "Voltage out... the pin will sink as much current as it will source.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot guys smiley Have a nice day
Logged

Pages: [1]   Go Up
Jump to: