Luxcity UV Tonic Control System

Project Start Date: 27/09/2012
Project Completion 21/10/2012
Status: Complete

The Challenge

luxcity-tonic-logo-small The Luxcity Tonic logo.

To design and build a sequencing control system for 64 solenoids that control a mixture of UV tonic and air into a manifold of pipes to be pumped around a structure. This was for a team participating in the Luxcity Project (http://stajegrouparchitects.wordpress.com/),
or news articles

or the Luxcity event page itself (http://www.luxcity.co.nz/)

or the Luxcity page on EventFinder (http://www.eventfinder.co.nz/2012/luxcity/christchurch-city/christchurch)

luxcity-event-october-2012-christchurch Luxcity event poster for Christchurch 2012.

EDIT 30/10/2012:

Post-event there have been another news article:

Repository

The repo for this project can be found on BitBucket at https://bitbucket.org/gbmhunter/luxcity-tonic-uv-control-system. It contains the firmware and datasheets.

The Hardware

8x FreeTronics 8-Channel Relay Driver Shields

arduino-8-ch-relay-channel-02 The Freetronics 8-channel relay driver shield for the Arduino.

Manufacturer: Freetronics
Store URL: http://www.freetronics.com/products/relay8-8-channel-relay-driver-shield
Datasheet: https://github.com/freetronics/RelayDriverShield8/blob/master/RelayDriverShield8.pdf
Supplier: NiceGear

The I2C controlled shield provides 8 outputs that can drive standard relays. Being I2C controlled, it only uses 2-pins of the Ardunio. Luckily, the I2C address settings are 3-bit, meaning I could just control all 8 from a single I2C line. The boards feature the MCP23017 I2C expander IC (datasheet).

freetronics-relay-driver-schematic-snapshot-of-1-channel Part of the schematics for the Freetronics 8-channel relay driver shield showing one channel.

64x SPDT 12V Relays

64-12v-relays 64 12V relays.

Manufacturer: Zhejiang Dongya Electric Co. Ltd.
Supplier:
NiceGear
Supplier Link: http://nicegear.co.nz/components/relay-spdt-sealed/
Datasheet: (click here)
Rated Coil Load: 12V @ 37.5mA
Coil Resistance: 320Ω
Minimum Coil Load: 5V @ 10mA
Operate Time: 20ms
Release Time: 10ms

64 relays are needed to control the 62 tonic water/air solenoid valves (plus 2 spare). Since there was 64 of them, they needed to be cheap. These ones were brought for around NZ$3 each.

62x 12V Solenoid Valves

12v-solenoid-valve-02 A 12V solenoid valve. 62 of these were used to control the flow of UV-reactive tonic water or air through the pipes.

Manufacturer: HR Products
Supplier: HR Products
Datasheet: (click here)
Operating Voltage: 12V
Inrush Current: 320mA
Holding Current: 260mA
Power Consumption: 8W
Minimum Operating Pressure: 20kPA
Maximum Operating Pressure: 1250kPA

62 solenoids are needed to either allow tonic or air to flow into one of the 31 pipes. When I first received them, I had a horrible feeling as I blew in one end and the solenoid let air through with some resistance. This was until I realised that they have a minimum operating pressure of 20kPA.

1x Ardunio Uno

Manufacturer: Arduino
Supplier:
NiceGear
Supplier Link: (click here)

I decided to use the Ardunio development environment for speed, simplicity, and pre-existing hardware/firmware. The USB cable was able to provide enough power to turn on all 64 relay lights and the LCD screen (including backlight), without causing an over-current fault.

2x Power Supplys

twin-power-supplies Twin 500W power supplies to turn on up to half of the relays and solenoids all at once.

Manufacturer: EnerMax
Product: TomaHawk2 500W ATX2.2 PSU
Supplier: MightyApe
Product Page: (click here)
Total Continuous Rated Power: 500W
Output Voltages: 12Vx2, 5V, 3.3V, -12V

A PSU is needed to power the 64 relays and solenoids. This gave me a scare when I first received it, as it was ‘apparently’ not working. After some research I discovered that I needed to short out the green wire on the main connector to ground before the PSU would turn on.

They quote that there are two +12V supplies, but when using a multimeter, there was no resistance between any of the +12V wires, so either a) they are lying, or b) the two +12V outputs are connected together internally.

1x Arduino LCD Screen Shield

arduino-lcd-shield-02 The Freetronics LCD shield for the Arduino. This was used to display running information to the user.

Manufacturer: Freetronics
Supplier: NiceGear
Product Page: (click here)

It just so happened that the relay driver shields are mount-compatible with the LCD screen shield, as the driver shields only use analog pins 4 and 5 for I2C communication, and the LCD screen only uses digital I/O.

The LCD screen was one of easiest parts of this project to setup. Built in libraries for controlling an LCD are included in the Arduino IDE. It literally took about 5 minutes to get this working (see below).

Vixen Software

vixen-software-logo The Vixen software logo. Image from http://www.vixenlights.com.

URL: http://www.vixenlights.com/
License: Closed-source, free to use.

Vixen is a free PC-based sequencer designed for controlling lights. Although not open-sourece, it is very versatile, being built upon the .NET framework, and provides an API to build your own input/output plugins.

To get around the problem with Vixen not outputting cells with an intensity of 0 (the firmware can’t recognise what output value is for what channel unless all 64 are output in the correct order), I made the minimum allowable intensity equal to 1, so that Vixen outputs a value for every cell at every time step, and the firmware looks for a non-one value.

Construction

The hardware! (just after arrival).

The relay boards and LCD were stacked ontop of each other.

Wiring up the relay boards.

Placement of the relays onto strip board (they JUST managed to fit all on one board).

A quick way of breaking tracks on prototype board.

Soldering the relays, relay coil inputs, and power connectors to the board.

The 62 solenoid valves.

After testing a solenoid valve with the system, the comms between the computer and Arduino dropped out when the solenoid was turned off. I realised that although the relay shield boards had protection diodes, I still needed to add some to the solenoid’s (on the relay outputs), as this inductive kickback was coupling into the digital system. Luckily I had a string of 1N4003 diodes on hand…

The Arduino, relay control boards, and the relay board, semi-assembled.

The bottom-side of the prototype board, fully soldered. Notice the heavy duty rails that deliver the power to the relays/solenoids. Even with these thick lines of solder, when half (31) of the solenoids where turned on, the board got considerably warm around the PSU entry point.

Wiring up the solenoids, as they need to have a 2m cable reach. I’m going through 100m cable rolls like it’s Christmas.

The pile of wired solenoids. It took a good 8+ hours to wire these up!

Shorting out the green wire to ground on the PSU to get it to turn on.

Adding small-valued power resistors in series with the PSU outputs to make them share the current equally.

The heavy duty fuses used to protect the +12V rails of the power supply. The two in use are 30A 5AG fuses, and the two spares are 40A.

The LCD screen working. This part was a breeze, it was an Arduino capable LCD shield, and there was a pre-written library for the firmware. It literally took less than 5 minutes to get working.

The solenoids were numbered so sequencing would become confusing when out in the field.

Testing the complete system the night before it’s due to be used.

The Vixen software sequence used to test the solenoids. Each solenoid is turned on for 1 second in sequential order.

The settings to configure the ‘Generic Serial’ output plugin in Vixen.

Onsite

The manifold with the solenoids in place, being assembled on-site.

Carrying the water tank for the gin and tonic drinks down the road to the the construction site.

The tensioned cable structure being hoisted into the air by the crane.

The annoying street-light which dampened the fluorescent effect.

The pipes with tonic inside them, glowing with UV.

Gin and tonic!

Some of the other structures at the Luxcity event.

Firmware

I firstly considered DMX Control (as described in a FreakLabs tutorial here), but this required hacking the Ardunio software platform (specifically, the HardwareSerial.cpp file) to get the UART to work correctly. I found it more elegant to use the Vixen output plugin ‘Generic Serial’ instead, as this worked without any hacking.

The firmware can be found in the project repo under ‘src’ on BitBucket at https://bitbucket.org/gbmhunter/luxcity-tonic-uv-control-system. Since there wasn’t much to it (one file of around 320 lines or so, I have also shown it below. Note that changes may of been made to the src after this code below was posted, so always use the repo on BitBucket if you want to get the most recent code.

 

Gallery

click any image below to start a slideshow-like gallery view

Default Gallery Type Template

This is the default gallery type template, located in:
/home/gbmhunter/public_html/blog/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php.

If you're seeing this, it's because the gallery type you selected has not provided a template of it's own.