DS3231 Real Time Module used as Master Clock

Further to our recent post on using the DS3231 RTC module in situations where extremely accurate long duration timing is required, here is an example of a project we recently completed using this same module.

DS3231 Real Time Clock (RTC) module for Arduino

A Slave Clock is a clock which depends for its accuracy on another clock – the Master Clock. Our client has a Mercer UK slave clock which requires a 12V pulse once every 30 seconds for it to run accurately. He wanted an accuracy better than +/- a few seconds per week. As the DS3231 is accurate to better than 2ppm (parts per million), it will gain or lose no more than one second every six or so days.

DS3231 Real Time Clock (RTC) with Arduino for Mercer Slave Clock time base

Pictured above is the unit we put together coupling a DS3231 module with an Arduino Pro Mini (clone) for the master clock. The Arduino constantly monitors the time from the DS3231, and each time the number of seconds in the time is 00 or 30, a half-second long 12V pulse is output to the slave clock.

Pictured below is one of master clocks fitted into the back of Standard Electric Time Company secondary (or slave) clock.

It is a double faced clock which is destined to hang in a small museum.

If you need any kind of accurate timer, please email neil@reuk.co.uk with details of your requirements.

Accurate DS3231 Real Time Clock as Alternative to DS1307

We have put together a lot of controllers which required a real time clock (RTC) – in particular dataloggers and other timers running over long periods of time which were required to do (or record) operations at specific times through the day consistently over weeks and months.

DS1307 real time clock (RTC) module for Arduino

Pictured above is a DS1307 module. These are available from just £1 including delivery from China/HK via eBay – see here: DS1307 Modules.

With a backup button cell (e.g. CR2032) on the underside of the module, these DS1307 modules will keep time even when disconnected from the main power source for months and even years on end. However, in our experimental projects (using this RTC with an Arduino for dataloggers amongst other things), we have found these DS1307 modules to vary hugely in their time-keeping accuracy – some gaining/losing a few seconds per day, and others gaining/losing as much as 3-5 minutes per day. While they have proved to be very consistent – i.e. a unit which gains 3 minutes per day will gain 3 minutes per day every day – having to test each unit individually over a few days and then modifying the Arduino project code to cancel out errors is not practical.

Some of the error is caused by ambient temperature changes affecting the accuracy of the timing of the crystal resonator. Some more of the error is also caused by the quality of the crystal itself and its attachment to the PCB in these economical modules.

DS3231 Real Time Clock (RTC) module for Arduino

Pictured above is an alternative to the DS1307 which we have found to be far superior in its time keeping accuracy which uses the DS3231. These are now also available on ebay from just £1: see here: DS3231 modules.

In extensive testing we have found the time-keeping of these modules to be excellent. The DS3231 chip on the module is marketed as being accurate to 2ppm (parts per million), which means less than one second lost or gained every 5 to 6 days. The units we have tested thus far have all come in at under 1ppm accuracy, so a couple of seconds at most lost or gained per month.

This accuracy is achieved in part by the incorporation of a temperature sensor in the DS3231 which can compensate for changes in ambient temperature. The measurements from this temperature sensor are also accessible to the user (accurate to +/- 3 Celcius) which makes for a handy extra feature. These DS3231 modules also have 32kb of available EEPROM memory which can be utilised by your projects, and many other useful features.

Click here for a very simple DS3231 introduction  from the Instructables website. If connecting a DS3231 module to an Arduino, you need to install the Arduino DS3231 Library from here which includes quite a detailed manual document to help you get started setting and accessing the stored time and temperature etc from your DS3231 module.

One thing to note is that due to recent changes to air mail postage rules, most of these modules are no longer sent out with a button cell (backup battery) provided (even when the eBay listing has one pictured). You will therefore need to source yourself a CR2025 or CR2032 button cell locally if you have a project necessitating backup for the time keeping.

User Programmable Countdown Timer with Display

Pictured below is a programmable timer we recently made for animal behaviour research. The operator switches on the power to the timer which turns on an LED bulb (to indicate that animal training is in progress). When the timer finishes its count down the bulb is turned off, and an on board buzzer sounds briefly to remind the operator to turn off the power to the timer.

Programmable digital timer for animal behaviour research

This timer is built around an Arduino Pro Mini board with additional components. Using the on board up and down buttons and a 16x LCD digital display, the operator can set the timer in one minute intervals to the desired time.

The most recent setting is stored in long term memory, so the timer only has to be re-programmed if the operator wants it to run for a different time than that most recently used.

LCD display for animal behaviour timer

While the timer is running, the timer setting and the time to go countdown are both displayed as shown above.

As the built in timer in an Arduino is consistent, but not very accurate, this device had to be calibrated to ensure that it was running at the correct rate. Initially it was programmed with 1000 Arduino milliseconds set to correspond to one actual second and run for 20 (Arduino) minutes simultaneously with an accurate stopwatch. When the timer finished, the stopwatch was stopped and compared to what the Arduino considered to be 20 minutes. It turned out that the Arduino clock was slow by 13 seconds over the 20 minutes, so we divided the real 20m13s by 20m and multiplied this error factor (1.0108) by 1000ms to give 1011 as the number of Arduino milliseconds in one actual second. After updating the code on the Arduino to reflect this, the timer ran to accuracy of under 1 second over 20 minutes – fine for a timer to be used typically for 10 minutes or less.

If you need a timer for any application, email neil@reuk.co.uk with details of your exact requirements.

Air Pistol Shooting Target Controller

Pictured below is a controller we recently made for competitive air pistol shooting training.

Shooting Target ControllerOn the shooting range there is a target connected to a motor. If the motor is powered for one second with one polarity, the target will turn to face the shooter. If the motor is powered for one second with reverse polarity, the target will turn edge on to the shooter. (Click here to see how we reverse the polarity of a motor with two relays – alternatively, we could have used an H Bridge motor controller.)

The controller has two buttons, and also screw in terminals so that external buttons can be added in parallel if the controller is to be enclosed. One button is used to toggle the target position – to edge it when it is facing, and to face it when it is edge on. The second button is used to start the training routine.

When the start timer button is pressed, the target will be turned edge on to the shooter. Then after seven seconds, the target will be turned to face the shooter for three seconds. This edge for seven seconds face for three seconds is repeated five times, and then the target is edged to wait for the next shooter.

If you need any kind of automatic timer controller board, email neil@reuk.co.uk with details of your requirements.

Time Lapse Photography Controller

Pictured below is a time lapse photography controller we recently made for a customer who is using it at a remote site.

Automatic programmable time lapse camera controllerRather than leaving the camera and MiFi (mobile Wi-Fi hotspot) constantly powered (necessitating a large battery), this controller turns them on only when they are needed – first MiFi is turned on, then 45 seconds later the camera is turned on, and then a further 15 seconds later a relay tiggers the camera shutter to take the photograph. The camera and MiFi are then left on for a further three minutes (so that the photograph can be processed by the camera and uploaded).

A programming button is provided which enables the photographer to take one shot every 5, 10, 15, 20, or 25 minutes etc, and once set up, this controller will run autonomously indefinitely, taking photographs at the required time interval and uploading them to the cloud server.

If you need a time lapse camera or similar timer controller, please email neil@reuk.co.uk with details of your exact requirements.

Automatic Alarm for Screen Printing Flash Dryer

We were recently commissioned to design and build an automatic warning alarm for use with a screen printing flash dryer by a custom t-shirt print company in USA.

A flash dryer is a special heater which rapidly cures the ink printed onto the t-shirt or sweatshirt. If a shirt is left for too long in the flash dryer it will be scorched and ruined, and with a bit more time even the wooden shirt board around which it is fitted can be ruined. Therefore it is desirable to have a warning alarm sound if a shirt is left in the flash dryer too long by the operator.

alarm timer for screen printing flash dryer

The controller we made is pictured above. There is a microswitch on the flash dryer which closes when the flash dryer is closed over a shirt. The user can programme our controller with the maximum number of seconds they want to leave a shirt in the dryer – e.g. 15 or 20 seconds – and then if that time is exceeded the on board relay closes for 3 seconds to sound a loud alarm connected to it.

When the operator opens the flash dryer, the microswitch opens and the controller automatically resets ready for the next time the flash dryer is used.

If you need any kind of automatic sensor or timer based alarm system, email neil@reuk.co.uk with details of your requirements.

Mains Powered Fan Controller for Art Project

We are often requested to make timers and other electronic controllers for use within art projects and art installations. In general these are sold to people who have no electronics knowledge, and so we have to make them as simple to use as possible with pre-wiring of any mains powered devices etc.

Pictured below is one such timer we recently made designed to control a fan which in turn moves fabric as part of an art installation.

15 seconds on 15 seconds off repeating mains powered fan controllerThis device is designed to run a mains powered fan – 15 seconds ON 15 seconds OFF in a repeating cycle. This fan (a bathroom extractor fan) had already been wired for the artist with a standard plug by an electrician.

So the the electrician was not required further, we pre-wired this controller with a standard plug on the input side and a standard socket on the output side to which the fan could be plugged in. All other wiring is located on the circuit board which is all sealed away in a black box for safety. The whole things is powered by an external 12VDC plug in power supply.

Every 15 seconds the on board relay is opened or closed which in turn either connects or disconnects the power from the socket turning the fan off or on as required.

If you need any type of timer or other controller for an art project, please contact neil@reuk.co.uk with details of your exact requirements.

Real Time Clock Timebase for Lazy Clock

Pictured below is a timer we recently designed and built to act as an accurate timebase for a Lazy Clock (see here for details: Lazy Clock – PDF plans for this wood gear clock driven by a solenoid)

Real Time Clock with relay output for timebase of Lazy ClockThe device we made has a real time clock module based around the Dallas DS1307 Real Time Clock (RTC) – top left of the board pictured above. This can be set up (via the Arduino Pro Mini at the bottom left of the board) to output a 1Hz square wave – i.e. outputting a high signal for exactly 0.5 seconds followed by a low signal for exactly 0.5 seconds, repeating.

The device can be programmed by the user to close the on board relay for 0.25, 0.50, or 0.75 seconds, every 1, 2, 3, 4, 5..etc seconds using this 1Hz square wave as a trigger. The relay switches the solenoid which in turn keeps the Lazy Clock accurate to within a few seconds per day.

If you need any kind of relay timer, please email neil@reuk.co.uk with details of your exact requirements.

Header Tank Filling Pump Controller

Pictured below is a controller we have just finished for a customer. We make a lot of rainwater toilet flush pump controllers, but this one is a little different from the norm.

Automatic header tank filling pump controller with time delay and use programmingThis controller is for a pump with its own integrated run-dry float switch protection. A second float switch is located in the header tank. When the header tank float switch goes low (as the water level drops), a user programmable (1 to 99 minutes) timer starts a countdown. When the timer has elapsed, the pump is switched on with the on board relay, and is run until the float switch goes high on the increasing water level.

This version will work well for situations in which water is taken regularly from the header tank, and in particular in situations in which water will be taken from the header tank a few times typically during the timer countdown after the water level first used – e.g. multiple people coming home at the same time and all using the toilet.

The advantage of this system is that only one float switch is needed in the header tank (and there is no need to estimate the time taken to fill the tank by the pump etc).

The disadvantage of this system is that sometimes when the header tank is not being used, the water level will drop because of evaporative losses or leaks in the pipework etc. To mitigate against this, we set up the controller to run the pump for a minimum of 30 seconds each time it is turned on, and also to require one continuous second of changed float switch condition before any action is taken so that turbulence is ignored and to avoid multi-switching (which could rapidly damage the pump).

If you need a pump controller for your well, sump, rainwater toilet flushing, etc, then please email neil@reuk.co.uk with details of your exact requirements.


REUK Super Timer with Light Detector Override

Pictured below is a new device which mixes the features of the REUK Super Timer 3 and the REUK Dawn/Dusk Lighting Controller.

REUK Super Timer with light detector overrideThe timer can be programmed with different ON and OFF time durations from 1 second to 99 hours with various modes of operation available. When the time is ON, there is a 12V output (rated at up to 1A) which can be used to control up to 10-12 Watts of 12V devices, or used to switch a relay if higher currents or different voltages are to be switched.

The modification is the addition of a light detector (light dependent resistor) which is used to override the timer at night time. When the ambient light level is measured to be less than the user set threshold, then when the timer is ‘ON’ the output remains off.

This particular board is for an automatic fish feeder which directly drives a small motor, and the override is to prevent the feeder operating at night.

If you need a timer similar to this, email neil@reuk.co.uk with details of your exact requirements.