Reading PWM (and keeping it "on")
August 8, 2010
I am building a transistor circuit to sense if a motor is on or not. The transistor is there as a simple amplifier so at very low PWM duty cycles (and thus very low voltage) the transistor can bump the signal up to a point where the picaxe can read a simple high or low. The circuit works fine, however I sorta forgot that PWM is really clicking on and off --just at a high rate of speed. Now, lets say the PWM signal is on a 50/50 duty cycle --when I check to see if the motor is running with my little transistor circuit, I have a 50/50 shot (when I check the input pin) of getting a high signal. I need to sorta "keep the pwm on" during the low parts of the cycle. I would think a simple cap would slowly dischage and keep my transistor high as long as the pwm signal keeps coming but I am unsure of the size of the cap or it's polarity. By the way, the incoming PWM signal is protected with diodes so there is no chance of the transistor circuit backfeeding my motor controller and keeping my motors on... I hope.
Here is the question:
Which way does the cap go and anyone got a guess on how big?