Frost Warning Thermostat with Temperature Indication

waterproof thermostat frost warning devicePictured above is a project we have recently completed for a special thermometer thermostat for an automotive application. The requirement was for a device which would show the temperature using LEDs, and would sound a warning buzzer for a couple of seconds when the measured temperature falls to or below a user set temperature threshold (in this case chosen from within the range 3- 5 degrees Celcius).

ds18b20 stainless steel temperature probe - waterproof

A waterproof temperature sensor was required for this project, and good accuracy and reliability was also essential. Therefore we chose to use a stainless steel encased DS18B20 digital temperature probe – the same sensors we use in our swimming pool solar water heating pump controllers amongst other things.

The button on the circuit board can be pressed by the user to change the temperature at or below which the attached buzzer will sound. When the temperature is above 5 degrees, both red LEDs are on. When the temperature is below 3 degrees, both green LEDs are on. When the temperature is in the range 2.76 to 5.24 degrees the LED which corresponds to the nearest temperature to that measured it on.

If you need a thermometer or thermostat along similar lines to this unit, email neil@reuk.co.uk with details of your exact requirements. We can also add 16×2 LCDs (displays) upon request.

 

Solar Water Heating Swimming Pool Controller with Display

Pictured below is another of our solar water heating pump controllers – this time with digital waterproof temperature sensors (DS18B20), and an LCD to show the measured temperatures of the solar heating panel and swimming pool as well as system status and for the user to programme in the settings.

Solar water heating pump controller with LCD and maximum temperature overrideAs this controller is to be used in sunny Australia it includes a pre-programmed maximum temperature override to prevent the swimming pool from getting too hot. When the pool is measured to 31 degrees Celcius or hotter, the pump will not to be turned on again until the pool temperature has fallen to 28 degrees.

LCD display for solar water heating pump controller

Pictured above is the LCD showing the solar panel temperature of 26 degrees C, and the pool at 32 degrees C. Therefore the pool is too hot and even when the solar panel temperature increases, the pump will not turn on.

At the bottom of the circuit board is a pair of screw in terminals which will be connected to the output from a 12V programmable digital timer. In the winter, the customer for this controller wants to be able to automatically run the pump at the same time each day for a certain time just to circulate water around the system.

If you need a solar water heating controller for any application, with or without a display, email neil@reuk.co.uk with details of your exact requirements.

 

Raspberry Pi GPIO Sensor Readings to Twitter

We have just published a new article Publish Temperature Sensor Readings to Twitter with Raspberry Pi to the REUK.co.uk website which includes full details on how to get sensor measurements from a Raspberry Pi up to the internet for remote viewing.

Raspberry Pi and TwitterWe will soon be returning to this to look at how batteries can be monitored, solar generation can be monitored, and many other similar projects.

We will then be showing how devices can be controlled from Twitter – for example, you could turn on your immersion heater element with a Twitter message if your Twitter feed tells you that your water tank is cold and you are on the way home and would like a hot bath.

Arduino Datalogger Testing

We recently built and tested a very simple SD card datalogger based around an Arduino Pro Mini – the smallest and cheapest Arduino board commonly commercially available. We have previously described datalogging to an SD card with an Arduino in our blog post Arduino SD Card Datalogging (to log temperatures). In this example we are instead logging the voltage of a solar charged battery used to power the lights in a shed.

REUK Arduino Battery Voltage Datalogger

The Arduino Pro Mini (£3) was programmed from a PC via an FTDI breakout board (£5), and connected to an Arduino micro SD module (£1) fitted with a 1GB micro SD card (£3).  Note that the unlabelled components in the image above are not required for this datalogger – we just built the controller so that it can later also be used as a low voltage disconnect.

We programmed the Arduino to read in the voltage of a 5Ah 12V SLA (via a 47K-10K voltage divider) and write it to a log file on the SD card once every second. The battery is connected to an 80 Watt PV solar panel via a solar charge controller. The battery is also connected to  three 1W LED spotlight bulbs which were left permanently on so that the battery would drain over night and be recharged during the day.

The datalogger was left connected to the battery from around 10:30am one day to around noon the following day in mid-April with blue skies both days.

USB memory card reader

In order to view the data collected on the micro SD card we just needed a USB all-in-one memory card reader (£1). Plug the micro SD card into the reader, plug the reader into a PC via USB, and download the collected data.

The collected data file (which was simply a list of voltages measured to 2 decimal places) was 97070 lines long with a file size of 680 kB. Therefore our 1GB card could have logged the battery voltage once a second for 3-4 years.

Looking through the datalog in a text editor it was obvious that the battery voltage did not change very fast at all. Therefore logging the voltage every second was unnecessary for this application – every 30 seconds or every 60 seconds would have been adequate.

Knowing from experience that plotting 100,000+ data points with Excel is usually an unhappy experience, I first copied the log file over to my Raspberry Pi, and ran the following sed script to create a new smaller file containing just every 60th record from the log file. (This is equivalent to having set up the datalogger to log the voltage once per minute in the first place.)

sed -n '0~60p' logfile.txt > 60slogfile.txt

This command took just 0.24 seconds on the Raspberry Pi (thanks to the raw speed of sed) and I then dropped the new smaller (1617 records) log file into Excel and made the following plot of the results.

Datalogger data collected from solar powered shed lighting

The vertical axis shows the measured voltage, and the horizontal axis shows time with the far left being 10:30am on day1 and the far right being noon on day2.

The plot shows how the solar charge controller carries out a bulk charge phase to rapidly charge the battery (peaking at 14.6V) and then maintains a float charge (around 13.6V) during the day while the solar generation far exceeded the charge used by the spotlights. At night the voltage of the battery drops rapidly down hitting a low of 11.95V before the sun rose high enough to start to charge the battery again.

If you need a voltage datalogger like this, a voltage datalogger with a built in low voltage disconnect to protect the battery from being too deeply discharged, or any other kind of single or multi-channel datalogger, please email neil@reuk.co.uk with details of your exact requirements.

Automatic Irrigation System with Moisture Probes

Pictured below is a controller we recently made to automate watering of plants depending on the moisture level of the soil in which they are growing.

Automatic irrigation controller with moisture sensing probes

This device measures the resistance between two stainless steel probes made from 1.6mm arc welding rods (pictured below) to which leads have been soldered, and inserted into the soil a few centimetres apart. When the soil is measured to be ‘dry’, a pump is turned on which waters the soil. When the soil is subsequently measured to be ‘wet’, the pump is turned off, but only if it has already run for a user programmable number of minutes first.

Stainless steel welding rods used as moisture sensors

To provide default wet and dry thresholds, the resistance between the probes was measured at what the user considered to be the dry and the wet threshold. These values were 36.5 kOhms or lower for wet, and 229 kOhms or higher for dry (with the probes inserted 7cm into the soil, 6cm apart). Therefore we programmed the controller to turn on the pump after 5 continuous seconds of resistance measured to be below 36.5 kOhms, and turn off after 5 continuous second of resistance measured to be above 229 kOhms.

Since different growing mediums may be used in the future, we also made this controller so that the user can calibrate the wet and dry thresholds themselves or revert to the default values.  Calibration is achieved simply by putting the probes into soil which the user considers to be at the wet or dry threshold, and pressing a button to save the measured resistance value in memory as the new threshold.

If you need an irrigation controller similar to this, please email neil@reuk.co.uk with details of your exact requirements.

Low Voltage Disconnect with Early Warning Alarm

Pictured below is another of our low voltage disconnect (LVD) circuits designed to protect batteries from being overly discharged.

12v low voltage disconnect for latching relays with early warning buzzer and LEDThis particular LVD has a few added features. First of all, to reduce power consumption by the LVD itself, it has been designed to work with a latching relay. The chosen relay (click here to download the latching relay datasheet) has two coils – one coil to latch the relay closed (set coil), and the other to release the relay (reset coil).

latching relay connections for low voltage disconnectThis controller can be programmed as per our standard REUK Programmble Low Voltage Disconnect with the disconnect voltage and cancellation voltage. While the voltage is good, the relay will be left latched closed, and then when the voltage falls below the disconnect voltage, it will be latched open.

As an added feature, when the measured battery voltage is 0.2V or less more than the disconnect voltage, the external LED (which can be panel mounted somewhere easily visible) turns on, and an on board piezo buzzer sounds briefly every half a minute until either the user starts to charge the battery, or the disconnect engages due to even lower measured voltage.

If you need any kind of low voltage disconnect circuit, email neil@reuk.co.uk with details of your exact requirements.

Dawn Dusk Automatic Hen House Door Controller

Pictured below is a hen house door controller which will automatically open the hen house door in the morning and close it again at night to protect the birds from foxes and other predators.

Automatic hen house door controller with dawn dusk light detector and limit switchesThis controller is somewhat based around our Simple Hen House Door Controller which uses a low voltage programmable digital timer to set when the door should open and close.

This version instead takes an input from a light detector (click here for our article introducing Light Dependent Resistors), and uses this to detect dawn and dusk.

When dusk begins, the motor turns one way to lower the door until it presses against and closes the lower roller switch which acts as a limit switch. Similarly, when dawn begins the following morning, the motor turns the other way to raise the door until it closes the upper roller switch.

(For the explanation of how the polarity of the voltage sent to the motor is reversed see our introductory article: Automatic Hen House Door Controller).

In order for the user to set the light level threshold at which day becomes night and night becomes day, a programming button is provided on the circuit board. When the ambient light level is at the level considered by the user to be the threshold, they press this button while powering on the controller to save that measured light level as the new threshold. The threshold is stored in permanent memory and is therefore not lost even when the controller is subsequently disconnected from the power.

connection diagram for Arduino based dawn dusk hen house door openerPictured above is a functionally identical controller, but which is built around an Arduino Pro Mini instead of the PICAXE-18M2 used in the original. The instructions for this controller are available here: Dawn Dusk Henhouse Door Controller Instructions.

If you need any type of door controller contact neil@reuk.co.uk with details of your exact requirements.

Raspberry Pi GPIO with BerryIO

Today we have been trying out BerryIO – a control system for Raspberry Pi which is web browser based for ease of use and set up.

Although BerryIO can be used to monitor the system status of a Raspberry Pi; of most interest to use was the ability to easily control GPIO without any need for programming experience. This makes home automation via mobile phone, tablet, or desktop PC a realistic option even for relatively basic users.

Installation is achieved by entering the following commands at the prompt:

wget -N https://raw.github.com/NeonHorizon/berryio/master/scripts/berryio_install.sh
chmod +x berryio_install.sh
sudo ./berryio_install.sh

followed by:

berryio help

just to make sure it is working.

With BerryIO installed on your Raspberry Pi, you simply enter the IP address of the Raspberry Pi in the web browser on your phone, tablet, or PC, and after entering your Pi username and password when prompted you get a menu of options of which we found GPIO, camera (if you have one), and system status to be the most useful.

Raspberry Pi BerryIO - GPIO ControlSelecting GPIO from the menu, all of the GPIO pins are shown and you can set them individually to be either NOT IN USE, IN (for inputs), or OUT (for outputs).

BerryIO GPIO inputs Raspberry PiIf you select IN for a pin (for example GPIO-7) as shown above, when a high signal arrives on GPIO-7 the green light turns on, and when the signal arriving is low, the green light is turned off. The web browser updates the status of the GPIO pins in real time – therefore no need to refresh the browser for updates.

Raspberry Pi GPIO outputs controlled from web browser BerryIOIf you instead select OUT for a pin, a toggle switch appears below the selector. Click on ON to turn on the output (green light illuminates for that GPIO pin in the browser), or click OFF to turn off the output (green light turned off).

The system status shows a few bits and pieces of information about memory, storage, loads etc, but this does not currently update in realtime so you have to refresh the browser for the latest data.

raspberry pi system status - BerryIO

We will be looking into some useful real world useful applications for BerryIO, but it is certainly well worth installing it and having a play around with it just for fun.

BerryIO is still under development and new features and functionality are still being added to it. The release of an API for mobile app development should hopefully result in some interesting and useful tools being developed to control the Raspberry Pi remotely via a simple user interface.

Full details of BerryIO and the installation instructions are available here: install BerryIO.

Arduino SD Card Datalogging

We recently published our Arduino Solar Water Heating Pump Controller Design and Code which shows the basics of putting together a very simple solar water heating pump controller which you can then extend to add the other features you require. (Click here also for our Introduction to Arduino.)

The feature about which we have received the most questions is datalogging functionality to generate a log file of the temperatures recorded and the status of the pump (on or off).

Arduino SD card temperature datalogger

Pictured above is a demonstration on prototyping breadboard of how datalogging can be achieved using an Arduino SD Card Module (click link to buy). These are available from just £0.99 including delivery for standard SD cards (and from around £1.60 including delivery for modules for micro SD cards).

Arduino SD card reader moduleSD card modules for Arduino are very simple to use. SD cards operate on 3.3V, but the Arduino on 5V; however, these modules have all the necessary components fitted to bring down the voltages and enable safe reliable operation without the need for you to add any external components.

In the breadboard demonstration above, we have a single LM335 temperature sensor connected to the A0 pin of an Arduino Nano as per the solar water heating pump controller design (linked to at the start of this post).

We then have the following connections between the Arduino and the SD Card module:
Arduino D10 to SS (slave select)
Arduino D11 to MOSI (master out slave in)
Arduino D12 to MISO (master in slave out)
Arduino D13 to SCK (serial clock)
We also connected the 5V and GND pins of the Arduino to the corresponding SD Card module connections to power it.

Note that some SD Card modules have their connections labelled differently.
CS=SS, DI=MOSI, DO=MISO, and CLK=SCK.

For this demonstration we just want to create a text file (called templog.txt), measure the temperature once per second, and add each temperature reading to the end of the file to form a very basic datalog.

Arduino temperature datalogger sd cardThe stored data on the SD card can then be viewed, manipulated, and graphed on a PC. Multiple temperature sensors (or other sensor inputs) can be added and logged by extending the bare bones Arduino code above.

arduino rtc real time clock module

For a more advanced datalogger, the next key element to add is an RTC (real time clock). Using an RTC each data point can be logged alongside the exact time that it was recorded. Arduino RTC modules including a backup rechargeable button cell are available very cheaply. We will show you how add an RTC to an Arduino datalogger in a future post.

Automatic Horse Feeder Controller

Pictured below is a controller for an automatic horse feeder. This device is made up of a 12V digital programmable timer, a microcontroller board, and an eight relay board.

automatic horse feeder

The horse feeder hardware comprises four shelves onto which the owner can put feed. Four car door locks are used to release the shelves one at a time to release the feed and drop it down to where the horses can access it.

When 12V at one polarity is supplied to a lock, it will perform a pull action; when the polarity is reversed it will perform a push action (which resets the lock ready for the next time it is to be used).

automatic horse feeder control board

The programmable digital timer is set by the end user to turn ON for one minute at the times of day that the horses need to be fed. Our controller (pictured above) receives power when the timer is ON, decides which feeder should be released next, pulls the corresponding lock to release the feed shelf, waits a couple of seconds, and then pushes the lock to reset the feeder.

To enable the polarity supplied to the locks to be reversed, eight SPDT relays are used for which we used a commercial relay board (click here to buy relay boards of this type). We connect 0V to all the relay NC’s, and +12V to all the relay NO’s, then for each pair of relays, we connect the COM’s to the lock power inputs.

automatic horse feeder relay board connectionsIf we close one relay in a pair we get one polarity supplied to the lock (since it sees +12V and 0V), and we we close the other relay, we get the other polarity (since it now sees 0V and +12V).

underside of automatic horse feeder relay boardIf you have a process to automate in a way similar to this example, email neil@reuk.co.uk with details of your exact requirements.