Automatic Dawn Dusk Gate Opener

24v dawn dusk gate controller openerPictured above is a controller we made recently for a gate which is to be opened at dawn and closed at dusk automatically.

The controller is based around our standard REUK Dawn Dusk Relay Controller which uses a light detector and user calibration to detect the arrivals of dawn and dusk depending on measured ambient lighting levels.

This particular unit is designed to control a large gate motor which requires two contacts on its electronics to be shorted out (connected together) for one second to toggle the state of the gate – i.e. open the gate if it is closed, or close it if it is open.

When dawn is detected, the on board relay closes for one second which opens the gate. Then, when dusk is detected, the relay closes again for one second which closes the gate. The controller has a selection of timers and automation logic built in which prevent false dawns and false dusks being detected when there are clouds moving across the sun early and late in the day.

If you need any kind of dawn/dusk detecting controller, email neil@reuk.co.uk with details of your requirements.

Irrigation Pump Timer with Low Voltage Disconnect

Pictured below is a device we made to control the pump of an automatic and often unattended irrigation system which is solar powered.

irrigation system pump control timer with low voltage disconnectprogrammable digital timer is set with the times that the pump is to be run – typically very early in the morning and in the evening. The pump for this particular irrigation system is relatively high powered, so could not be switched directly by the timer. Therefore a 10A rated relay is built into the controller.

As this system is solar powered and also often left unattended, it was essential to include a low voltage disconnect which will automatically prevent the pump from running whenever the measured battery voltage is found to be <11.9V. It then waits until the battery has been charged back up to over 12.5V before allowing the pump to run again.

LED indicators are included to show when the programmable timer is ON, the status of the low voltage disconnect, and also the status of the pump switching relay.

If you need any kind of irrigation pump timer or controller please email neil@reuk.co.uk with details of your requirements.

Picaxe Based Dual One Shot Timer Relay with Code

Pictured below is a simple timer relay circuit we recently made which we will detail here together with the source code for the microcontroller since we have had many requests for example code for timers of this type.

Two option one shot timer relay circuit - PICAXEWe received a request for a timer with two buttons. Pressing the first button was to cause a relay to close for 10 minutes, and pressing the second button was to cause the relay to close for 30 minutes. The relay was to be used to switch a mains powered appliance.

In our article Make a PICAXE Repeating Timer, we show how to make a repeating on/off timer using a PICAXE microcontroller. The timer pictured above differs in that it has button inputs to deal with and also a one-shot instead of repeating timer.

The red LED is used to show which timer is running – off, but flickering on briefly once per second is the 10 minute timer; on, but flickering off briefly once per second is the 30 minute timer. The green LED is connected across the coil of the relay (with a current limiting resistor) to show when the relay is closed.

The PICAXE code below could be greatly reduced in length but to keep it simple to read through, understand, and adapt, we have left it with separate functions for the 10 minute and the 30 minute timers (instead of making one general function which could run for any duration in response to any button press).

symbol button1 = pinC.1
symbol button2 = pinC.2
symbol led = C.0
symbol relay = C.4

' Start with the relay open and the red LED turned off.
low relay
low led

main:
   if button1 = 1 then goto run10minutes
   if button2 = 1 then goto run30minutes
   pause 100
   goto main

run10minutes:
   'make sure button is held a little before closing the relay,
   high led
   for b0 = 1 to 5
      delay 50
      if button1 = 0 then 
         low led
         goto main
      endif
   next b0

   'Close the the relay
   high relay 

   'wait for the button to be released.
   do
      pause 50
   loop while button1 = 1

   low led

   for b0 = 1 to 10 'minutes
      for b1 = 1 to 60 'seconds
         high led
         pause 100
         low led
         pause 900
      next b1
   next b0

   'Open the relay.
   low relay

   goto main

run30minutes:
   'make sure button is held a little before closing the relay,
   high led
   for b0 = 1 to 5
      delay 50
      if button2 = 0 then 
         low led
         goto main
      endif
   next b0

   'Close the the relay
   high relay 

   'wait for the button to be released.
   do
      pause 50
   loop while button2 = 1

   low led

   for b0 = 1 to 30 'minutes
      for b1 = 1 to 60 'seconds
         high led
         pause 900
         low led
         pause 100
      next b1
   next b0

   'Open the relay.
   low relay

   goto main

 

Archery Timing Circuit

timing circuit for competitive archery trainingPictured above is a timing circuit for archery competitions. Outdoor archers shoot six arrows in one go and are allowed 4 minutes. Indoor archers shoot three arrows in one go and are allowed 2 minutes.

The user can select one of two options – option 1 (outdoor) and option 2 (indoor) for either a two minute or four minute competition. The controller board itself has a red, yellow, and green LED on it and a small buzzer. There are also four relays which can control larger lights – e.g. when the red LED is illuminates, a relay will be closed which can control multiple large red lights. The same is repeated for each LED and also for the buzzer relay which can control multiple buzzers or sirens.

The Mode button is used to select the desired timing option. The red LED will be on while the controller is sleeping. When the Start/Stop button is pressed, the timer starts and the green LED turns on. With the outdoor timing option, the green LED stays on for 3 minutes and 30 seconds. With the indoor timing option, the green LED stays on for 1 minute and 30 seconds. Then the yellow LED turns on to give the archer notice that their time is running out. After 30 seconds the red LED turns back on again and the buzzer sounds briefly to indicate that time is up, and the device is reset ready for the next archer.

While the timer is running, you can press the Start/Stop button to cancel the timer and reset the controller. Alternatively, you can press the Pause button to pause the competition. The buzzer sounds 3 times quickly to indicate that the competition has been paused and then when the Pause button is pressed again, the buzzer sounds 3 times. The timer continues from where it left off exactly after the buzzer sounds for the third time.

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

Pistol Shooting Training Timer

Competitive pistol shooting trainer timerPictured above is a timer we recently made for use in competitive pistol shooting training. There is a microswitch under a flat plate on which the pistol lies. When the shooter picks up the pistol, the timer starts counting down a user set value of either 6, 8, or 10 seconds after which a buzzer sounds briefly telling the shooter to replace the pistol. The duration of the timer is set using a button to step through the three possible options, with an LED (red, yellow, or green) illuminated to show the currently selection option. This will all be fitted inside an enclosure with the microswitch connected through the circuit board, and the LEDs and timer mode selection button mounted in the lid of the enclosure.

This timer is built around an Arduino Pro Mini board and uses its internal clock for timings as it is accurate enough over such short timing intervals (+/-1 millisecond or better over 10 seconds) when considered in conjunction with the time it takes the microswitch to open/close, or sound to actually start to emit from a buzzer when it is first powered.

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

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.