Lora Sensors – Hardware
What have I been doing during the coronavirus lockdown, well playing with microcontrollers,
This is a continuation of the experiments with Lora devices and have concentrated on developing nodes for measuring basic conditions inside and extended conditions outside. I have ended up with;
- ASR6501 based internal devices X 2
- ESP32 based external Weather station
- ESP32 based Lora gateway
- Raspberry Pi 3 Model B Database server
Started with AVR based devices but moved to the ESP32 due to the extra inputs and integrated LiPo management. Don’t worry, the Adurino board is awaiting an RF Shield from QRPLabs and that will a story for another day.
The internal nodes are HTCC-AB01CubeCell Dev-Boards;
- BME280 Sensor
- LiPo support
- LoRa sx1268
Straight forward operation. Take a BME280 sensor, wrap some sleep code around the reading of the sensor and send on wake. Here is a naked device in the wild;
The weather station is a low end unit. Im happy to report the devices report temps within stated tolerances to this unit. Yes could be both wrong but at least they are consistent. The battery is a 1100mAh single cell lipo recovered from the recycling bin when we use to go to the office to work. Carefully soldered some leads and away it went. Awaiting new ones with protection circuitry. The node charged it up whilst connected to USB and it has been running for over a week on the end of my desk. Need a case, yes. Who has a 3D printer ?
ESP32 based external Weather station
The first picture shows functioning breadboard instance. Below is the schematic;
Currently the design supports;
- BME280 via I2C
- LoRa SX1278 via SPI
- DS-15901 Weather Station,
- wind vane (analogue Input)
- anemometer (Digital Interrupt)
- rain gauge (Digital Interrupt)
- 780X Regulator for external power
- Testing supported a SSD1306 OLED via I2C
Update 072020: Board took 6 weeks. Not to bad given the current delays. Assembled. I got the pads for the voltage regulator wrong. It was a late addition to the design and obviously not verified. Checked before adding any chips so apart from a heap of smoke from a regulator, no real damage.This PCB uses GPIO pins that are not supported by the ESP sleep functions for the rain count and wind speed. The pins support raising interrupts OK and are solid with the pull up resistors and caps to ground. They also supporting waking from sleep but you cant determine which pin above 15 triggered the wake from sleep int.The external weather station still requires charging. Using two 18650 2600mAh Li-ion batteries.The next PCB will have support for measuring voltage, Dual SPI and 2IC
ESP32 based Lora Gateway
Raspberry Pi 3 Model B Database server
- HTTP verbs GET, POST, PUT
- Escapes all data properly to avoid invalid entries
- Handles null values to again avoid invalid entries
- Supports debug and return error states.
The ESP32 device support deep sleep. This is straight forward in the case of the internal nodes. You setup a wakeup timer then sleep. On wake collect sensor data then send for processing and back to sleep. Bit like work….
- ASR6501 – 90mA awake and 20uA sleep.
- ESP Thing – 110mA awake and 34uA sleep.
However sleep has been providing challenges for the interrupt driven external node. Currently testing new code with the FireBeetle that supports times sleep and wake on interrupt;
- observed 10 to 30μA with meter running deep sleep
- calculated (100K resistor in series) 34μA during sleep.
- observed 120mA whilst running the BLE iBeacon example
- observed 110mA whilst running WIFI scanner example
What have I learnt,
- Don’t use the YURobot power supply. If you do check the 5v line as the 5V regulator failed and presented the input voltage (9v in this case) unfiltered. Dare say 5V would have killed the device but 9v did a corker of a job, all the smoke escaped. This accounted for one TTG. This was not a pointless venture as brought joy to my son who was present.
- Don’t buy the cheap BME280 clone sensors. The Bosh BME280 sensors are square whilst the clones are rectangles. The clones provided temperature pressure but not humidity. They should be described as ‘BMP280’. I tried varies libraries trying to work out why I could not read humidity. Google revealed they were clones.
- A analogueread() call invalidates digitalread()s unless you reinitialise the GPIO. Minor but kept me busy with the CRO trying to work put why I could not read the input.
- Confused the devices several times with crap code (technical term describing too many serial prints!) requiring manual intervention to re-program.
So the hardware is straight forward. The devices are cheap enough to kill a few whilst playing. Order a couple. Google will help address issues you may see.
This was a great way to spend weekends when you can’t get out to play radio and avoiding the list of things you should be doing. Now the challenge is to process the data.
Next Lora Software …..