Im going to get components to try both methods just incase one fails. How do i work out the wattage i need for the 10M resistor method? I can use the maths from that LED page to work it out for the opto but i dont know about the PIC. I assume the PIC counts as some kind of load but only a small one
240 (E) / 10000000 (R) = 0.000024 (I)
0.000024 * 0.000024 = 0.000000000576 (I squared)
0.000000000576 * 10000000 = 0.00576 watts (I squared * R)
or
240 * 0.000024 = 0.00576 watts (I * E)
The clamping diodes will conduct when the voltage is > Vdd (+ diode drop) and when the voltage is < Vss (- diode drop) so, in essence, you have the resistor in series with a diode with 240V applied. The above calculations have ignored the forward voltage drop of the diodes as that's insignificant in comparison to 240V.
Last edited by dhouston; - 23rd October 2008 at 15:04.
Ive just realised that skimask has already given me the formula for that.
I should have realised but i was thinking of the formulas on the LED page. They also use ohms law so it must be the same kind of thing but as i understand it they work out the wattage based on the current required by the LEDs.E = IR, P = EI, therefore P = IIR
Im gonna read through all 3 ways of doing it again and see if i can understand exactly whats happening in all of them. I can see that the one you just gave me and the one skimask gave me are practically the same just written a little different.
Hi, my 10M resistors arrived today. Just before i blow myself up (or even worse another PIC :P) i wanna be sure what im doing. Ive looked in the datasheet for my PIC and the only mention of "clamp" is input/output clamp current which is 20mA. Does that mean it has those clamping diodes or is that something else?
To connect it up am i right in thinking that the neutral wire connects to VSS and the live wire connects through the resistor into an input pin and thats all there is to it?
Bookmarks