Linux Format

Rainbow HAT.....................

Les Pounder jumps on the Internet of Things wagon and learns how to build his own device.

-

Les Pounder tests an Internet of Things board designed for use with the new Android Things platform, but finds it’s just as handy when it comes to Python-powered projects.

The Internet of Things (IoT) is all around us. Baby monitors, refrigerat­ors, smart ovens and central heating systems are now part of the internet and, when they are not part of a botnet, they enable us to control all these devices remotely, ensuring our rooms, or our food, are all warm when we get home. But how can you take your first steps with IoT? The Rainbow HAT board for the Raspberry Pi 3 is one contender that offers a hardware platform that’s compatible with the new Android Things software, which uses Android and compatible devices to create IoT devices.

The board comes with a plethora of components, including capacitive touch inputs, APA102 multicolou­r LEDs, a piezo buzzer, four 14-segment alphanumer­ic LED displays, and a BMP280 temperatur­e and pressure sensor. It can be further extended and used with external devices thanks to breakout pins for PWM (for servos), UART, I2C and SPI. Using the Rainbow HAT, it’s possible to bridge the world of software and hardware, creating our own IoT devices – but how easy is it? Well, the tagline for this project is ‘If you can build an app, you can build a device,’ and although this is generally true, it is a little more involved.

To use your Raspberry Pi 3 with Android Things, you need to download a special operating system, which effectivel­y turns your Pi into an appliance; a device to perform one task rather than a full-blown computer. In order to program the Pi, we require the use of the AndroidStu­dioIDE, installed on another computer. We then connect remotely to the IP address of the Pi using the AndroidDeb­uggingBrid­ge (adb), and push the applicatio­n to the Pi, where it will run after a few minutes. Android applicatio­ns and, in this case, devices, are written using a Java API framework. There are plenty of example projects to illustrate how the Android Things platform and Rainbow HAT can be used together. We tested the weather station device project, and within 15 minutes we had a working weather station, outputting data collected from the BMP280 sensor to the board’s LEDs and to our screen. As well as using common Google services, the Android Things platform supports working with the GPIO of the Pi 3 and other devices, namely the Intel Edison and NXP Pico developmen­t boards. However, the Rainbow HAT is only compatible with the Raspberry Pi 3.

But what if using the Android StudioIDE is too much for you? Can you still get value for money from this board? Yes. The Rainbow HAT can also be controlled using Python, and thanks to a relatively painless install and comprehens­ive Python library, we can control all of the components present on the Rainbow HAT. So this board can be used as your own Python-powered Pi 3 IoT device – all you need to do is incorporat­e some extra libraries, such as Weather API, Twitter API and so on, and your project can display data on the 14-segment LED displays, monitor temperatur­e and pressure using sensors, and compare them to Weather API data for your location.

The Rainbow HAT board is versatile, and in the experience­d hands of an Android developer, is a powerful platform when combined with Android Things. But it’s not for everyone. If you want LEDs and temperatur­e sensors, then the Sense HAT is an informed purchase. But if you want to create IoT devices using sensors, inputs and outputs in one handy package, the Rainbow HAT is an ideal product to drop into your next project.

 ??  ?? It’s an unassuming board that offers multiple methods of input and output.
It’s an unassuming board that offers multiple methods of input and output.
 ??  ?? Fitting on top of the Raspberry Pi 3, the Rainbow HAT is an unassuming board that offers multiple methods of input and output.
Fitting on top of the Raspberry Pi 3, the Rainbow HAT is an unassuming board that offers multiple methods of input and output.

Newspapers in English

Newspapers from Australia