18 December 2022

Meshtastic network using LoRa wireless modules

LoRa WAN ( see 16 March 2022 ) and a point to point LoRa wireless data link have been used previously. This post describes setting up a "Meshtastic" based secure private network comprising 2  nodes again using cheap, low power, LoRa wireless modules, operating on a frequency 868MHz.
Meshtastic allows encrypted text message type communication between nodes ( upto 80 ) in an "off-grid" mesh type network which requires no gateways, infrastructure or internet servers; the underlying technology used is LoRa.
A user-group called SpacerLabs, and 2 nodes named Webmaster ( Wbms ) and Laboratory ( Lbrt ) were created. Node 'Webmaster' uses a TTGO T-Beam board. Node 'Laboratory' uses the same TTGO LoRa32v2 board as on 16 March. Both boards support BlueTooth Low Energy ( BLE ) and have LoRa transceivers; the T-Beam has additionally a Ublox Neo-6M GPS receiver allowing tracking its position.
(L) Node Webmaster [T-Beam], (R) Node Laboratory [LoRa32v2]
The appropriate 'Meshtastic' firmware version was uploaded to each board. Both boards have to be paired with a BlueTooth enabled device, e.g. smartphone or tablet. The 'Meshtastic' app was downloaded and installed on a smartphone.
Although LoRa allows communication between nodes dispersed over a wide area and upto several kilometres apart depending on intervening terrain and antenna type and position, for demonstration purposes the two nodes were positioned just a few centimetres apart. Short text messages were sent from each node using the smartphone. In the above image note the message which was sent to the Laboratory from the Webmaster.
Viewing messages on the Meshtastic app
Currently there is no actual requirement for a Meshtastic based network for a SpacerLabs user-group. It was, however, an interesting exercise finding out about Meshtastic and getting a simple network up and running. Two spare LoRa modules are available and could easily be used to add more nodes to the group, perhaps on different floors or buildings e.g., 'Office' and 'Warehouse'. ( visit https://meshtastic.org for more information ).
 
      

21 August 2022

Oven Temperature Controller

This usb dongle style temperature controller has been successfully used to control the temperature of an oven during reflow-soldering electronic circuit boards. It incorporates the MAX31855 14bit 0.25C resolution thermocouple to digital converter chip, and connects to a Type-K thermocouple and solid state relay (SSR), which together with a mini-oven form a self-assembled reflow soldering setup.
The SSR (not shown) connects to the screw-terms
It can also be used simply to measure the internal temperature upto 255C of any domestic oven (not microwave), by omitting the SSR.
Custom pc software for either purpose has been written using Visual Basic language.
Clear style dongle enclosure - cover removed
The temperature controller has also been designed to fit a typical dongle enclosure.
 

 

28 July 2022

Greenhouse Gas Monitoring System

Methane, CH4, and Carbon Dioxide, CO2, are two prominent "greenhouse" gases which have an impact on global warming.
A Methane sensor, type MQ-4, and a Carbon Dioxide sensor, type MQ-135, together with an ESP32 microcontroller are being used to measure the concentration ( in parts per million/billion ppm/ppb ) of these gases in the atmosphere. Measurements are sent every 15 minutes to cloud hosted repositories, ( "thingspeak.com" and "ubidots.com" ), for display and analysis.
Prototype system during development, left MQ-4, right MQ-135
Only the sensors are deployed outdoors, in a protective enclosure. The microcontroller is situated indoors for reliable WiFi connectivity and convenience when uploading the software.
Sensors deployed outdoors
A channel having public access is available for viewing the data on ThingSpeak. Search for channels belonging to user ID "spacerlabs". Select "Greenhouse Gas Monitor".

07 June 2022

Capacitance Meter

A capacitance meter has been constructed, based on a PIC microcontroller development board and OLED display.  A Capacitive Voltage Divider, CVD, comprising the capacitor under test, Cut, and sample/hold capacitor, Chold, of the integrated PIC ADC was used to derive the capacitance of Cut,  by the 'double sample', differential CVD measurement method.
VCHOLD1 = sample 1 voltage across the internal ADC hold capacitor.
VCHOLD2 = sample 2 voltage across the internal ADC hold capacitor.
CUT = capacitance in picoFarads of the capacitor under test.
After designing a suitable jig, the meter will be useful in determining the value of unmarked smd capacitors.
Cut is two 22pF capacitors in parallel
ADC = Analogue to Digital Converter.

16 March 2022

LoRa WAN

A "LoRa" ( Long Range )  wireless data link had already been used in a previous project to collect soil moisture data; but was not joined to a LoRa WAN network, in which nodes ( end-devices e.g. sensors ) are connected to gateways which then connect to the network server where the data from the end-device can be displayed and accessed by other applications for long-term storage and visualisation.
The public "TheThingsNetwork (TTN)" global IoT LoRaWAN network with the "Things Stack Community edition" server were used to test the possibility of connecting a node comprising a TTGO LoRa32v2 development board, before designing future projects with sensors. Only a short text message was to be sent; "TTGOLoRa32v2 node test".
The message was successfully received by a gateway 6kms away and forwarded to the server.
The upper image shows the experimental node in a temporary location by a window. The lower image is a partial screen capture of the live data on the server console.
 
TTGO LoRa32v2 node successfully joined TTN

Live data from the TTGO LoRa32 node on the Things Stack server
 
For more information on TheThingsNetwork visit https://thethingsnetwork.org
IoT = Internet of Things
 

27 February 2022

Digital Inclinometer

The MPU-6050 is an Inertial Measurement Unit comprising a MEMS 3-axis gyroscope and 3-axis accelerometer. The gyros provide angular velocity data; the accelerometers give relative 'g' (  acceleration due to earth's gravity ). Several were obtained, already mounted on evaluation boards. The project was to use it in a digital inclinometer. For this application, however, only the accelerometers were needed. The image below shows the setup used for developing software for the prototype. A digital angle meter was used for comparison. For the y-axis orientation in use, the inclination is displayed as negative degrees; a downwards slope.
(L) MPU-6050 evaluation board, (R) micro-controller/display board
Two versions were completed, with or without a display and having different enclosure styles, suitable for whether the inclinometer would be visible or located remotely when in use. The display version is shown in the image below. It is indicating 0 degree inclination and 1 degree roll to the right when placed on a "flat horizontal" surface.
Display version of the Inclinometer in attractive enclosure with lid
Both versions have Bluetooth functionality, enabling the inclination and roll meaurements to be displayed on a paired mobile device.

MEMS = Micro Electro Mechanical System.

09 January 2022

USB to UART Converter

Some devices, e.g., ESP8266-01 wifi modules, GNSS receiver modules, Particulate Matter sensors and others have a 'start-stop signalling' RS232 type of serial interface for exchanging data. A USB to UART ( Universal Asynchronous Receiver Transmitter ) converter is required in order to display the data using a serial terminal program on a pc for example. Other uses include: alternative if no legacy COM port, provides a virtual COM port, provides usb connectivity, for retreiving raw data for display and parsing, connect with devices having a uart interface, connect with usb to a micro-controller uart peripheral. It's an extremely useful item.
USB-UART converter connected to ESP8266-01 wifi module
TX and RX data shown in a serial terminal application


 
 

07 January 2022

RS485 Interface for MCUs

Micro-Controller Units ( MCUs ) typically have one or more integrated USART peripherals but lack an RS485 interface for serial communication using a twisted pair over distances of tens of metres. When required, an external interface is necessary.  Two are needed for inter-MCU communication, or a USB-RS485 protocol converter dongle to transfer data to an application on a pc for example. In the image below the breadboard used at SpacerLabs for PIC MCU project development is shown. The MCU PIC16F18875 is being used.
RS485 interfaces at either end of 4.5m twisted pair