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
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 …..
or dumpster diving for computers.
I’ve noticed a trend. At the end of university terms the skip bins around student accommodation fill up with fridges, lounges and computers.
I’m putting this down to the the high cost for freight and low cost of technology.
Its not like I don’t have enough computers. In the shed there is an Apple IIe Clone, varies 8080 -> Pentium based devices (IBM XT & AT339) and collection of RISC (ultra 2, SS2,10 & 20, HP and a dual CPU DEC Alpha) devices.
They all worked before being put away. Doubt they would boot up without addressing NVRAM issues and the odd wasp nest but they are going nowhere. Well that’s debatable as whilst the cases and boards may stay in my shed their souls will be reward in Silicon Heaven.
I use a Apple Mac for my desktop (the 27’ 5K iMac screen soothes old eyes) and for my personal notebook. There is a Dell notebook with Windows XP and a serial port for programming radios and everything else runs Linux.
I rarely purchase new. The Macs come from Apple refurbished site and if I need components, eBay is the first port of call. Anyway I have recently acquired two computers by not being too ashamed to jump into a skip bin.
MSI 7688v1.0(G52-76881X1)(P55A Fuzion). i5 CPU 760 @ 2.80GHz with 8GB memory.
Walking home down Collins St noticed a skip bin with the results of an office refurb. Hidden between the discarded partitions and lighting there were several computers cases, LCD screens and a printer. Seriously ? computers are considered office waste now ? Ok going in….
I was not alone and had to act fast. These computers had attracted the attention of another ‘recycler’ and we worked together. He took two boxes and a screen whilst I only grabbed a single box, did retrieved memory from one of the other boxes and just made it to the train heading home.
Knew it was a intel based device due to the sticker on the fan and assuming later then a Pentium based device as no ‘Intel inside stickers’. It was a long ride home wondering if I was bringing someone else’s rubbish home or had hit silicon jackpot. Michele is very tolerant but we don’t need another ancient device in the shed. Got home and ran it up to setup as no HDD. The case was low end and missing feet but did have a power supply. Also has a NVIDIA GT216 PCI-E video. The mother board supports Multi-GPU Computing. Ok that sounds cool so lets get another card tomorrow. Went back to the skip bin on the way to work on the next day armed with screwdrivers and pliers to retrieve more memory and a second video card but there was only had plaster and cables left. Too late.
Sourced a tower case and HDD. Installed Linux Fedora 29 and configured as a LAMP box so now it is hosting test instance of the ParksnPeaks website. This use to be hosted on the HP8100 but ran out of space and unable to add another drive.
The HP 8100 was sourced second hand from eBay. It has a 2TB drive and runs Ubuntu 16.04.5 LTS hosting AppleTalk as it is the backup target for our Macs. The idea here is to pick it up one computer when leaving for fires so whilst you may loose hardware, will have data.
Dual Xeon Server
Intel® S5500BC Server. Dual Xeon(R) CPU E5506 @ 2.13GHz with 16GB memory.
Walking back from lunch recently I noticed a tower sitting next to a skip bin. It had empty slots where HDD carriers had been removed. You could see two heatsinks. This device caught my interest but I had to leave it as the case was too big to take back to work. I was receiving enough ribbing from by lunch buddies all-ready so stashed the case behind the bin to and took the ribbing whilst walking back to office.
So once back at the office and out of sight of my ‘friends’ I grabbed a Phillips head and went back to see what was under the heat sinks. Took off the heatsink and rubbed back the compound to find an Intel Xeon processor. Half the memory banks were filled. There where no hard disks nor a power supply so decided to take the board leaving the case in the bin.
Got a case out of the shed and ran her up. She booted to setup no issues. I took a photo and sent to those who doubted it just to prove I’m not just a nutter, but a nutter with a dual Xeon server. Added a HDD and installed CentOS Linux. Setup up a search for ECC memory and picked up additional 16G from the US for $77 delivered. Now all the memory slots are filled, just need a decent case. The device is a SSI CEB form factor – 305 X 276mm slightly larger than a ATX 305 X 244 mm so a slight challenge as don’t want to buy (or pay for) a server case. Here she is running. Notice doing nothing.
So what am I going to do with them ?
None of the devices are doing any real work. Need a box for testing and backup.
The inner accountant says should do nothing and keep using the HP8100 as backup and dev box. It requires no new hardware and uses the least energy.
The inner geek says not to listen to that idiot. If he had his way you would have been eating lunch at your desk not enjoying luksa and there would be a dual xeon server in land fill now.
So have got my eye on a case for the Xeon. Will add a couple of drives for backup target and use it as the dev / test box going forward.
Want to add some devices outside for sensors and to automate garden activities. Glenn VK3YY raised the opportunities LoRaWAN present so intend to work out how to build a mesh of small devices reporting to the server using 70cm band. Will need a device to host a database and process all the data that will be generated and this would be a honourable task for such a device.
Intend to build a home sensor network based on Arduino and Raspberry devices hosting environmental sensors and home voice activated automation system. Guess this is the Intranet of Things – IoT
Late to the story but can see where this is going. Can remember early days where we were being trained in digital electronics and the wait to access microcontrollers. You can now purchase for next to nothing multi core devices and the tools to develop and interface are amazing.
Picked up a couple of Arduino’s and a Raspberry PI to play with. A kit of sensors off eBay was sourced so as to get a spread of what we can monitor. Its just a case of integrating the pieces.
Current overview as at 102017.
Like all IT deployment security and scaleability have to be the predominate design factors;
“if one thing can prevent the Internet of things from transforming the way we live and work, it will be a breakdown in security”
Current design is simple and will not be connected to the Internet. Voice control will be will Jasper on Raspberry Pi. Pocketsphinx as the STT (Speech To Text) engine so recognition will be performed offline. Not just to keep my data off the Internet but to conserve the rural connection.
- Multiple Andriod based sensors
- RF based sensor network
- Raspberry Pi hosting Jasper automation
- Linux based presentation layer
- Remote control of external (chicken door) instances