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:    No 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

A proper enclosure for CNC3018 Offline Controller

 Posted by:   Posted on:    No comments

I like to have an offline controller for my CNC3018 machine because I want to keep my computer away from the CNC during usage. There is a lot of dust and cut material scraps which shouldn't get into fans and electronics. Speaking of electronics, the offline controller of CNC3018 is just a bare PCB stacked between two nicely machined acrylic plates. There is absolutely no dust protection. Here is issue #1. The next one is that this controller hangs around the CNC. There is no way to attach it to the frame. And the third issue one will encounter when using the offline controller is the loss of computer communication. That is right. If the offline controller is plugged in, you cannot connect to CNC via USB. Basically, both USB interface and offline controller share the only available serial port of the ATmega328p based mainboard.

I decided to fix all these issues. Following is a 3D printable enclosure which can be attached to the side of the frame on existing screws. And regarding the serial port issue, there is an optional cable connection mod you can do. Below is the result.

CNC3018 Offline controler attached to frame side

FreeCAD tools and settings for CNC 3018 Pro

 Posted by:   Posted on:    No comments

I recently bought and assembled the CNC3018. I have never owned a CNC before and I was unpleasantly surprised by the lack of free and easy to use software to produce CNC jobs. So I had to learn FreeCAD, the only open source software known to me which can be used for this purpose. In this post I added the two types of tool bits supplied with the CNC to FreeCAD's library and I will attempt to produce various jobs in future posts.

CNC machining is a complex process and its workflow depends on a lot of interrelated parameters unknown to beginners. Setting them properly is an absolute requirement to complete a CNC job without breaking valid bits, ruining the work piece or damaging the machine.

FreeCAD tools and settings for CNC 3018 Pro