Author Topic: STM32 and home automation  (Read 1812 times)

0 Members and 1 Guest are viewing this topic.

Offline lib7Topic starter

  • Newbie
  • Posts: 1
  • Country: pt
STM32 and home automation
« on: July 27, 2019, 02:46:26 pm »
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.
 

Offline Kalin

  • Regular Contributor
  • *
  • Posts: 101
  • Country: ca
Re: STM32 and home automation
« Reply #1 on: July 27, 2019, 04:09:46 pm »
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

 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3249
  • Country: us
Re: STM32 and home automation
« Reply #2 on: July 27, 2019, 05:42:36 pm »
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".
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3249
  • Country: us
Re: STM32 and home automation
« Reply #3 on: July 27, 2019, 06:00:47 pm »
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?

Most 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
 
 

Online JustMeHere

  • Frequent Contributor
  • **
  • Posts: 813
  • Country: us
Re: STM32 and home automation
« Reply #4 on: July 27, 2019, 11:41:24 pm »
I would look at a ESP8266 or ESP32 for your task.  They both have Arduino libs.  They both have Wifi.  The latter has Bluetooth.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf