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:


Quick Demo of door monitoring

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



Quick Demo of auto-refill function

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



Quick Demo of graphical HMI and Alexa voice control

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


  • 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

  • new IO modules / DO32

    stefan.schnitzer09/17/2023 at 05:06 0 comments

    Finally, I am getting to build and test my new IO modules—all off-the-shelf parts except some small 3D-printed mounts.  

  • connecting Deye SUN800 PV-Inverters

    stefan.schnitzer03/22/2023 at 21:05 1 comment

    I recently installed a 4kWp PV-System ( 10 Panels connected to 5 Microinverters)

    Naturally, I wanted to connect it all to my Smarthome. But the Modbus-TCP Interface of the Inverters (Deye SUN800) is not working for me. After browsing GitHub, I stumbled upon a solution ( to connect the web server of the inverter-data-logger.  The web interface provides all necessary data like current power production, daily production, total production and fault codes. It works by logging into the web page via node-red and parsing the content for the needed data. After some filtering, the data is passed on to influx db (for grafana) and my smart home PLC via MQTT.

    Now my smart home "knows" when "free" electricity is available and can switch on the car charger or the heat pump. 

  • AI-on-the-edge implementation (MQTT)

    stefan.schnitzer09/04/2022 at 15:04 0 comments

    Since I have moved from a rental apartment to a house, it is possible to install some things I have long dreamed about. 

    The first addition to my smart home system should be a real flow meter for the main water supply pipe. But while I was browsing the web for the cheapest flowmeter, I found a better solution. -To use the existing water meter and digitize it. 

    The AI-on-the-edge-device from jomjol on github is easy to implement and works flawlessly. The data is send via MQTT to my Nodered and Soft-plc...

    The Web-UI: 

    My water usage from the last 7 days:

    The 3d-printed enclosure is still missing some parts:

  • Here are some pictures of the progress of the new smart home system.

    stefan.schnitzer05/01/2022 at 13:16 0 comments

  • Season’s Greetings!

    stefan.schnitzer12/21/2021 at 13:36 0 comments

    83 101 97 115 111 110 8217 115 32 71 114 101 101 116 105 110 103 115 33 32 72 111 112 101 32 121 111 117 32 97 108 108 32 101 110 100 32 116 104 101 32 121 101 97 114 32 111 110 32 97 32 98 114 105 103 104 116 32 110 111 116 101 32This is brilliant

  • developing new version (for new house) ?

    stefan.schnitzer12/16/2021 at 17:15 0 comments

    Since there is now a real possibility that I am allowed to start building my own house ( in 2022, it's time to think about a new version of my smart home project.  

    This time I start with the easy part -the GUI. I will keep the monochrome/highlights look.

  • A case for my Nodered

    stefan.schnitzer04/17/2020 at 06:47 0 comments

    Usually, I don't let go of a lot of my time to visual aspects of my projects. But the current situation gives me a bit more time to do some visual upgrades.
    I printed a case for one of my Raspberry Pis, the one which runs Node-red and connects all of the third-party apps to my Software PLC and HMI.

    The case is from Thingiverse:

    To have not only a visual benefit i decided to add two status LEDs which are connected to GPIO Pins and can be controlled direct by Nodered.Currently the blue one gets lit on every status change of devices (light on/off) and the red LED is reserved for network or system errors.

  • Connecting my 3D printer (and testing OPC UA)

    stefan.schnitzer04/14/2020 at 14:18 0 comments

    Since I have connected my octoprint to my Nodered via MQTT a while ago, I wanted to do something with the data.

    Smarthome page for printer controls.: 

    Screenshot of smarthome page.

    But i don't wanted to transmit all the Values via MQTT (the MQTT implementation in the PLC is a bit messy) to my Codesys RasPi PLC. So i decided to try the built-in OPC-UA Server.  

    View of OPC Nodes with the free Unified Automation UaExpert:

    View of OPC Nodes with the free Unified Automation UaExpert.

    Now the Smarthome is able to tell when a print is finished and switch off the mains for the printer after the hotend is cooled down. 

    Part of  SFC for the printer controls.:

    Part of  SFC for the printer controls.

  • Update on motion to light functions

    stefan.schnitzer03/31/2020 at 05:35 0 comments

    Some Grafana recordings of the in and output signals from my kitchen lighting.:

  • Adding a motion sensor and the need for level conversion

    stefan.schnitzer03/27/2020 at 06:42 0 comments

    It starts with a model I found on Thingiverse. A cool case for an HC-SR501 motion sensor. (

    Since I had one of these lying around I wanted to add it to my smart home System. The nearest I/Os to the preferred location are the digital inputs on the Pixtend Extension Board. The only problem is that the HC-SR501 sensor outputs a 3.3V Signal and the DIs need at least 3.3V to flip high.


    My solution should only involve components I had already in stock. So I decided to use a BC547 NPN transistor.

    The signal gets inverted but that's no problem since I can negate the input in the PLC. I also mounted a lux meter (a photoresistor board with 0...2.5V output) in the motion sensor case. The boolean signal of the motion sensor and the analog value of the lux meter are processed from the PLC and the light gets switched on when needed. 

View all 15 project logs

Enjoy this project?



Daniel Dunn wrote 07/31/2020 at 08:03 point

SCADA is such an interesting branch of computing because they have techniques nobody else pays any attention to.

I've had a lot of success using my interpretation of tag point objects in Python,  and I'm sure if I studied SCADA more I'd discover all kinds of stuff.

  Are you sure? yes | no

stefan.schnitzer wrote 12/07/2019 at 20:46 point

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

@Ken Yap 
I used this principle (well known technique for analog instruments): 

  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:

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.

  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