December 2016

252627282930 31

Style Credit

Expand Cut Tags

No cut tags

November 30th, 2014

tony_osp: (Default)
Sunday, November 30th, 2014 03:40 pm
As I mentioned earlier, I'm working on expanding the Sprinklers smart controller to make it support a network of wireless remote stations. Each station can control a set of watering zones, and it can also collect data from environmental sensors - temperature, humidity, air pressure, soil moisture. Remote station can also collect water flow data.

Over the last month I finished design of the remote station, built a prototype device, and now I'm finishing up the firmware for it. This post is an overview of the Remote station.

Remote station is built on Arduino - powerful yet inexpensive platform for DIY projects. Bit attraction point of Arduino in this context is the availability of all sorts of sensors, RF modules and other add-on hardware, and associated libraries. Also Arduino has low power consumption, and is suitable for even battery-powered devices (although right now this part is not important for my project).

My remote station consists of an Arduino MCU, local LCD and buttons (to allow limited local control), relays for controlling irrigation zones, few sensors, and RF module for communication with the Master station. I'm using excellent RBoard MCU from, it includes AtMega328P (Arduino Uno-level hardware), 4 electromechanical relays, SD card slot, and Xbee and nrf24l01 modules interfaces. RBoard is just more convenient (and more compact) for my purposes.

LCD is C0220BIZ-FS(RGB)-FBW-3VM display from Jameco, it provides 20x2 character mode with RGB back light, it connects via I2C interface and runs on 3.3V - perfect fit for RBoard.

As the RF interface I'm using Xbee Pro 900MHz modules - I need sufficient range and power to be able to reach far end of my property in adverse link conditions - foliage, rain (you still need to get sensor readings!), devices location in a wet box near the ground etc. Unfortunately regular inexpensive modules like nrf24l01 cannot do it, but Xbee Pro 900 can. Xbee modules are more expensive, but for a few devices in a home DIY project it does not really matter that much. Good thing is that it is possible to use nrf24l01 modules instead of Xbee, I might experiment with it later.

Remote station supports both regular 24VAC valves, and Orbit DC valves. 24VAC valves are connected directly to control relays, while Orbit DC valves are connected via my voltage converter module (simple circuit that produces DC pulses on On and Off).

Remote station is powered from a standard 24VAC line. It is actually possible to use any suitable power sources (e.g. 12VAC or 24V DC), main constrain is the need to have sufficient voltage to drive irrigation valves.

Remote station is powered by a small rectifier/buck converter module. I could've build one, but there was a suitable module available on Amazon, and I went an easy route:-)


The station is assembled in a clear plastic 6"x4" box. The box is reasonably weather-sealed, although I would not risk putting it under the rain - I had to drill few holes for buttons and LCD mounting screws, and it is hard to make it truly watertight.

All together it looks like this:

The empty space at the bottom of the box is the space for the Orbit DC voltage converter - it is not required for 24VAC valves but is necessary for driving Orbit DC valves.

I have baseline software up and running, except Xbee communication part. That code needs more work, and it requires also updates to the Master station (to add Remote stations support).

Next steps - hopefully I will have more time available before the end of this year to finish up the code and to get RF hookup going. Once it is done - it will be possible to start making 3-4 stations to get ready for the next irrigation season.

Another thing I'm considering to try - moving Master controller to a small tablet like HP Stream 7. It has very nice 7" screen, and pretty powerful hardware - all for $99 (!). Initially I was thinking about moving it to RPi, but Stream 7 is a way better machine - it has more resources, nice 7" screen, WiFi, decent storage, even backup battery. And it is running full Windows, which makes development a lot easier.
tony_osp: (Default)
Sunday, November 30th, 2014 06:08 pm
One of the problems I had to solve when building Remote station was finding suitable LCD for it. For various reasons I wanted to use RBoard - integrated MCU module with build-in 4 relays and RF sockets, but RBoard creates its own problems.

First of all RBoard has fairly limited number of GPIO pins - it is essentially Arduino Uno-level hardware, with only few pins available. And out of these available pins 4 are already used for relays, I need at least 4 for input buttons, plus I need pins for RF module and for connecting sensors. RBoard just does not have enough of free pins to run standard parallel 1602 LCD.
Second problem is the voltage. RBoard is running at 3.3V, which is OK for broadly available sensors and RF modules, but it puts constrains on LCD module as well.

Each of these two problems by itself is not a big deal, but together they are creating certain challenge. Typical 1602 LCDs are available in 3.3V, but I don't have free pins for it. LCDs with I2C interface are also available, but usually they are running on 5V.

After searching for some time I came across this LCD device.

It is available from both Jameco and Amazon (sold by Jameco), it does what I need and is surprisingly inexpensive for its capabilities.

After trying out the device I'm quite impressed - this LCD is pretty clear and bright, characters are about the same size as a typical 1602 LCD, it runs on 3.3V, and it works via I2C interface. And it also has RGB back light, allowing you to select any desired color of display.
This LCD also has 20 instead of 16 characters in line - which is nice, allowing me to show additional information (e.g. temperature and humidity) in addition to the existing sprinklers control UI.

The module itself is unusual - unlike typical 1602 LCD this one is a single monolithic module. There is no PCB there, all electronics is inside common slim sealed module. I think it is using "Chip on Glass" technology.

The LCD just needs two external capacitors to run built-in voltage regulator, and one resistor for I2C bus - that's all. It is also quite advanced in its capabilities - you can programmatically control contrast, the device allows loading in 16 custom characters (double of a typical 1602), plus it has 20x2 screen. And the price is pretty good - $12.95 at Jameco, with usual volume discounts.

Connection to RBoard is easy - just two wires (plus ground and power). And it is also possible to put other devices (e.g. sensors) on the same I2C bus, so these two wires are shared.

One (minor) thing is that this module has thin pins more like an IC - it is intended for soldering on a PCB rather than directly connecting wires. I ended up using a piece of a prototype board to make the base for LCD, the same board is also acting as a wiring point for input buttons.
For the actual release (not prototype) version of the Remote station I'm thinking about adding I2C GPIO extender chip (can be mounted on the same LCD board), this would allow connecting LCD and input buttons to MCU with only few wires, plus it will allow programmatically controlling back light color (and will free up another 4 pins on MCU).

Another catch in all this - control library. This LCD does not work with a standard LiquidCrystal Arduino library (the controller is different, not just the interface), and it took me half a day to find a library that works. But it was worth the hassle - overall I'm quite happy with this LCD.