HOME


one circuit for six different timers

Timers Collection

easy, useful,versatile

Base schematic diagram | Printed circuit board | Truth tables ot the monostable, cyclic, daily, delayed on, pulse-widening, missing pulse detector

Timers are fundamental building blocks, and as such timers are found in practically every electronic circuit. There are many kinds of timers, available off-the-shelf from resellers of electrical and electronics goods, because circuits circuits involving timers have thousands of practical applications. In this article we will explain how to build six different timers from the same base circuit.
Nutchips are ideally suited for building timers. Not only the timers differ only for the truth table programmed inside the Nutchip, there is also room for ingenuity, and you master the basics you can customize the timer adding your custom logic to the truth tables shown here.

Base circuit

Schematic diagram of the timer circuit. The timer starts pressing the pushbutton labelled SW1.


The schematic diagram is quite straightforward. SW1 is a pushbutton used for starting the timer. The oputputs are set logic level 0 when the timer is not triggered, and to logic level 1 when the timer triggers. The relay driver transistor TR1, which receives its base current from Nutchip output OUT1 via the resistor R1, supplies enough current to energize the relay. The diode D1, connected in parallel with relay's coil, safeguards the transistor against the high voltage that builds up on the coil when it is energized or released. The relay is a 5V coil type, .and it must be choosen accordingly to the load you want to drive (e.g. AC or DC load). Ask your electrician for a suitable model, and always keep an generous safety margin (usually 50% or more) in excess the maximum specs declared by the manufacturer. For example, it is safer not to surpass 500W for a relay specified for continuous 1000W load maximum by the manufacturer.
As an example, for a 12Vac halogen lamp requiring a current of 3 amperes, use a 24Vac/ 6 ampere relay with a coil rated for 5Vdc.

The schematic shows a ceramic resonator connected to Nutchip pins 4 and 5. This kind of clock source ensures a timing accuracy usually better than 1%, which is suitable for most uses. If you are looking for an even more accurate timer (e.g. for daily or weekly timers), a better choice is the quartz clock oscillator as shown in the base circuit collection. The same page shows alternate reset circuits that can be used when maximum reliability is required (this circuit uses a simplified RESET, the pin connects to the positive rail through an RC network made from R2 and C2).

The 9Vdc power supply comes from a cube type trnsformer
(ensure the positive lead connects to Vin).
This circuit regulates the power to 5V required by the timer circuit.

Printed circuit board

The circuit is simple and can be assembled in just an hour if you have a printed circuit board (PCB). Alternatively you can use a prototype board, in that case it requires more time and patience to be completed.

The PCB layout shown in the figure includes also the parts for the power supply regulator (C3, C4, R3, LED1, IC2, CN3).
Alwai start from smaller parts, leaving the bigger parts for later in order to have more space to work. Do not solder the Nutchip to the PCB, use a socket instead. Be very careful when placing the relay, ensure that the tracks for the relay switch have enough insulation (if necessary remove excess copper with a Dremel tool or a wire cutter). Unintentional short circuits between the tracks from CN2 and the rest of the circuit can result in dangerous or lethal power discharges, besides destroying completely the circuit itself.

Connector CN1 is required only if you are going to reprogram the Nutchip in-circuit, that is downloading a new truth table without removing it from the circuit, or if you want to use Nutchip Commander, the virtual remote control and debugger software.

Parts layout on the printed circuit board. You can build yours or use a prototype board: in the latter case, follow the gray grid (grid spacing is the same as the holes in a proto board), and solder bare copper wire to make the tracks.

 

Parts list

  • R1= 4700 ohm resistor
  • R2= 100 kohm resistor
  • R3=470 ohm resistor
  • OSC1=3-pin, 4MHz ceramic resonator (see text)
  • TR1= BC237 transistor or equivalent
  • D1= 1N4007 or 1N4001 diode
  • RELAY1= relay, 5 volt coil (see text)
  • C1,C2,C3= 100 nF ceramic capacitors
  • C4= 10uF/16V electrolytic capacitor
  • SW1 = pushbutton (normally open)
  • CN2= 3-pole clamp
  • CN3= 2-pole clamp
  • IC1=Nutchip NUT01-AK or NUT01-DEA with socket
  • IC2=5V power regulator IC type 7805, complete with heathsink

you need also: a wall-cube 9Vdc power adapter, a prototype board, Nutchip programming interface with cable, and a PC running Nutstation.

 

Truth tables

With just one circuit we can get a full assortment of timers, simply reprogramming Nutchip's truth table. Each of the following timers is designed to fit a specific purpose, with durations that spannig from few seconds to many hours.

Monostable timer
Pressing the button, this timer starts the relay immediately, and releases it precisely after the time set in the "timeout" row (state st01). Pressing again the button has no effect, as long as the button is pressed inside the timeout interval.
 
Applications:
photographic magnifier, sprayers, fluid injectors, to advance a motor in fixed steps, opening time in automatic gate openers...

The file "timer_monostabile.nut" is set for 1-minute delay.
You can change it as you, from millisecopnds to 1000 hours!

Delayed power-on
The timer starts its delay period pressing the button. The relay is not energized yet. At the time the delay period expires, the relay is energized and stays on until circuit power is removed (alternately youc an connect a second pushbutton to input -ST0 to reset the Nutchip without removing power).
 
Applications:
Delayd start for appliances, cookinng timer (just connect a buzzer to the output), sandglass for quiz games, to start burglar alarms right after we leave home, anti-bump for audio amplifiers (replace SW1 with a wire jumper), parking meters.

With an appropriate relay, this timer can start your washing machine 1 hour after you leave home.
This truth table is in the file"timer_ritardato.nut".

Pulse-widening timer
Pressing the button starts the relay immediately. As long as the relay is energized, pressing the button again restarts the timeout period (total time is prolonged). Therefore the timeout is measured from the last time SW1 is released.

 
Applications:
Corridor and stairs lilght timers, toilet fan, pump timers, automatic water taps, automatic hand blowdryers.

This timer is perfect for stair's lights, as the time restarts pressing again the switch.
You can grab the this truth table from"timer_allungatore.nut"

Missing pulse detector (watchdog timer)
As long as the circuit is powered, the circuit requires the button to be pressed at least once druing the timeout period. If the time expires without SW1 being pressed, the relay signals the anomaly (power the circuit off to reset).

E.g., if the timeout is specified to be 5 sec, one must press the button at least every 5 seconds or the relay will switch on.

 
Applications:
Automatic machines to signal when a part is missing (a photocell is triggered by pieces on a conveyor belt), to detect when a mechanism stops (machine movement closes the switch periodically), survellaince systems (the guard is requested to press the button at specified intervals).

Should SW1 be open for more than 5 seconds, the relay triggers.
When SW1 is connected to a conveyor of photocell, the relay detects when the system stops moving.
This is the file "timer_rivelatore.nut"

Cyclic timer
This is a timer with two timeouts. First timeout influences the time the relay stays ON, the second one the OFF period.
The circuit starts working at power on, and if you disregard SW1 it works as a flasher (ON, OFF, ON, OFF...).

Pressing SW1 forces the output to ON and restarts the ON period.

 
Applications:
Flashers, neon lights, Christmas decorations, economizers for heaters, refrigerators, pumps.

To reduce the mean power for an aquarium heater, we can replace the SW1 with a switch. With the switch closed, the heater is ON 100% of the time. With the switch OFF, the heater is ON 50% of the time, bacause it gets powered only each other 5 minutes. You can reduce the time for small basins (should not be used with thermostatic heaters).
File: "timer_ciclico.nut"

Daily timer
This is a special kind of cyclic timer, where the sum of ON and OFF timeouts amounts to 24 hours (precisely).
Pressing the button triggers the relay, which stays ON as long as the timeout specified in st00 expires. It will trigger back on on the following day, exactly at the same hour.

 
Applications:
Showroom and sign lights, heting systems, watering timer, night lights, decorations.

A watering system switching on daily, operating for one hour.

This time (1 hour) is suitable for drop watering system, different systems can require shorter times. It is important that the sum of the ON and OFF times to give exactly 24 hours (here 1 hour ON and 23 hours OFF), to maintain the same starting time from one day to another. You can chain a third state to account for time fractions like spare minutes.
This table is from the file is "timer_giornaliero.nut"

 

Just a start

As you see, building a timer with the Nutchip is very easy. But a timer is just a starting point for other circuits. Let's review a few ideas:

  • add more pushbuttons to select different durations, or to reset the timer once started
  • add a radio or infrared receiver, replacing the button SW1 with a remote control
    (tip: with the virtual remote control you can test the circuit from your PC, even if you don't have the receiver or the real remote controller yet)
  • use the unused Nutchip outputs to drive LEDs: green = OK, yellow = time is about to expire, red = time is out!
    

 download virtual remote control