joseLB wrote:Hi Dany
For glowing leds with a pwm (12V), without usage of a triac, do you devise a simple circuit to "sense" the touch? Preferably something withou any extra component besides the pic?
Something like:
1- an open pin in pic, maybe
one of the comparator pins, where the noise induced voltage at touch would be "sensed" as a change from 0 to 1?
I think this could work (I never tried it). But I think the pin should not really be left floating as such (it could have any voltage when not touched doing so). Al least it should have a high ohmic bleeding resistor should be connected to Vcc or ground (like 10Mohm).
joseLB wrote:2- or a fixed 2 near spots, one at any pic port, the other at ground, where finger resistance would drop a voltage? But, as pic needs a low impedance to drive it (15-20K maximum), I think this approach will not work.
This could work too (I never tried it myself). Here again, the "sensor" pic port should have a high ohmic (10 Mohm) resistor to the Vcc, otherwise it could have any voltage when not touched).
joseLB wrote:3- Or a comparator pin open, and the other side of the 2 point spot at ground?
I think this one has the best chance it will work. Again: a high ohmin resistor to Vcc on the sensor pin is needed.
joseLB wrote:4- so, my ideia is something like a small 16F (or 12F) with a pwm +eletrolitic to make the Vcc to 3-4 serial leds conected to a BD139 or directly to n pic pins in parallel (soft pwm in this case), and a kind of sensor that is directly a Pic pin, like the comparator port.
I have a few remarks on the electric circuit:
- The leds should be polarised the other way around.
- The base voltage of the BD139 can be maximum 5V (it comes from the PIC), while 4 leds in series need more than 5V, they will never light up.
Placing the BD139 below the leds will solve the problem.
- If you place the BD139 below the leds then it will need a base resistor (between its base and the pic pin) of approx. 1Kohm. If you use a pic pin with open drain for this (some ports are open drain, depending on the PIC) you will also need a pull up resistor (1Kohm also) between the PIC in and Vcc.
- The current in the leds is limited to (12V - (4x Vled)) / R2. I think it will be in the neighbourhood of 200 mA. Can the leds take that (especially at high duty cycle)?
- I am not sure about the PWM circuit (especially the electrolytic cap), I do not have experience with PWM yet.
joseLB wrote:5- a better and or simpler idea? That is, just a pic, some serial leds high bright, and a 7805... at worst, a bd139 or similar.
No, not better ideas, I would choose for touch opion 3, and placing the BD below the leds with addition of a base resistor.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)