Detecting presence of AC Mains voltage with 1012

Technical Discussions on any InterfaceKits
berkinet
Phidget Mastermind
Posts: 153
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Detecting presence of AC Mains voltage with 1012

Postby berkinet » Mon Aug 04, 2014 12:48 am

I need to monitor the state of a number of 230 VAC circuits to determine if they are on or off. No other information is required. My current plan is to use a number of inexpensive USB chargers like these, and then ties the grounds together at the 1012 and connect each +5v output to an input on the 1012. Based on the 1012 specs, this should work just fine.

However, I would like to see if this can be done in an even smaller package with, possibly, an even lower price. The 1012 offers a good start since it can accept 4-30vdc on its inputs. So, I was thinking of rectifying the AC and then perhaps using resistance to get the voltage down. The current requirements are essentially zero due to the 1012's high impedance.

Aside from the issues of working with line voltage, has anyone tried something like this, and does anyone have any circuit suggestions?

EDIT: After some further searching I found the Fairchild MID400 Power Line Monitor. This looks perfect in that is available in dip format (easy soldering) and only requires 2 external components (See Figure 25. Fuse or Circuit Breaker Monitor). If anyone has experience with this chip, or knows of resources (boards, kits, etc.) with this produce, please respond.

csmith848
Phidgetsian
Posts: 6
Joined: Tue Oct 13, 2015 4:33 am
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby csmith848 » Tue Oct 13, 2015 4:41 am

Hello :)

I hope you managed to solve your problem with the Fairchild monitor.

I have a similar question, less complicated though I think. I have a simple SPDT switch underneath a rotating arm which, when moving, rolls over the button controlling the SPDT switch. I just need to know when the arm is directly over the switch (i.e. when the button is pressed to make the circuit) so that I can then use this info to know when to cut the power to the arm - what is the easiest way to do this?
I guess I basically need to know when the circuit is complete.

Many thanks for your help in advance.

User avatar
mparadis
Site Admin
Posts: 624
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby mparadis » Tue Oct 13, 2015 8:47 am

You can use any of our boards with a digital input to read the state of the switch. In the case of an active-low digital input (every board but the 1012 is active-low), attach one end of the switch to a digital input and the other end to ground. Then, add a pull-up resistor (that is, a 5kOhm resistor that leads to the 5V pin on the board) to the side that leads to the digital input. This way, the input will be at a high voltage (logic false) when the switch is open, and ground voltage (logic true) when the switch is closed.

Once you have the true/false value of the switch in your program, it's just a matter of getting the same program to switch the power to the arm off. If the same board used above has a digital output, you can use this to control a relay that is connected in-line to the power supply to the arm.

berkinet
Phidget Mastermind
Posts: 153
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby berkinet » Tue Oct 13, 2015 8:52 am

You also might want to look at a less mechanical means of detecting position, like a magnet and a hall-effect sensor, or possibly using a light sensor to measure reflected light off of a white area on the disk -- of course, both of these methods need to provide a long enough "contact" time to be captured.

csmith848
Phidgetsian
Posts: 6
Joined: Tue Oct 13, 2015 4:33 am
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby csmith848 » Thu Oct 15, 2015 3:39 am

mparadis wrote:You can use any of our boards with a digital input to read the state of the switch. In the case of an active-low digital input (every board but the 1012 is active-low), attach one end of the switch to a digital input and the other end to ground. Then, add a pull-up resistor (that is, a 5kOhm resistor that leads to the 5V pin on the board) to the side that leads to the digital input. This way, the input will be at a high voltage (logic false) when the switch is open, and ground voltage (logic true) when the switch is closed.

Once you have the true/false value of the switch in your program, it's just a matter of getting the same program to switch the power to the arm off. If the same board used above has a digital output, you can use this to control a relay that is connected in-line to the power supply to the arm.


mparidis - first, thanks very much for your reply. Unfortunately, I'm not that experienced in this area and so I'm having to look up a few of the words used in your reply :)
So that you can better understand what I’m trying to do, I’ve taken pictures of the switch that I’m using (or something very similar) as well as a diagram of my understanding of the wiring you suggest, but I can’t find a way to upload them here so I will have to try to explain.

I had mentioned initially that it was a SPDT switch (with only one of the throws connected) but on closer inspection there is only one external connection - which makes it a SPST switch. This is something like the one I’m using - it suggests it is push-to-break.
There are only two wires in the cable connected to the switch - brown connected to the pole (input) and blue to the throw (output).
Using the 1101_0 board, for example, are you suggesting I should connect the brown wire from the switch to the ground pin of the board and the blue to the digital input of the board (INP1)? Then also place a 5kOhm resistor from the digital input on the board to the VCC pin (in series)?

I appreciate it is obviously a lot easier to explain with a diagram so please let me know if I’m anywhere close. Thanks again!

berkinet wrote:You also might want to look at a less mechanical means of detecting position, like a magnet and a hall-effect sensor, or possibly using a light sensor to measure reflected light off of a white area on the disk -- of course, both of these methods need to provide a long enough "contact" time to be captured.


berkinet - thank you for your reply as well; unfortunately the equipment i have been provided with at the moment does not allow me any flexibility on how to measure the position of arm - I'm stuck with the switch button! but thanks again anyway!

User avatar
mparadis
Site Admin
Posts: 624
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby mparadis » Thu Oct 15, 2015 8:06 am

Actually, I just wired it up and you don't need the pull-up resistor for these digital inputs. Just plug one of the switch wires into ground, and the other into a digital input. Pressing the switch should activate the digital input. I just got confused because I had been working on other non-Phidgets projects this summer that needed pull-ups.

berkinet
Phidget Mastermind
Posts: 153
Joined: Thu Sep 17, 2009 12:17 pm
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby berkinet » Thu Oct 15, 2015 9:47 am

...or, pressing the switch will de-activate the digital input (depending whether the switch is normally open or closed).

csmith848
Phidgetsian
Posts: 6
Joined: Tue Oct 13, 2015 4:33 am
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby csmith848 » Thu Oct 15, 2015 10:06 am

Awesome! Thank you so much for your help guys, I really appreciate it.
I will give it a try and hopefully have no problems :).

Just a last quick question, I don't know if you guys will be able to pick a product out for me..
I want to be able to control the speed of a couple of DC motors as well as do the simple SPST switch stuff through the digital inputs. At the moment I was going to get this board to allow me to control to DC motors and get the 1011_0 as suggested by mparadis to do the switch stuff - is there anything that would allow me to all of this on one board? I was thinking of 1018_2 - PhidgetInterfaceKit 8/8/8 but I don't think it will have the power to do the motors :(

Again, thank you so much!

User avatar
mparadis
Site Admin
Posts: 624
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby mparadis » Thu Oct 15, 2015 10:48 am

If you just want on/off control of the motors there may be a single board that would do it depending on the size of the motors, but if you want to control the speed/direction of the motors you'll need to get a dedicated motor controller board.

csmith848
Phidgetsian
Posts: 6
Joined: Tue Oct 13, 2015 4:33 am
Contact:

Re: Detecting presence of AC Mains voltage with 1012

Postby csmith848 » Thu Oct 15, 2015 11:08 am

Okay.. I think the 1018_2 - PhidgetInterfaceKit 8/8/8 board should do the job if I just want to stop and go


Return to “InterfaceKits”

Who is online

Users browsing this forum: Google [Bot] and 2 guests