TUTORIALS IoT devices
How to build Internet of Thing devices
NODE-RED
The Raspberry Pi can be used with other programming languages, including one designed for the Internet of Things, reveals Les Pounder.
OUR EXPERT
Les Pounder is an associate editor at Tom’s Hardware and a freelance creative technologist. He blogs at bigl.es.
The Explorer HAT has been the star of a few tutorials in your favourite Linux magazine, but we’ve always used it with Python. Yet did you know that we can also use it with Node-RED? This is an event-driven programming language used for Internet of Things and embedded projects. In this month’s tutorial we shall control an Explorer HAT and use it to trigger actions.
With the Raspberry Pi turned off, connect the Explorer HAT Pro to all of the GPIO pins so that it fits neatly on top of the Pi. In the breadboard place the potentiometer so that it points away from the board. Looking from the rear, connect the left pin of the potentiometer to the 5V connection on Explorer HAT. The centre pin goes to Analog 1, and the right pin to GND. Between the GND and centre pin place the 10K resistor so that the centre pin and GND are connected. This will pull the centre pin and the output pin down to GND, ensuring that we obtain the cleanest signal possible.
Connect your accessories to the Pi and power on the Raspberry Pi to the desktop.
YOU NEED
Any 40 pin GPIO Pi model
An Explorer HAT Pro from Pimoroni
3 x Male to male jumper wires
10K Ohm Resistor (Brown-Black-Orange-Gold)
10K Potentiometer Small DC motor An internet connection
Get the code: https://github. com/lesp/ LXF271-Node-RED-Explorer HAT/archive/ main.zip