#106 AJ-SR04M ultrasonic distance sensor for water

looks like a STM8S003F3 MCU, unmarked crystal and unmarked TTL IC
Underside has a 2 pin socket and is quite dirty…

Recently I have had an old mildly annoying problem snowball into a new serious problem…

Every few months the clean water supply from uThukela Water (Pty) Ltd has been switched off for multiple reasons… striking, damaged electric motors due to Eskom, sabotage and other issues to name a few very serious reasons.

So two large 2500L water tanks were installed in series as a backup which worked well for small water issues that would last maybe a week or two.

However recently There has been no water from uThukela for over a month, and this is very serious.

This event triggered me to investigate water related problems and solutions specifically for my use case.

Order of importance:

  1. I need readily available clean drinking water
  2. Store this water for longer (get extra tanks)
  3. Keep water safely in the tank (no contaminates)
  4. Add sensors to monitor (water level sensor in this case)

For this article will be focusing on the 4th order of importance since this is a tutorial website mainly about electronics.

Therefore I will start by saying I searched for a suitable water level sensor and came across the JSN-SR04T and clones.

This sensor looks very promising and easy to use with 6 available sensor modes (adding increased diversity).

N.B the copy does not have 6 extra modes which was disappointing considering their price point…

2.2m wire with the sensor at the end.

The copy has 3 modes and is similar to the JSN-SR04T-2.0

Now my goal is to use the JSN-SR04T with an ESP8266 connected via WiFi to send readings to my server every 30s, this unit will be completely powered by solar.

The ESP8266 will also have a LAN dashboard to view the readings in real time connected to WiFi but with a connection to the internet not needed, just in case the internet goes down I can still read the water level values.

unfortunately finding a commonly available original JSN-SR04T Ultrasonic Distance Sensor has been quite difficult in South Africa.

I have only been able to find the AJ-SR04M (functions like the JSN-SR04T-2.0) which is a clone but works just like the original, however I see the price is equivalent and sometimes even more than the original which is quite strange. An of course the extra modes are missing…

The waterproof sensor
The sensor is epoxied and completely sealed looks easy enough to install

Mode 1: R27 = is open.

The sensor returns an analogue signal. The formula to calculate the distance from the data is:

Test distance = (high time * speed of sound (340M / s)) / 2;

Mode 2: R27 = A 47K resistor is soldered.

Every 100ms serial data will be sent in mm.

Serial baud rate: 9600, n, 8,1.

The frame format is: 0XFF + H_DATA + L_DATA + SUM
1.0XFF: for a frame to start the data, used to judge;
2.H_DATA: the upper 8 bits of the distance data;
3.L_DATA: the lower 8 bits of the distance data;
4.SUM: data and, for the effect of its 0XFF + H_DATA + L_DATA = SUM (only low 8)

Mode 3: R27 = A 120K resistor is soldered.

Good for low power applications.

After the module is powered on, the module enters standby mode.

If the module receives 0X55 it will send data over serial.

Serial baud rate: 9600, n, 8,1.

Datasheet for the stm8s003f3


#75 JDY-30 Bluetooth relay board

JDY-30 Bluetooth

This is a 12V relay that you can switch using the built-in JDY-30 Bluetooth slave module. By using the iq-blue terminal app on your phone, you can wireless open or close the relay by sending simple hexadecimal code to the board.

  1. Provide 12V DC input power to the board
  2. Search for bluetooth device and pair to “JDY-30” (password is “1234”)
  3. Download the IQ-BLue Bluetooth Terminal App
  4. Using hexadecimal, send “A00101A2” (open the relay), “A00100A1” (close the relay)
Back of the board



ESP01 + v4 relay module.

While looking for a cheap wireles relay solution I found the ESP01 + relay module package.

This ESP-01 Relay Module based on AI-Thinker ESP-01/01S WIFI module. It is designed for smart home, internet of thing and others DIY project. With this smart relay, you will easy to DIY your smart switch to control any device by your phone anywhere using the popular ESP01.

The board is surprisingly small and has a thin PCB.

Relay module bottom.
Relay module top.
Close up.
Pin out
ESP01 pin out
ESP board types


#47 150M Wireless Lite-N USB Module (2015)

The 150M Wireless Lite-N USB Module PW-MN427 is designed to provide a high-speed and unrivaled wireless performance for your devices, with a faster wireless connection, you can get a better WLAN/Internet experience. The PW-MN427 150M Wireless Lite-N USB Module complies with IEEE 802.11b, 802.11g and 802.11n standards. It can perfectly interoperate with all of the 802.11b/g/n devices.

The PW-MN427´s auto-sensing capability allows high packet transfer rate of up to 150Mbps for maximum throughput. Additionally, it supports WPS (Wi-Fi Protected Setup) function, which can help you create a wireless connection with effortless security setup, to prevent outside intrusion and protect your personal information from being exposed.


  • 150Mbps wireless transmission rate
  • Specific PIN for Radio On/Off, LED, and WPS (Wi-Fi Protected Setup)
  • Supports 64/128-bit WEP, complies with 128 bit WPA standard(TKIP/AES), supports MIC, IV Expansion, Shared Key Authentication, IEEE 802.1X
  • Compatible with 11b/g/n equipments
  • Onboard LED is optional
  • Supports 3.3V or 5V power supply
  • Supports Windows 2000/XP/Vista/7, Linux OS