Building IoT Devices The Easy Way

Do you have a Raspberry Pi? What is it being used for right now? If you’re like the majority of people who replied to [Michael Hall’s] poll on Twitter, it’s likely yours is sitting on a shelf doing nothing too. So why not just turn it into an IoT device for your home?

[Michael] wrote an easy-to-follow guide focusing on getting the EdgeX Foundry IoT platform running on the Raspberry Pi. It is designed to be a unified multi-platform base for IoT devices hosted by the Linux Foundation, making it easy to control and integrate them into other systems. The framework for this consists of two parts, a Device Service running on your Pi, and the rest of the services running on a desktop or laptop where you’ll be monitoring it.

His guide goes into detail on how to get both parts working on your computer and your Pi using Docker for ease of installation. As for the IoT device, he uses the built-in PIR sensor example to show how to configure it without having to write any programming. You can then monitor the device’s sensors, which you can just connect straight to the Pi’s GPIO pins, from your desktop. Since the EdgeX software is designed to run on any flavor of Linux, this should make it easy to repurpose any forgotten single-board computer into the beginnings of a home automation system.

However, if you are confident in your programming skills, you’re probably looking for something slimmer such as the ESP8266 family of microcontrollers to do your bidding. Why not try an energy monitor or a smoke detector project with them?

Fighting Household Air Pollution

When Kenyan engineer [Aloise] found out about the health risks of household air pollution, they knew there had to be a smart solution to combatting the problem while still providing a reasonable source of energy for families cooking without the luxury of cleaner fuels. Enter OpenHAP, a DIY household air pollution monitor that provides citizen scientists and researches the means to measure air particulates in developing countries.

The device is based on an ESP32 communicating with a ZH03B Particulate matter sensor over UART; a DS3231SN real-time clock (RTC), temperature and humidity sensor, and MLX90640 2D thermal sensor array over I2C; and wirelessly sending the data received to a Bluetooth low energy wrist-strap beacon and an Internet enabled phone. The device also uses a TCA9534 GPIO expander to control the visual and auditory notifiers (buzzers and LEDs) and to interface to a SD card.

The project uses the libesphttpd project modified for the ESP32 for the webserver, which is used to stream data to a mobile handset or computer using the WiFi capabilities of the ESP32. The data includes real-time sensor information, system status, storage media status, visualizations of the thermal array sensor data (to ensure the camera is facing the source of heat), and tag information to test the limits of the Bluetooth tag with regards to distance.

Power input is provided through a Micro-USB connector, protected with a TVS diode and a Schottky diode in series to prevent reverse power flow.

The project was tested in two real-life scenarios: one with a household in rural Kenya and another with an urban low-income family of four. In the first test, the family used a three stone open fire stove. A FLiR thermal camera captured the stove temperatures, while a standard camera was enough to capture the high levels of smoke inside the kitchen. The readings from OpenHAP were high enough to exceed the upper detection threshold for the particulate sensor, showing that the woman cooking in the house was receiving the equivalent of 8 cigarettes a day, about 8 x the WHO’s recommended particulate levels.

Within the second household, a typical energy mix of charcoal briquettes and kerosene was typically used for cooking, with kerosene used during the day and briquettes used at night. The results from measuring pollution levels using OpenHAP showed that the mother and child in the household regularly received around 1.5 x the recommended limit of pollutants, enough to lead to slow suffocation.

There’s already immense potential for this project to help researchers test out different energy sources for rural households, not to mention the advantage of having a portable low-energy pollution monitor for citizen scientists.

Continue reading “Fighting Household Air Pollution”

LoRa-Based Plant Monitoring

Croatian engineers [Slaven Damjanovic] and [Marko Čalić] have developed a wireless system for farmers to monitor plant conditions and weather along their agricultural fields. The system uses an RFM95W module for LoRa communication, and devices are designed to be plug-and-play, battery-powered, and have long-range communication (up to 10km from the gateway).

It uses an ATMega328 microprocessor, and includes sensors for measuring soil moisture (FC28 sensor), leaf moisture (FC37 sensor), pressure (BME280 sensor), and air temperature and humidity (DHT22 or SHT71 sensor). The data is sent to a multichannel The Things Network  gateway that forwards the information to an external database, which then displays the data through a series of graphs and tables.

The software for sending messages to the gateway is based on the LoRa MAC in C (LMIC) and LowPower libraries and was developed by [ph2lb].

Continue reading “LoRa-Based Plant Monitoring”

Following Pigs: Building An Injectable Livestock Tracking System

I’m often asked to design customer and employee tracking systems. There are quite a few ways to do it, and it’s an interesting intersection of engineering and ethics – what information is reasonable to collect in different contexts, anonymizing and securely storing it, and at a fundamental level whether the entire system should exist at all.

On one end of the spectrum, a system that simply counts the number of people that are in your restaurant at different times of day is pretty innocuous and allows you to offer better service. On the other end, when you don’t pay for a mobile app, generally that means your private data is the product being bought and sold. Personally, I find that the whole ‘move fast and break things’ attitude, along with a general disregard for the privacy of user data, has created a pretty toxic tech scene. So until a short while ago, I refused to build invasive tracking systems – then I got a request that I simply couldn’t put aside…

Continue reading “Following Pigs: Building An Injectable Livestock Tracking System”

The Trials And Tribulations Of Building An IOT Garage Door Opener

Garage doors can be frustrating things, being a chore to open manually and all. Many people opt to install a motorized opener, but for some, even this isn’t enough. Hooking up a garage door to the Internet of Things has long been a popular project, and [Simon Ludborzs] decided to give it a shot. Naturally, there were some obstacles to be overcome along the way.

[Simon]’s build is relatively straight down the lines, using an ESP-12 as the brains of the operation, which connects to the internet over WiFi. However, robustness was a major goal of the project, and being reliant on shaky cloud-based services wouldn’t do. This opener is set up to work independently of an internet connection, too. There’s a nifty control panel with glowing buttons to operate the opener, in addition to the webpage served up on the network.

During the development, [Simon] ran into several roadblocks. A set of roller door motors were inadvertently killed, and there were issues in getting the web interface working as expected. None of these were showstoppers, though, and with a little work and some new parts, everything came together in the end. The project was then given a proper commercial-grade case, sourced from AliBaba. This is a great step to take for a project expected to hold up to daily use for years on end. He also took the time to document his tips for easier ESP8266 development, which may prove useful to those just getting started with the platform.

Garage door openers remain a common theme around here, but every project has its own story to tell. If you’ve developed a particularly unique solution to your garage access problems, you know who to call.

Raspberry Pi Catches The Early Bird

If you live in an area with high bird activity, setting up a bird feeder and watching some hungry little fellows visit you can be a nice and relaxing pastime. Throw in a Raspberry Pi with some sensors and it can also be the beginning of your next IoT project, as it was the case for [sbkirby] with his Bird Feeder Monitor project.

To track the arrival and departure times of his avian visitors, [sbkirby] attached a set of capacitive touch sensors to each side of his bird feeder, and hooked them up to a Raspberry Pi Zero W via a CAP1188 breakout board. The data is published via MQTT to another Raspberry Pi that serves as backend and stores the data, as well as to an optional additional camera-equipped Pi that will take a picture of each guest along the way. Taking into account that precipitation might affect the sensor readings, he also checks the current weather situation to re-calibrate the sensors if necessary, and also to observe a change in the birds’ presence and eating behavior based on weather conditions.

It seems that sensor-based animal feeding will always serve as inspiration for some new projects, whether feeding the animal itself is the goal, like most recently this fish feeder has shown, or whether the eating behavior is monitored and used for further research such as this squirrel-based weather forecast system.

Understanding Elliptic Curve Cryptography And Embedded Security

We all know the usual jokes about the ‘S’ in ‘IoT’ standing for ‘Security’. It’s hardly a secret that security in embedded, networked devices (‘IoT devices’) is all too often a last-minute task that gets left to whichever intern was unfortunate enough to walk first into the office that day. Inspired by this situation, All About Circuits is publishing a series of articles on embedded security, with a strong focus on network security.

In addition to the primer article, so far they have covered the Diffie-Hellman exchange (using prime numbers, exponentiation and modular arithmetic) and the evolution of this exchange using elliptic curve cryptography (ECC) which prevents anyone from brute-forcing the key. Barring any quantum computers, naturally. All three articles should be understandable by anyone, with a simple, step-by-step format.

The upcoming articles will cover implementing security on microcontrollers specifically.  For those who cannot wait to learn more, Wikipedia has a number of articles on the topic of Elliptic Curve Cryptography (comparing it to the more older and still very common RSA encryption) specifically, as well as the Elliptic-Curve Diffie-Hellman key agreement protocol as discussed in the All About Circuits article.

A detail of note here is that the hardest problem in secure communications isn’t to keep the communications going, but to securely exchange the keys in the first place. That’s why a much much computationally expensive key exchange scheme using an asymmetric (or public-key) cryptography scheme  is generally used to set up the second part of the communications, which would use a much faster symmetric-key cryptography scheme, where both parties have the means to decode and encode messages using the same private key.

All the math aside, one does have to wonder about how one might denote ‘secure’ IoT. Somehow ‘SIoT’ doesn’t feel very catchy.