Yeah, back in Measuring Volts and Amps digitally Post #8
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?
Exactly how much before?
Seriously...I was just thinking...and about something safe too.
Couldn't you wrap a few turns of wire around the power line and look for a bit of voltage induced into that wire? Run that thru a diode and read that wire with the PIC?
Sounds a lot safer than what you are planning on attempting now anyways...
Wouldnt that need a load on the end of the wire? The wire goes from the smoke machine then straight into the circuit
Never tried it...but...if my thinking is right...
A coil of wire around the power cord itself (around, not touching...), a high value resistor in series with the coil, one side of the resistor to ground, one side of the resistor to the PIC pin. The resistor should show a voltage across it if there is current flowing thru the power cord. You'll probably have to put a diode inline with the PIC pin and maybe a small R/C network behind that to filter out the 50hz half-wave and get a decent reading at the PIC.
Unless my thinking is really jacked up (entirely possible), it should work... Not sure how many turns you'd need, might be 10, might be 1K...
That sounds a little complicated. Anything upto 1000 turns :O Ive got to do this 3 times too. I think the 50Hz part will be a problem with every method.
It would be best if i could do the opto way. Problem is i think i need something daft like 20W resistors for it
You said something about a ready light? There is half of the opto-coupler. A photo diode is the other half.
Dave
Always wear safety glasses while programming.
Shouldn't take a 1000 turns to do what I'm thinking. I would think maybe 10 or 20 would handle it just fine. 50hz shouldn't be a problem either.
All you're doing is making a 'transformer' of a sort, tapping into the expanding/contracting alternating magnetic field that naturally surrounds a wire that is carrying a current, inducing a current into that coil, and developing a small voltage across a high value resistor which is the load for that coil.
What PIC? What pin? The datasheets have diagrams of all the inputs showing the clamping diodes. For example, the 12F683 datasheet section 4.2.5 PIN DESCRIPTIONS AND DIAGRAMS has block diagrams of each pin. All but GP3 have clamping diodes to Vdd & Vss. GP3 only has one to Vss. Every datasheet I've ever seen has a similar section. You can also look at Microchip AN236 to see how they detect ZC in an X-10 application.
If you are concerned about the high voltage then your best bet is to use a wall transformer type of DC power supply. It will give you an isolated DC output of whatever voltage you wish.
Bookmarks