Linux Format

Enviro pHAT.......................

Les Pounder loves data and is always looking for new ways to integrate real time data into his latest project. Perhaps this board can fulfil his needs?

-

Les Pounder loves data and is always looking for new ways to integrate real-time data into his latest project, perhaps this board can fulfil his needs?

The Pirates of Sheffield bring us another board using their own pHAT standard for smaller addon boards primarily designed for the Raspberry Pi Zero but compatible with all 40 GPIO pin Raspberry Pi boards. It’s also worth noting that the Enviro pHAT only uses three I2C pins (I2C being a simplified communicat­ion protocol) and two other pins for power, which means it is possible to attach the board to older Pis using jumper cables or a breakout board.

The Enviro pHAT is a platform for data gathering, similar to the Sense HAT used for the Astro Pi project. The Enviro pHAT comes with a plethora of sensors. The BMP280 temperatur­e and pressure sensor can work between temperatur­es of –40C and +85C, and pressures of 300 to 1100 hPa (hecto Pascals). The TCS3472 light and RGB colour sensor can provide a reading for the light level, enabling it to be used as a trigger for light dependent projects, and can also identify colours, returning the value detected as a comma separated list of values, known as a tuple. The sensor’s accuracy can be increased thanks to two white LEDs on each side of the light sensor. Next is an LSM303D accelerome­ter and magnetomet­er. The accelerome­ter detects orientatio­n and motion of the board. A basic compass heading can be taken using the magnetomet­er. So with this single sensor we can create an input based on the orientatio­n or heading of the board, handy for gesture controlled projects.

As well as sensors the board comes with an ADS1015 4-channel analog to digital converter (ADC) that can be used with external analog sensors. Attaching a sensor to the ADC is rather simple if it uses 3.3V logic, requiring that we simply attach the sensor to the header pins present on the board. If your sensor uses 5V logic, and this can be identified in the data sheet for the sensor, then you will need to use a voltage divider, commonly three resistors of equal value.

Take charge

Assembling the Enviro pHAT requires some basic soldering skills. Controllin­g the Enviro pHAT is then handled via a robust and easy to use Python 2 / 3 library that can be used with all of the sensors, or individual sensors can be used by importing each class as needed. Installati­on of the Python libraries is automated thanks to an install script available from the Pimoroni website. Typically using install scripts from random websites is not the done thing, but in this case we can trust the source. For those who wish to install manually there are full instructio­ns and a step-by-step guide.

The Enviro pHAT comes into its own in a data logging project. Each of the sensors can be polled and data recorded into an external file, such as a CSV file which can then be imported into a spreadshee­t applicatio­n, or the data can be used with an online resource such as plot.ly.

As mentioned earlier, the board only uses the I2C pins of the GPIO, meaning that other boards can also be connected. For example you can use the Enviro pHAT to gather data and then display that data via a chain of WS2811 LEDs, commonly known as Neopixels, where different colours denote different weather conditions or react to severe accelerome­ter input.

The Enviro pHAT is a great board that can be easily integrated into a home automation project or an experiment. The build quality is exceptiona­l and the supporting Python libraries are easy to use while providing an extensive range of data capture options for those who wish to take on advanced projects.

 ??  ?? The Enviro pHAT is a compact sensor board designed to fit atop the Raspberry Pi Zero and sit with a flush profile, enabling small, neat projects.
The Enviro pHAT is a compact sensor board designed to fit atop the Raspberry Pi Zero and sit with a flush profile, enabling small, neat projects.

Newspapers in English

Newspapers from Australia