0

Diplay when relay switch is on/off in line chart
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Diplay when relay switch is on/off in line chart

by Mandelstam on Sat Feb 23, 2019 1:21 pm

Hi!

Planning out a dashboard for my vivarium. I'm going to have a line chart displaying temp, humidity and barometric pressure but would also like to be able to visually see when the misting system is active so it's easy to see what changes to the misting timer etc does for temp/humidity. The misting system is controlled via a timer and a 5V relay switch in a Raspberry Pi controller.

The feeds to my dashboard will go through a different R-Pi that will just handle all the monitoring.

What would be the best approach to do something like this? Monitor the 5V signal going to the relay that switches it on/off? Then make a feed in the line chart that goes from 0-5V or something? What I don't want is just a live binary buttom just going red/green, I want to be able to see a history of when the misting was active and to see what that did to humidity levels between mistings.

Kinda new at this haha, so all help appreciated.

Mandelstam
 
Posts: 2
Joined: Sat Feb 23, 2019 1:07 pm

Re: Diplay when relay switch is on/off in line chart

by brubell on Mon Feb 25, 2019 2:35 pm

What I don't want is just a live binary buttom just going red/green,


You'd want to use a line graph to visualize the data over time. The graph on your vivarium's dashboard can display up to 30 days worth of data, and up to five feeds on the same line graph.

Create a feed for the 5v signal for the relay, and add that feed along with the temp/humid sensor to a line graph. When the sensor turns on, you'll be able to see all three values in real-time.

If you're using the Raspberry Pi, check out the Adafruit IO Python library's analog_in.py example for reading an analog value and sending it to Adafruit IO (like the 5V signal you're monitoring): https://github.com/adafruit/Adafruit_IO ... alog_in.py

brubell
 
Posts: 282
Joined: Fri Jul 17, 2015 10:33 pm

Re: Diplay when relay switch is on/off in line chart

by Mandelstam on Wed Feb 27, 2019 9:07 pm

Thank you! :)

Mandelstam
 
Posts: 2
Joined: Sat Feb 23, 2019 1:07 pm

Please be positive and constructive with your questions and comments.