LCD Display with Backlight

There is a tutorial and code on the Arduino site on how to  use a 74HC595 shift register  to control a LCD Display here  The Garden Station project uses a modified version of this library which adds the facility to add a second shift register for a second set of outputs, which I used to control the LED statuses.  I’ve also used the QC pin to control the backlight via a MOSFET.   As part of this I added a few extra methods (void setSecondPins(uint8_t secondPins),backlightOn() and  backlightOff() ).   The code is checked into github:-

The garden station code has also been updated to use this code.



I ordered a USBtiny a few weeks ago from ebay to use to program the garden station and it arrived today!


Got it up and running an it works great!  I was previously using a spare Arduino Uno board but this new programmer is simpler and doesn’t require a bunch of jumper wires via a bread board (also frees up the Arduino for something else).   The power also seems to work to power the board via the programmer.

I had to bend back the spare data pins on the prototype board (they were right next to the ISP pins), however I’ve already moved them on the SMD version of the board.

Garden Station

As mentioned on a previous post here are a few more details on the garden station project.   The aim of this project is to build a simple garden watering controller.  As part of this I also wanted to get some PCB’s made to try out getting some made and a sent to me.   I used seeed studio to get the PCBs made and they came out great (although they do take about 4 week to get).

The basic premiss of the garden station is that there are 5 watering sensors, a temperature sensor, 5 servos (used to control water), 6 LEDs, 3 buttons and an LCD display for setup.   I’ve also added ICSP with 2 extra pins to allow for ethernet or SD card expansion via SPI.  On the final version which is not yet built there is also a MOSFET to switch on and off the LCD back light.  I’m building a few of these boards and will probably use them as general purpose control boards for other projects.

The circuit diagram, PCB layout and code are available from github.

I’m still in the middle of this project but have a working prototype from the original through hole PCB:-


As you can see there is some hacks on the board around the shift registers as there were some error on the original circuit (confusion of Eagle’s 595 pin names..).

The working of the circuit is reasonable simple.   6 of the analogue pins are used to provide the input for the moisture sensors and temperature.  I’m using 2 nails which there are plenty of internet articles about.   These go to the screw connectors at the bottom right.

There are 5 PWM outputs to control the servo valves.  These are the bottom middle connectors on the picture above.  I use a small break out board to connect the servos which are all located together.   My original plan was to run long wires to near the plants but in the end I decided to keep them all next to the board (its currently all in an Ice Cream tub…).   The servo are connected to some Pope valves which connect to small 4mm hoses.   These are attached together with a hot glue gun and some paper clips agh the moment, although I’m getting a friend to 3D print some proper brackets:-


I’m also looking to direct drive via a cog when the mounting bracket has been made.

Display and Buttons

At the top of the board there are some connection for the display and the input buttons.   These are not the same as a standard display pinout on the original prototype (hence the wire soldered straight in).   On the SMD version theses have been fixed.   The display is controlled via the first shift register in order to reduce the number of pins needed.


The second shift register controls the LED’s on the board and uses the overflow from the first (hence no extra pins needed).  The last two outputs on the second shift register are used to control the backlight and provide the power for the moisture sensor in the SMD version.

Finally there is a set of 8 pins used for ICSP (6 pin with the 2 top pins being extra data output intended for SPI ethernet or SD card).

I’m still testing but will post some video of the prototype running in the future.   I’ll also be ordering all the parts for the SMD version in the next week so will post the details when thats done!

GardenStation Intro

This project is simple ATMega based plant watering system.    This automatically monitors the soil and water when necessary.

The current prototype is built on a through hole PCB (made at seed studio).  There was a couple of issues withe the prototype build.   The 74HC595 shift register was wired slight wrong and the display interface had a couple of issues.   These have been fixed in the SMD version (I will go and fix up the through whole version).

The moisture sensor uses a couple of nails and the water valve are made from an off the shelf hobby servo and a manual valve.  There is also provision for a temperature sensor and using the ICSP and a couple exposed pins it should be possible to add a simple SSD card for logging or ethernet module for networking.

I will post a more complete description in the next couple of days. The circuit,PCB and code is available on github –