STM32 and home automation - Page 1
Forum section: electronics / beginners

author: lib7
author_rank: Newbie
timestamp: July 27, 2019, 02:46:26 pm
content: Hi, I have some ideas regarding home automation but my knowledge of electronics is almost none.I'd like to know if it's possible to have a STM32 (I've got a blue pill) to control electrical valves (if this is the correct name) in order to open and close circuits of water based on the temperature in two or three places.Another thing that I'd like to know is about how far can the sensors or the electrical valves be from the STM32 board. What wires can I use? What valves? What sensors for water temperature do you recommend?For later, can several STM32 locally placed (ex. one for the above mentioned project, another for opening blinds, another to check if some door is open) be controlled by a central STM32? How long can the wires be between those boards?Thanks in advance.

author: Kalin
author_rank: Regular Contributor
timestamp: July 27, 2019, 04:09:46 pm
content: Yes there are ways to do this but I wouldn't recommend messing about with mains voltage or heating systems to start with. For example what if you make a mistake and heating is interrupted during winter and your pipes freeze? A good place to start would be with noncritical stuff like blinds. If you are determined to do the heating things I would recommend using a controller board at the valves with relays to control them (unless they have analog inputs in which case you can interface them to the fact in the stm32). I would also either use a sensor board where you want to measure the temperature or using an RTD since they are more forgiving for long leads and fairly easy to interface with. For a user interface/control for whole home I would recommend something like a raspberry Pi talking to the stm32 boards with serial.Sent from my SM-G965W using Tapatalk

author: ledtester
author_rank: Super Contributor
timestamp: July 27, 2019, 05:42:36 pm
content: In general if you want to find components that lots of other people use with microcontrollers, just search for "arduino ___", e.g. "arduino water valve" or "arduino temperature sensor". This should give you links to products, videos, how-tos, code, etc. You can use the Arduino libraries with your STM32 - just search for "arduino blue pill".

author: ledtester
author_rank: Super Contributor
timestamp: July 27, 2019, 06:00:47 pm
content: Quote from: lib7 on July 27, 2019, 02:46:26 pmMost sensors communicate with a microcontroller via I2C which is limited to a couple of meters. Serial communication between microcontrollers over RS232 is limited to about 50 ft. without a repeater. Longer distances may be achieved at lower baud rates. RS485 can achieve 4000 ft. without a repeater. Long serial communications runs should use twisted pair cabling - i.e. like an ethernet cable.However, there are a variety of wireless communication mechanisms available to microcontrollers you may want to consider. Some search terms to google: esp8266, NRF24L01, lora, bluetooth, HC-12

author: JustMeHere
author_rank: Frequent Contributor
timestamp: July 27, 2019, 11:41:24 pm
content: I would look at a ESP8266 or ESP32 for your task. They both have Arduino libs. They both have Wifi. The latter has Bluetooth.