• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Is there a way to use an "unused" connection on an A/C microswitch as a digital input to an Arduino/Photon

Jonpcar

New Member
Hi all, first post here, thanks for looking! Sorry, I edited this post and it seemed to disappear...

I am working on a pool controller project using an arduino-like microcontroller (particle.io Photon). I am a many-year retired EE who never worked with AC circuits, haha.

I am trying to figure out how I can get feedback from an existing pool valve switch to determine position information about the valve itself. There are unused (NO) connectors on the microswitches inside the valve actuator itself, that become closed (connected to common) when the valve is in either the right or left position. I would like to be able to read if the switches are open/closed whether or not there is 24V AC on the white wires.

To the right of the valve diagram is my conundrum...below that on the right is a simpleton's version of what I would like to do, but probably not possible due to the fact that there may or may not be AC voltages on the white wires.

I hope this makes sense...Thanks again.

valve_sch.jpg
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
If you can live with a 40mS delay then a resistor and zener will give you a suitable signal. Is the arduino running at 5V?

Mike.
Edit, if you can safely ground the AC voltage then your idea should work.
 

Jonpcar

New Member
Lots of folks on here who can weigh in. Since I am here now....Would these help?

Using an optoisolator like this:


or a bridge rectifier plus an optoisolator like this:

DrG, thanks...I can see how those chips would be very useful to do what I want (with their AC input side connected between common & NC) ...IF the 24V AC signal stays ON the white wires when the micro switch is opened. I suppose I was hoping that after I turn the valves to a position, I could shut off the AC power supply as well and still "read" the valves' positions. I don't think that's how my commerical controller works currently, it leaves the AC voltage ON. So I may have to live with that.

If you can live with a 40mS delay then a resistor and zener will give you a suitable signal. Is the arduino running at 5V?
Mike, I can live with any sort of delay. These valves move in slow motion and I am only wanting to read their end position to confirm it, and monitor that there has not been a failure in the valve mechanism/motor/etc. Does your method also rely on keeping an active AC voltage on the white wires? My photon is actually a 3.3v device but is 5V tolerant.

Truthfully, AC current is kind of a mystery to me...I haven't seen any since school, and have never developed any circuits, etc. based on it.
 
Last edited:

JimB

Super Moderator
Most Helpful Member
My advice would be to use an opto-isolator to pick up the AC signal from one of the micro-switches.

Or, if you want an indication which works in the absence of the 24vAC supply, maybe you could fit an extra micro-switch on top of one of the existing switches. ie using the same mounting screws.
This of course assumes that there is physically enough room to do that.

JimB
 

Jonpcar

New Member
My advice would be to use an opto-isolator to pick up the AC signal from one of the micro-switches.

Or, if you want an indication which works in the absence of the 24vAC supply, maybe you could fit an extra micro-switch on top of one of the existing switches. ie using the same mounting screws.
This of course assumes that there is physically enough room to do that.

JimB
Jim thanks...I hadn't thought of the "mounting on top" idea and went out and took some pictures. It looks like that is very possible. The "cams" that actuate the micro switches are actually double wide and both would support another micro switch. I really like this idea because then I can avoid AC circuits entirely, haha.

I will look around to see if I can find this same switch and/or if they make a "dual pole" version of it that would mount with the same screw hole.
20190714_080556.jpg
 

Jonpcar

New Member
Thanks for all the help everyone...I did order these...not exactly the same mechanism on the end but I think they will work (ones exactly the same would take a bit more time, or cost a lot more, haha...and I am pretty cheap). In addition, they are cheap and I can get them relatively quick to try. I'll let you know how it works out!

 
Last edited:

KeepItSimpleStupid

Well-Known Member
Most Helpful Member
Without building it yourself, there are I/O modules such as this. http://www.grayhill.com/assets/1/7/IO_Mod_AC_DC_Input.pdf

Logic level versions are 5, 15 and 24 VDC. You need an AC input module for 24 VAC. They are usually mounted on a backplane.

The DR series here http://www.crydom.com/en/products/digital-i-o-modules/ mount on a DIN rail

This http://www.gravitech.us/buacinbo.html is a really cheap version that also uses a backplane. You would have to change components to work on 24 VAC. It basically makes a reactive power supply with an optoisolator.

There are other methods too. e.g. OPTOMOS relay replacing the optoisolator and some IC based solutions wit controlled switching points. They were HP. Alegro and now, I think, Broadcom parts.
 

Jonpcar

New Member
KISS, thanks...I am going to try out the micro-switch idea for the valves...as it turns out I should could get those switches tomorrow. Isn't Amazon great!

This http://www.gravitech.us/buacinbo.html is a really cheap version that also uses a backplane. You would have to change components to work on 24 VAC. It basically makes a reactive power supply with an optoisolator.
I like this idea for a different part of my project...when I get there I might order these. I have two 120V Stenner Pumps that control injection of my acid and my chlorine. It is one thing to turn them on/off with relays...it is another to monitor that all those relays/circuitry work exactly as planned (and don't stick or get stuck ON).

I have some concerns (probably overkill) about my chlorine/acid relays being stuck ON and emptying the entire contents into my pool. Anyway, monitoring the actual AC voltage to the pumps would allow an "emergency shutoff" (through a separate in-series relay) of the AC in case there is a problem like that.
 

KeepItSimpleStupid

Well-Known Member
Most Helpful Member
Are you using a peristaltic pump? Go solid state?

Monitor ON time. The motor looks like a typical AC synchronous motor. Two windings, one together making a common.
The two wires left go to a capacitor. CW and CCW are determined depending on how power is applied. Common and one end of the capacitor. What end determines direction.
 

Jonpcar

New Member
Are you using a peristaltic pump? Go solid state?

Monitor ON time. The motor looks like a typical AC synchronous motor. Two windings, one together making a common.
The two wires left go to a capacitor. CW and CCW are determined depending on how power is applied. Common and one end of the capacitor. What end determines direction.
Yes...these peristaltic pumps are very nice for this purpose. And monitoring ON time is what I am planning. Truthfully, I'm having a lot of fun playing around with this Pool Controller project, something I really haven't done since I was a kid with Radio Shack electronics kits.

I've been trying out a lot of things for the first time. Here is another possibility for the ON time monitoring of the Stenner pumps. I have ordered these...but they won't get here until September, haha.


It is simply amazing to me that all these parts are so available and so cheap. If anyone is interested, here is where I am documenting my Pool Controller project:


Anyway, thanks for the all the ideas (I am learning from each of them)...most of this is totally new to me and I do appreciate the help.
 

Jonpcar

New Member
An update...I received my new switches a couple days ago and installed them yesterday. The install was problematic because there was actually no good way to install the micro-switches on top of the existing switches without permanently impacting the current implementation.

So instead, to avoid permanent irreversible changes, I stacked TWO of the new micro switches to replace each existing micro switch. Super glue was the only viable method I had to stack them on top of each other (special screws have been ordered). Bottom line: it works, I now have a separate DC circuit path for my “arduino” read of the valve status.

BUT, I don’t like these cheap switches and decided immediately that these would not be the permanent solution...and will order OEM replacements. It was an interesting and relatively easy test case, but these cheap switches would probably introduce more problems than they actually help resolve. So the project is not done yet...

Thanks again to all!
 
Last edited:

KeepItSimpleStupid

Well-Known Member
Most Helpful Member
Another idea is to compute energy useage in some amount of time and compare against a value. You could also do run time over agiven amount of hours too. Agreed, it's not the same as valve stuck.
 

Latest threads

EE World Online Articles

Loading

 
Top