Magazines: AutoSpeed  |  V8X  |  Silicon Chip  |   Property News  Shopping: Adult Costumes  |  Electronics  |  Cars  |  Fishing
Email Address:
Password:

Lost your password?

Article Search

Circuit Notebook

(1)Light-controlled Pond Pump; (2)Bike Battery Charger; (3)6-Station Sprinkler Controller; (4)4-Channel Oscilloscope Adapter

 Advertisement
Advertisement 

Light-controlled pond pump

This circuit was constructed to control the pump in a garden pond, so that it automatically turns on at dawn and off again at dusk. Not only does this mean that we don’t have to get cold and wet when turning the pump on or off manually but it’s also one less job for our kind neighbours when we go away on holidays!

The controller is powered from the pump’s existing 25VAC mains transformer. A bridge rectifier (BR1) and 1000μ F capacitor provide DC power to the circuit. For dependable operation, this is regulated to +12V by a 7812 regulator (REG1), while a red LED (LED1) provides power-on indication.

Click for larger image

The light sensor (LDR1) is a Cadmium-Sulphide photocell obtained from Tandy Electronics.

The photocell forms a voltage divider with trimpot VR1. With no light on the photocell, the voltage on the base of Q1 is greater than 0.6V and therefore it is switched on. When light falls on the photocell, its resistance decreases, lowering the bias voltage on Q1 and switching it off. This in turn allows Q2 to switch on, energised the relay and turning on the pond pump.

In use, the 2.2MΩ trimpot is adjusted so that the pump cuts out at the desired light level. A 47μ F capacitor across LDR1 prevents transient light changes from affecting circuit operation. S1 is a miniature SPDT centre-off toggle switch, allowing the pump to be turned on or off manually, or switched to automatic mode.

The circuit was constructed on a small protoboard from Dick Smith Electronics (Cat. H 5604) and housed in a bulkhead box, which was then attached to the transformer housing. The photocell was soldered to a length of figure-8 cable and sheathed in a short length of heatshrink tubing to form a light probe. This was attached to a nearby fence post to provide suitable exposure to sunlight.

Ian Hogan,

Mt Waverley, Vic. ($35)

Bike battery charger

Click for larger image

This simple circuit allows a 12V battery pack to be charged via a bike generator. The generator is rated at 3W and with this voltage multiplier circuit provides about 200mA at about 15km/h. A 12V system was chosen because it allows the use of a car horn (get noticed)!

Two 6V 3W globes in series provides adequate lighting and they last more than six months

Paul Breuker,
Concord, NSW. ($20)

6-station sprinkler controller

This design makes use of a cheap quartz clock mechanism along with a PICAXE-08 micro to accurately time a 6-station sprinkler system.

Power for the entire setup is sourced from a 12V DC plugpack. A 7805 regulator (REG1) provides a well-regulated +5V for IC1 & IC2. Two resistors divide the +5V rail down to about +2.7V to power the clock board. If desired, a 3-cell alkaline battery pack and series diode (D2) can be included to provide backup power during short-term outages.

The quartz clock board acts as a timebase for the sprinkler system, eliminating the inaccuracies that arise when using the micro’s on-board resonator and software for timing tasks. Accuracy of a typical clock is around 2ppm, which means only about one minute error per year!

Click for larger image

The existing coil in the clock mechanism is first removed and discarded. The two pads are then wired to Schottky diodes D1 & D2. These diodes "OR" the pulses from the clock circuit, resulting in a 30ms pulse to pin 4 of the PICAXE microcontroller every second. A LED on pin 3 of the micro flashes in unison with the tick of the clock to indicate that the program is running.

On the output side, each solenoid is switched by a MOSFET, which is in turn controlled by one output of a 4028 1-of-10 decoder (IC2). The decoder enables all six stations to be switched using just three port pins of the PICAXE.

Let’s now look at the PICAXE program, as shown at right. Because of code space restrictions, the six stations are programmed within a 2-hour time zone, operating three times a week. The use of 2-hour blocks for timekeeping cuts down on the number of variables and therefore the required code. This allows more sprinklers to operate on the same variable than would otherwise be possible and allows a maximum watering time of 20 minutes per station. The program uses 126 bytes out of the 128 available.

System activation time is determined by the initial value of variable b3, which counts two-hour time periods. If b3 = 0 (the default), then the first sprinkler will start at power-up. On the other hand, if you wanted to power up the system on, say, Sunday at 12.00 noon, but would like to start sprinkling on Tuesday at 8.00pm, then b3 should initially be set to the value 28 ((24hrs + 24hrs + 8hrs)/2).

If you only needed to water twice a week, you would delete the last "if
b3 ="
instruction and adjust the second b3 value, as so on. It’s all pretty straightforward and is easily modified to suit your requirements. The programmed sequence will repeat indefinitely until power is removed or a new program is loaded.

As it is very easy to download a new program to the PICAXE, changing sprinkling times as needed for summer and winter is a snap. This eliminates the need for menu-driven push-buttons and therefore complicated hardware. And best of all, it’s much cheaper than commercial units, which typically cost over $120!

Ron Russo,
Kirwan, Qld.

'Six Station Sprinkler Controller – PICAXE-08

' NOTE: Values shown for b3 (minutes variable) are for maximum

' allowable time of 20 minutes each but they can be any length

' as long as the total time for the six does not exceed 119 minutes.

' If less stations are needed, then change the program or just put

' the same last time into redundant stations.

Symbol Work_Led = 4 'pin for indicator LED

dirs = %00010111 'set for 4 outputs

Main:

if pin3=1 then Sec_Pulse 'is Pin3 is high goto Sec_Pulse

low Work_Led 'if not then turn LED off

goto Main

Sec_Pulse:

high Work_Led 'a pulse so turn LED on

pause 50 'wait 50 ms (30 ms clock pulse ended)

let b1=b1+1 'increment seconds

if b1=60 then Min_Up 'if 60 seconds are up goto Min_Up

ChK_Day:

if b3=0 then Station_1 'if time first day goto Station_1

if b3=24 then Station_1 'if time second day goto Station_1

if b3=48 then Station_1 'if time last day goto Station_1

goto Main

Min_Up:

let b1=0 'minute is up so reset seconds variable

let b2=b2+ 1 'increment minutes variable

if b2=120 then Hours2_Up 'if 2 hour block is up goto Hours2_Up

goto ChK_Day 'if not goto Chk_day to see if is a water day

Station_1:

if b2>20 then Station_2 'if minutes > 20 goto second station

let pins=1 'else set pins to turn on Station 1

goto Main

Station_2:

if b2>40 then Station_3 'if minutes > 40 goto third station

let pins=2 'else set pins to turn on Station 2

goto Main

Station_3:

if b2>60 then Station_4 'if minutes > 60 goto forth station

let pins=3 'else set pins to turn on Station 3

goto Main

Station_4:

if b2>80 then Station_5 'if minutes > 80 goto Fifth Station

let pins=4 'else set pins to turn on Station 4

goto Main

Station_5:

if b2>100 then Station_6 'if minutes > 100 goto sixth station

let pins=5 'else set pins to turn on Station 5

goto Main

‘ (Last station minute variable value must be less than 120)

Station_6:

if b2=119 then Station_OFF 'if minutes = 119 go turn off station

let pins=6 'else set Pins to turn on Station 6

goto Main

Station_OFF:

let pins=0 'last station time up, clear pins to turn off

goto Main

Hours2_Up:

let b2=0 'last 2 hours is up (1 week),reset minutes

let b3=b3+1 'increment 2 hour block

if b3=84 then Week_Up 'if week has ended goto Week_up

goto Main

Week_Up:

let b3=0 'week has ended so reset 2 hour variable

goto Main

Four-channel oscilloscope adapter

This circuit enables you to display four signals simultaneously using only one channel of your oscilloscope. Essentially, it switches each of the inputs through to the output in turn, with some signal massaging in between. As shown, it is suitable only for low-frequency signal measurement and does not include over-voltage protection at the inputs.

Each input circuit is identical, utilising one amplifier from a TL084 quad op amp package. Looking at channel 1, the input signal is attenuated by a factor of 10 by the 100kΩ and 10kΩ resistors before arriving at the non-inverting input of IC1a. A 15kΩ resistor in series with the op amp output along with a 10kΩ resistor to ground provide additional attenuation.

Vertical (voltage axis) adjustment is made with VR2, which sets the gain of the amplifier. This is used to calibrate or scale the displayed signal against the actual input voltage level. Using the values shown, the gain can be adjusted from unity to about a factor of 26.

Click for larger image

Note that the output of the op amp must be limited to ± 10V so that the voltage into the 4-channel multiplexer (IC2) does not exceed ± 5V. Therefore, with a gain of unity, the input voltage can range from ± 100V, whereas with a gain of 26, it must not exceed about ± 3.85V.

VR1 applies a positive or negative DC offset to the output of the op amp. This can be used to compensate for op amp input offset voltage. It can also be used to shift the vertical position of the trace on-screen to provide multiple trace separation. Note, however, that any offset will consume part of the available output swing and therefore limit signal measurement "headroom".

Each op amp output is connected to IC2, a 4-channel analog multiplexer. The logic levels on "S0" & "S1" (pins 9 & 10) determine which input channel is connected to the "Z" output (pin 3). A square wave oscillator and divider circuit are used to toggle the "S0" and "S1" pins in sequence to first select channel 1 briefly, then channel 2 and so on.

An LM6361 high-speed op amp (IC6) forms the heart of the oscillator. It operates at about 20kHz. Back-to-back zener diodes at the output clip the voltage to TTL levels, after which diode D1 passes the positive half-cycle to the input of one gate of a 74HC00 quad NAND device. IC4a & IC4b "clean up" the signal before if is applied to the S0 input of IC2.

A 74HC73 J-K flip-flip (IC5) divides the oscillator frequency by two. This is used to drive the "S1" input when in 4-channel mode. In 2-channel mode (switch S1 closed), one input (pin 12) of IC4d is pulled low, which effectively holds the "S1" input permanently low.

Finally, a separate buffer circuit (IC3) is used to provide a trigger signal for the oscilloscope. This is needed because it would be difficult to trigger reliably on the main output as it switches rapidly between the four signal sources.

Ashish Nand,
Melton South, Vic. ($60)

Share this Article

 RSS  |  Privacy Policy  |  Advertise  |  Contact Us

Copyright © 1996-2012 Silicon Chip Publications Pty Ltd & Web Publications Pty Limited. All Rights Reserved