I am currently playing around with driving transistors and controlling current with an arduino.
I just use an analogWrite to the pin connected to the base (through a 1k resistor) of a BC547B NPN transistor.... but never mind the transistors for now....
I have noticed that even when I write a value of 0 (0% duty cycle) I am getting ~ 600 uA through my resistor. I measure this by simply plugging a 1k resistor into the pin assigned for analogWrite then measuring the current with my multimeter going to ground.
Other measurements do not make much sense either. When I set the duty cycle to 100%, I only get 1.2 mA through a 1k resistor. By my calcs I should be getting around 5 mA
Also, and this may be normal, but the atmega328p gets pretty warm (maybe 50-60 *C) when plugged into my USB port for a while.
I measured the 5 volt port and it is supplying 4.6 volts, my 3.3v port is right on target (again while plugged into USB).
Ok so a lot of info here but my primary concern is this 600 uA coming out of my PWM port with a 0% duty cycle write. It is not cool because it pushes my first stage transistor into an active mode which pushes my second stage transistor into an active mode and they both get really darn hot until I write about 30% duty cycle - where they are both in saturation.... strange.
Last note - I have let the magic white smoke out of a lot of things that were on and around this poor arduino uno - so the obvious solution would be to purchase a new board and just assume this one is damaged, but I wanted to get some feedback about this leaking current - if that is normal I may have to dust off the PICkit.... ugh....