Close
0%
0%

DIY SCADA / smart home

A DIY smart home system the SCADA way...

Similar projects worth following
It controls lights, heating, ventilation, a robot vacuum cleaner, and even an automated cat feeder. Its Levels referring to the diagram Functional levels of a manufacturing control operation (see 2. in details) are:

Level 0: field devices
Sensors: DHT11, DHT22, BH1750, HC-SR501, DS18B20
Actors: stepper and DC motors, solenoid valves, radio-controlled plugs and relays (433Mhz), IR-remote controlled devices

Level 1: I/O modules
Remote input/output (RIO) modules made from Arduino's which sends the sensor data to the CodeSys software PLC and directly controls critical functions (as feeding the cats, positioning roller blinds).
Additionally a Pixtend I/O Board is connected to a Raspberry PI.

Level 2: supervisory
A Raspberry PI with CodeSys software PLC and graphical HMI which controls

Level 3/4: coordinating
A Raspberry PI With Node-RED and Grafana to collect and store all my data. And Alexa voice control.

1.  Demo of graphical HMI and Alexa voice control.

2. Functional levels of a manufacturing control operation (source:https://en.wikipedia.org/wiki/SCADA

20191004_135146.gif

Quick Demo of door monitoring

Graphics Interchange Format - 6.53 MB - 10/12/2019 at 05:32

Preview
Download

20190930_174021.gif

Quick Demo of auto-refill function

Graphics Interchange Format - 12.91 MB - 10/05/2019 at 05:55

Preview
Download

20190929_121927.gif

Quick Demo of graphical HMI and Alexa voice control

Graphics Interchange Format - 10.46 MB - 09/29/2019 at 10:22

Preview
Download

  • 2 × Raspberry Pi 3 Software PLC and Grafana+NodRED
  • 5 × Arduino Uno / Mega 2650 Remote I/Os (cat feeder, door alarm, ...)
  • 1 × 1kg Load Cell and HX711 A/D converter Measures how much cat food is left in the bowl
  • 22 × RCS 1000 N (Brennenstuhl) 433,92 MHz wireless control socket Cheap but reliable Actor for mains powered devices
  • 2 × Generic 433MHz sender To transmitt to the wireless controled socket

View all 15 components

  • monitor the balcony doors with an 4...20mA loop

    stefan.schnitzer12/06/2019 at 10:40 0 comments

    I added the capability to monitor the state of my two balcony doors (open/closed). 

    The door state is monitored with a magnet and reed switch combination. The reed switch is in parallel with a resistor and changes the current through the loop.

    So the different current states are corresponding with different door states.  It is also possible to detect a short circuit (>10.65mA) or an open loop (wire failure <5.5mA) and all this with just two wires.

    Current states with 24VDC supply voltage:

    I only had 0.25W resistors, so i had to use some in parallel to distribute the load:

    The current input gets analyzed (0...20mA current loop interface) and visualized by the RasPi PLC:

  • > monitoring the front door <

    stefan.schnitzer10/12/2019 at 06:09 0 comments

    I never wanted to control the door lock via my smart-home system. 
    It always seemed too risky. 

    So I added the capability to only monitor the state of the front door (open/closed) and the lock of the door (locked/unlocked). 

    The door state is monitored with a magnet and reed switch combination, the lock via an inductive proximity switch on the frame.

    The states are captured with my Arduino remote I/O 

    (https://hackaday.io/project/167904-diy-scada-wireless-remote-io)
    and sent to the software PLC. 

    Read more »

  • implementation of functional levels in my smart-home

    stefan.schnitzer10/08/2019 at 12:58 0 comments

    A diagram that shows the implementation of functional levels in my smart-home:
    Functional levels of DYI SCADA Smarthome

    Level 0: field devices
    Sensors: DHT11, DHT22, BH1750, HC-SR501, DS18B20
    Actors: stepper and DC motors, solenoid valves, radio controlled plugs and relays (433Mhz), IR-remote controlled devices

    Level 1: I/O modules
    Remote input/output (RIO) modules made from Arduino's which sends the sensor data to the CodeSys software PLC and directly controls critical functions (as feeding the cats, positioning roller blinds).
    Additionally a Pixtend I/O Board is connected to a Raspberry PI.

    Level 2: supervisory 
    A Raspberry PI with CodeSys software PLC and graphical HMI which controls 

    Level 3/4: coordinating
    A Raspberry PI With Node-RED and Grafana to collect and store all my data. And Alexa voice control.


    (What I mean with Remote I/Os: https://en.wikipedia.org/wiki/Remote_terminal_unit)

    (Remote I/Os in my Projekt: hackaday.io/.../167904-diy-scada-wireless-remote-io)

  • water auto-refill for endless coffee supply

    stefan.schnitzer10/05/2019 at 06:19 0 comments

    The simplest function of the system is also one of my favorites. It automatically refills the water tank of my coffee maker. All it needs is a float switch and a solenoid valve that lets fresh tap water flow in the tank.

    Thanks to the SCADA like the design of my smart home system it is easy to derive the water usage from the time the valve was open (@ Level 3/4: A Raspberry PI With Node-RED and Grafana). 

    Every step up on the following graph represents a refill of the tank.

    Don't worry there are some safety functions implemented in Level 2: (A Raspberry PI with CodeSys software PLC ) of the system. Such as maximum filling time or only refill when someone is at home.

    And it is possible to trace all actions within Grafana:

  • Finally, after 3 years I installed the last 433MHz receiver / ​remote switch.

    stefan.schnitzer09/30/2019 at 18:55 0 comments

    Finally, after 3 years I installed the last 433MHz receiver / remote switch.

    Since I recently got a 3D-printer I made a simple case for it.

View all 5 project logs

Enjoy this project?

Share

Discussions

stefan.schnitzer wrote 6 days ago point

I love the fact that my simple door switches started a discussion about retrocomputing. That's why i like the hackaday.io community so much. 

@Ken Yap 
I used this principle (well known technique for analog instruments): http://www.excelautomationsolutions.com/post/how-a-4-20ma-transmitter-works.html 

  Are you sure? yes | no

Ken Yap wrote 12/06/2019 at 13:56 point

Hi, your link to the Wikipedia SCADA page is broken, the text is correct, but the link is not. Also without knowing anything I suspected the 4..20 mA loop is an industry standard with such specific numbers, and it is, so maybe link to the Wikipedia page for that too? Thanks!

  Are you sure? yes | no

Starhawk wrote 12/06/2019 at 14:31 point

@Ken Yap -- the 4-20mA current loop scheme is very well known in the retrocomputing community... specifically the part that messes around with the, er, bigger machines. Minicomputers and such. See, before RS-232 (and, in some cases, even afterward) it was the best way to send a lot of serial data over a distance. Teletypewriters used this basically until the video terminal killed 'em all off.

You need four wires, two for TX, two for RX. Power and ground... and, no, you absolutely *cannot* combine grounds here. You're basically driving an optocoupler (or an open-collector junction, in the much older days) from a rather significant distance, for each side of the link... hence the values for the current there, and the fact that the voltage can vary so widely. IIRC it's active low, so a 'mark' ("1") is when the thing dips to 4mA and shuts off the little light in the opto, and a 'space' ("0") is when it levels back up to 20mA and the light comes back on ;)

The niftiest side of this, is that because it's /current/-dependent and basically screw the voltage as long as it can light a friggin LED or whatever, you can run these things quite nicely over insanely long distances (multiple /kilometers/, seriously... I want to say I heard that the signal really only peters out irretrievably at something like the 2km mark, but I could be off there... I could easily see it being longer, especially with repeaters) if you don't mind the transmission rate being kind of low... like 9600 baud maximum, and closer to 300 baud or so for the longer trips. (Baud?! Of course, dude, back then *everything* was baud. Screw BPS, we want to send things with character(s), not one friggin bit at a time :P )

...oh, and MIDI is basically exactly this, but with tighter voltage specs and a really freakin' weird baud rate.

  Are you sure? yes | no

Ken Yap wrote 12/06/2019 at 14:44 point

Yeah it reminded me of the current loop teletypes we used to run that's why I looked it up.

I used to have a Decwriter LA30 which I converted from current loop to RS232, see here: https://hackaday.io/project/161656-flashing-leds-from-old-printer-electronics

Trivia Q: What was the name of the console teletype in the original PDP-11 Unix?

A: /dev/tty8

True story: When I was a neophyte in Unix, I asked the local sysadmin/guru how to detect machine shutdown, save state and exit my program gracefully. He told me to catch SIGTERM. After I mastered that I ran a small program in the background that just blocked waiting for SIGTERM. The next time the sysadmin shut down the machine, he saw the console print out Arrgh, you dirty rat... which was the code executed on receiving SIGTERM. In those days permissions were a bit lax and the console (by this time not a teletype) was world writable. I think they fixed the permissions after that.

Here's a bit more of Unix history I set down for posterity in my professional blog, which is mostly about things to do with my day job or my home Linux setup.

https://green-possum-today.blogspot.com/2018/09/the-true-origin-of-nuxi-problem.html

  Are you sure? yes | no

Starhawk wrote 12/06/2019 at 14:51 point

@Ken Yap LOL, I should've known you tinkered with that stuff /personally/ back in the day... you lucky bastard :P I've been fascinated with retrocomputing since probably when Mom got me a now-ancient copy of "The Soul of a New Machine" by Tracy Kidder. Still have it somewhere... awesome book.

Dangit, I need to read that thing again.

...also, why #8...? I'd expect 0 or 1 but not 8... actually, also, what were the other 7+ TTYs doing, if not running the console...? Logging stuff?

  Are you sure? yes | no

Ken Yap wrote 12/06/2019 at 15:12 point

I don't remember, you could check the V6 history or Unix sources online but I think the first bank of minor devices, either didn't exist, or were allocated to other devices. I think more likely the former and the Unibus (DEC aficionados will remember this) slot for current loop serial devices was at 1.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates