enviro:bit sensor for micro:bit

enviro:bit from pimoroni for micro:bitPictured above is the new enviro:bit for micro:bit from Pimoroni – available for £20. This device has a collection of sensors which can add be read easily from  Microsoft MakeCode Editor or directly via MicroPython for more advanced projects and programmers.

There are three sensors in total. A BME280 atmospheric sensor which provides temperature, humidity, and air pressure measurements, a TCS3472 colour and light sensor, and a MEMS microphone for sound.

micro:bit plugged into enviro:bit to use sensors

The micro:bit simply plugs into the enviro:bit, and once you have added the required code library or libraries (for MakeCode Editor and/or Mu Code Editor) the sensors can be read, data collected, and displayed on the LED matrix etc.

Click here for more information: buy enviro:bit from Pimoroni.

Mini Temperature Data Logger Design Plans

mini temperature data logger

Pictured above is a high accuracy (within 0.1°C) low power temperature data logger designed originally for scientific research in sea turtle egg incubation, but which could be put to use in a great many other applications.

This logger measures and logs the temperature once every 10 minutes exactly with sufficient memory space to hold 180 days of data (26,000 records). The logger is powered by a CR2032 coin cell battery which can keep it running unattended for the full 180 days.

When the measurement period is over, the logger can be extracted from its waterproof case and the logged data transmitted over a UART connection via a cable to a PC for subsequent analysis.

The goal of this project was to achieve all of the above at a cost per unit (of a batch of 50 units) of under €5, including the case.

mini temperature logger pcbThe temperature sensor used is a 16-bit resolution digital MAX30205MTA+. This gives a temperature resolution of 0.00390625°C and 0.1°C accuracy in the range 0-50°C. The microcontroller chosen is the ATMEGA328PB – a slightly more feature rich version of the MCU found on many Arduino boards. The serial flash memory chip used is a 512kbit AT25DN512C from Adesto which has sufficient space to hold the 410-420kbit of data to be logged in six months.

For full details, plans, and discussion of this project, click here: Low Power Cost and Size Temperature Data Logger.

Multi-sensor datalogger and timer relay

Pictured below is a device we were recently commissioned to design and build.

multi-sensor 3 channel datalogger with relay timerThis device, built around an Arduino Pro Mini, is one of the most complex projects we have completed recently. It is primarily a timer (utilising a ds3231 real time clock (RTC)) to energise a relay for a user programmed number of minutes once every day, week, fortnight, or month. However it must also monitor and process data from three sensors and log these readings to a micro SD card for later analysis at intervals which depend on the status of the system at any one time.

display for three channel datalogger

This device has a display to show the user the status of the system with readings from a pressure and a flow rate sensor as well as a valve and a relay which the device controls.

Detailed datalogging is only required when the valve is open (with logs appended at a rate of once per second), but the pressure sensor status must be logged every hour and changes to the status of the valve and other significant system changes must also be logged as and when they occur.

When logging data every second, it does not take long to generate a file which is unwieldy to process in Excel or other programmes. Therefore, our device creates a new file each time the valve opens, and logs to it until the valve closes again. In this way, there is one reasonably sized datalog file for each valve opening event together with one master log file which is appended hourly and also when there is a significant change detected in the system.

setting the time and date for a real time clock datalogger

Having mulitple datalog files not always recording data at regular intervals, it was essential that the timestamp for each line record in the logs showed the actual time and date rather than just an index value.

datalogger file from 3 channel arduino dataloggerThis will make future analysis of the collected data much easier.

The user is able to set the number of minutes that the relay is ‘on’ and also the precise time of day at which they would like the relay to turn ‘on’. The interval between relay ‘on’ events for this particular device was set to daily, weekly (7 days), fortnightly (14 days), or monthly (28 days).

setting up the arduino 3 channel dataloggerAn added feature is that the user can manually change the number of days until the relay will next turn ‘on’ which is particularly useful for testing the system or forcing the relay to turn ‘on’ at a previously unscheduled time and date if required.

The last piece of complexity was the flow rate sensor. This sensor outputs high pulses at a per second rate which when multiplied by 0.2 gives the litres per minute rate of flow through the sensor. The results generated then had to be converted into the desired cubic metres of flow per hour to be displayed and logged. As we did not have access to this flow rate sensor, we had to use a second Arduino to simulate the square wave the sensor generates to fully test the device we built. With a maximum of 1000 pulses per second to detect (for the maximum expected 12m3 per hour flow rate), the 16MHz clock of the Arduino Pro Mini was more than up to the job of simulating the sensor.

If you need any kind of timer or multi-channel datalogger, please email neil@reuk.co.uk with details of your requirements.