LED optical sensor

randytsuch

LifeTime Supporter
Mar 29, 2008
519
Los Angeles, Ca
I wanted status from my Hayward SWG, and read somewhere that someone wasn't getting status over the RS485 interface. For whatever reason, the Hayward didn't set the bits like it should.

So I decided to build an optical sensor to read the LEDs.
Project link Still working on this page, but gives some basic information on what I did. I'll be adding more pictures and some details.

This is intended to help someone that already understands things like Pi's, ESP32's, and how to use them in a smart home setup.
I will describe what I did recently, but I already have a pretty extensive smart home system using Home Assistant (HA) and Node Red.

This project uses an ESP32 to read the LEDs with photo transistors, then sends the values to a Pi running HA over MQTT. I use HA to figure convert the value to on or off, and then display status of four LEDs.
I need to add some logic to Node Red to send alerts if I have flow or check cell LEDs.

Figured this might help a few hardcore diy types who want to get status from some LEDs somewhere.

Since the Hayward is in a metal case with a door, its dark when you close the door so it makes sensing the LEDs easy. Lots of difference between on and off. If you have ambient light it would be harder. Might need to shield the light and play with a resistor that sets sensitivity.

Screenshot was when I was testing if Flow would come on if I turned off pump for a min.

Randy
 

Attachments

  • Screenshot_20220725-121349.png
    Screenshot_20220725-121349.png
    109.7 KB · Views: 10
  • 20220724_105013.jpg
    20220724_105013.jpg
    181.4 KB · Views: 11
  • Like
Reactions: cmc0619 and Shirker
Nice (though I understand none of the lingo). I want to do something similar, so my HA can detect when my water softener is regenerating. Unfortunately, there are no LED indicators, only a pretty crummy LCD display (barely any contrast) that displays some text during regeneration. Got any ideas what could read that? All I've come up with so far is to try to figure out a voltage reading on whatever is closing the softener's physical bypass, but I can't even find any sort of actuator that would move the bypass valve. And it's possible there's a manual bypass for the end user, but a separate one that bypasses internally somewhere. I have HA hardware already in place that could interpret any voltage reading to my HA, so that part is ready.

Sorry for the hijack, not really on topic, but you're just the kind'a brainiac that might be able to send me in the right direction.
 
Nice (though I understand none of the lingo). I want to do something similar, so my HA can detect when my water softener is regenerating. Unfortunately, there are no LED indicators, only a pretty crummy LCD display (barely any contrast) that displays some text during regeneration. Got any ideas what could read that? All I've come up with so far is to try to figure out a voltage reading on whatever is closing the softener's physical bypass, but I can't even find any sort of actuator that would move the bypass valve. And it's possible there's a manual bypass for the end user, but a separate one that bypasses internally somewhere. I have HA hardware already in place that could interpret any voltage reading to my HA, so that part is ready.

Sorry for the hijack, not really on topic, but you're just the kind'a brainiac that might be able to send me in the right direction.
Thanks for the compliment, but that's a tough one. Camera with frigate? Frigate is supposed to have good motion detecting, so the display could set it off.
 
I'll look into that. I thought of a cheap cam, to view the display. I have an extensive video system that it could dovetail with, complete with motion detection, but I don't know how sensitive it is. That would be an easy experiment. I could use the cam, at least, to manually view the display. But my house is currently set up to alert me to various events (with lights or texts or reminders, etc), so I get pinged in real time without my intervention. That's the goal. Thanks for the idea.
 
I just looked at Frigate. It looks to be very similar to the motion detection built into my existing video software, which I haven't used so far. I'll check out mine to see if it's sensitive enough, then Frigate if mine doesn't work.

Did you consider video surveillance for your need? I have, but haven't moved on that yet. A good cam over my pool pad to keep an eye on gauges and acid tank level and SWG LEDs and to spot any leaks, etc. My video software license is based on number of cams, so I have several more it could support. I like the ability of being able to keep an eye on my pool and house while I'm traveling... I can ask neighbors to help me out with an emergency, but it's not really fair to ask them to inspect my house everyday on the off chance of one (even though I do that for them!).
 
Last edited:
Did you consider video surveillance for your need? I have, but haven't moved on that yet. A good cam over my pool pad to keep an eye on gauges and acid tank level and SWG LEDs and to spot any leaks, etc. My video software license is based on number of cams, so I have several more it could support. I like the ability of being able to keep an eye on my pool and house while I'm traveling... I can ask neighbors to help me out with an emergency, but it's not really fair to ask them to inspect my house everyday on the off chance of one (even though I do that for them!).
Interesting idea, but I just have cams on entrance points right now. My equipment is behind a wall, would be hard to run wires to a cam over there, and I don't trust wifi cams. Although for occasional use to check the pool, wifi might be ok.

I have one in the back of the house over the backdoor, it can see part of the backyard too. I don't want to put a bunch of cams in my backyard, might look creepy, But the one I have in the back would catch if anybody was back there. Plus my backyard is fenced with a locked gate.

For monitoring, don't need cams now. I'm getting SWG status, and my VSP is controlled by an ESP and relays, so I have its status too. Cams you would need to look at. I want to be notified and will setup my system to tell me if I need to check anything.

Since the SWG includes a flow switch, now I can get notification if there is a flow problem, and shut off my pump until I can go see what's going on.

Randy
 
  • Like
Reactions: Dirk
I don't want to put a bunch of cams in my backyard, might look creepy,
Yah, the kids don't like the cams in the back yard. Though they like to dance in front of the other ones!

My equipment is behind a wall, would be hard to run wires to a cam over there, and I don't trust wifi cams.
Same here. All hardwire, about half POE. I've done some crazy stuff to get a wire where I needed it. Where there's a will there's a way!

Cams you would need to look at. I want to be notified and will setup my system to tell me if I need to check anything.
Yep, I get that. Same for me for the softener. I just want an indicator to light up on my HA interface. I don't want to have to load cam software.
 
Thread Status
Hello , This thread has been inactive for over 60 days. New postings here are unlikely to be seen or responded to by other members. For better visibility, consider Starting A New Thread.