Front panel for 8-channel relay controller (1)

 Posted by:   Posted on:    No comments

This project started from a common issue I faced while trying to interface a relay board with a microcontroller: not enough I/O pins. My purpose is to control 8 outdoor lights; therefore, I got an 8-channel relay board, powered from 5 V. But I want to add some extra functionality: this controller should have a front panel with 8 push buttons and 8 LEDs. It should also take input from sensors with digital output. So, I got 16 inputs and 16 outputs to control.

The most available solution was to use shift registers, 74HC595 for outputs and 74HC165 for inputs. Initially I thought I could use an ESP8266 microcontroller, since it would allow me to add MQTT functionality. But I had no success with this: ESP8266 is a 3.3 V microcontroller, relay board needs 5 V levels, and although shift registers can operate properly with voltages as low as 2 V, they will not recognize as high (“1”) a voltage of 3.3 V (from ESP8266) when powered with 5 V. The reason I powered them with 5 V is because relays will not be activated by 3.3 V.

Front panel fitted on the plastic cover of a wiring box
Front panel fitted on the plastic cover of a wiring box

Turnkey PCB Assembly by PCBGOGO - 2022 Q3

 Posted by:   Posted on:    No comments

Modern electronic devices can only work properly if the printed circuit boards (PCBs) they are built on are reliably manufactured with high precision. PCBGOGO manufactures the best PCBs and they can meet specific client needs. It is one of the world's leading PCB manufacturers, with a production line that can provide both precision and reliability. PCBGOGO provides turnkey assembly for their customers so you can use the PCB as soon as it is delivered to you. They provide quick, professional, and reliable turnkey PCB assembly.

Turnkey PCB Assembly by PCBGOGO - 2022 Q3

30A MQTT relay with timer: software

 Posted by:   Posted on:    No comments

In the previous post I built an ESP8266 controlled 30A relay to automate an irrigation pump. I added a time display to this device because I want to have timer function, to set the pump on for a specified amount of time. I will not be using a web server to control the relay because I want to be able to switch it on from outside of the local network and it is difficult to obtain a properly secured HTTP server on ESP8266. I already did it, but this MCU has limited resources for such purpose.

Since I run a self-hosted MQTT broker on an Orange Pi Zero SBC I will make use of the MQTT capabilities. Orange Pi has a capable CPU for proper SSL encryption and I already made the server secure with self signed SSL certificate. ESP8266 can connect to the server in the local network on the unsecured listener port and that is not an issue since I have control over the devices my local network. Even so, WiFi is password protected. And ESP8266 uses credentials to connect to MQTT broker.

MQTT relay controls in MQTT Dash app
MQTT relay controls in MQTT Dash app

30A MQTT relay with timer: hardware

 Posted by:   Posted on:    No comments

I wanted to automate an irrigation pump, to be able to turn it on and off remotely and set a power-on time limit. I looked for a ready-made solution and I found some products. But none fit my needs. There are mains powered ESP8266 boards with one or more relays, but those relays are common 10A type. After some searching on AliExpress, I found an ESP8266 module with 30A relay, but this one was missing a mains adapter and required DC low voltage supply. This one could have been my choice. After all I only had to get a power supply.

Later, I decided to add a small display to my device so, I ended up making my own PCB. A NodeMcu board is the controller of this device. I added a 30A relay module and used a Hi-Link PCB power supply module to deliver required 5 V. The display is a 4-digit 7-segment TM1637 module which came with another challenge. It is a 5 V device that needs to be controlled by a 3.3 V MCU. I added a level shifter module and designed a PCB to fit all of them (except relay module which has its own PCB).

Electronics for the MQTT switch mounted in a plastic box
Electronics for the MQTT switch mounted in a plastic box

Send data to weather station over 433.92 MHz (2)

 Posted by:   Posted on:    2 comments

In a previous post I used a software defined radio (SDR) to analyze and decode data transmission over 433.92 MHz of a simple weather station. As I mentioned then, the indoor unit can receive data from up to three outdoor units. I found that outdoor units use basic OOK modulation to send data to indoor unit. Knowing this I can make my own outdoor unit using a 433 MHz transmitter module controlled by an Arduino.

Obviously, I had to use a temperature and humidity sensor such as DHT11, DHT22, AM2302 to get environment parameters. I emulated full original outdoor unit functionality by adding a display and a push button to trigger immediate transmission of data to indoor unit.

Send data to weather station over 433.92 MHz
Arduino based data transmission device

Decode 433.92 MHz weather station data (1)

 Posted by:   Posted on:    No comments

I bought a simple weather station, with temperature and humidity display for indoor and up to 3 wireless outdoor sensors (sold with only one though). Unfortunately, the one I got, had a non-functional outdoor sensor. I took it back to the store and got a replacement for the entire product. The outdoor sensor can be hanged on a wall with a small screw, but it can easily fall down.

Given the facts I initially got a broken sensor, the weather station can receive data from up to 3 sensors and because sensors are exposed to outdoor conditions, I decided to analyze the wireless protocol and maybe build my own device which will be able to emulate this kind of sensor. There is no information about wireless protocol of this weather station (sold by Lidl in Europe under the Auriol brand), except the frequency: 433.92 MHz. That was all I needed. And a software defined radio (I used RTL2832U dongle).

Decode 433.92 MHz weather station data