Home Contents Start Prev 1 2 3 Next

Control Electronics

The Microcontroller Board

The brains of the system was going to be a PIC microcontroller. I used a small development board that was intended for a PICAXE and modified it so it could be used with standard pic devices and the PICKIT 2 programmer (my programming environment). This enabled me to use a PIC16F684 device, perhaps a bit of an overkill, but the board needed a 14 pin device. The PIC16F684 has 2k of RAM and an an ADC. The board has 6 inputs and 6 outputs, 4 of which feed low power driver transistors.

picboard

The original design calls for three outputs (one for light, one for water, one for heat) and two sensor inputs (one for moisture, one for temperature). Although the software was written to accommodate this, only one input was wired (moisture sensor) and two outputs (light control and water control). The used inputs and outputs on the board are:

light: RC0 = pin10   op3 
water: RC1 = pin09   op4
heat:  RC2 = pin08   op5

moisture: AN3 = pin03 ip4
heat:     AN7 = pin07 ip0

Relay Driver Board

The amount of current drawn by the lighting circuit will be in the order of 1.5 - 2 Amps. The water pumping mechanism will be similar, although will not be active for as long. This is too much for the driver transistors so the transistors were used to drive relays. The driver transistors have a maximum Ic of 100mA. I searched for some 5V relays with as high a coil resistance as I could find. I settled on a 5V relay with a 560 ohm coil and 3 Amp (30v DC) contacts. Powering the coil through the driver transistor for extended periods of time did not cause the transistor to get warm and the 3A contact rating gave a suitable derating that should give a long contact life.

The relay board was constructed on a small piece of verobard with PCB screw-terminal connectors. Only two relays were mounted on the board, one for controlling the lights, one for controlling water.

relays

Voltage Regulator Board

The microcontroller ran off 5 volts while the 'power circuit' ran from 12V. A small regulator board was built to step down 12V to 5V. This use and LM137 variable voltage regulator configured for 5V output. Again PCB screw-terminal blocks were used to allow connection to the circuit.

regulator

Power Source

The whole system was powered by an 80W 12V laptop power supply. This can provide up to 6.7A of current. The lighting circuit will use about 2A and it could peak up to 4A when the water pump is energized.

Wiring it Together

The three boards were mounted on a piece of wood that was bolted to the wooden baseplate on the top of the box. Then the boards were wired together by means of the terminal blocks. A 2.1cm power socket was mounted on an aluminium bracket so the laptop power supply could be plugged directly into the electronics.

wireup

Flying leads were taken off via a terminal block to the lights and pump. The leads from the moisture monitor were brought up to the input of the PIC where a trimmer pot was used to determine the trigger point. This had been done by experimentation in a box of compost earlier. The nails were about 4cm long so push deeply into the soil. The top of the soil can start to look a little dry but is still damp further down so keeping the resistance down. I guess it will be a matter of experimentaion to find the optimal setting of the trimmer.


Home Contents Start Prev 1 2 3 Next