Arduino Controller Box

From $1

Introduction

This details the steps I've taken to build the controller box that houses the Arduino and supporting circuits/wires used for our Solar Hot Water system.

Note 1: I am not an electrical engineer.  I've gotten the following to work by asking electrical engineers, searching the Internet, and trial-and-error.  If you can recommend improvements, please let me know!  Either leave a comment on this page (preferred; must have an account), or send me an e-mail.

Note 2: This is still in its R&D phase, so if the pictures or techniques still look raw/messy/unprofessional, there's a reason for it.

Layout & Overview of Components

I am currently using an 8x6x3" project enclosure from Radioshack, but can probably make it smaller in time (look a little neater, and costs less).  Going down to the 7x5x3" should be no problem, and I have a 6x4x2" in front of me that I'll try eventually once I'm more comfortable with the build process.

Interior

IMG_0098-numbered.JPG

  1. ELK-924 relays.  Each relay is connected to a different digital output on the Arduino.  When the Arduino's digital output is turned on, it triggers the relay on.  The relays control (a) a rainbird valve to to fill the hot water collector, (b) a pump to drain the hot water collector, (c) a rainbird valve to top off the hot water tank.
  2. Arduino Duemilanove.  Uses logic to control the physical world (1) based on inputs from the physical world (3).
  3. An RC Circuit, used to get reliable data from the temperature sensor when cable lengths are greater than 10'. *
  4. Using a set of resistors to split the 12VDC (top terminals, used to power the relays) out into a 9VDC branch for the Arduino (left-hand terminals). **
  5. 12 VDC Regulator (optional).  Used if DC source to the box is regularly over 14VDC.  The one pictured is excessive; would use this next time.

Circuits:

*RC Circuit.  Here's the diagram for the RC circuit that works.  I don't know why it works (outside of my field of expertise), only that it does.  The LM34 is the temperature sensor (explained later on).

schematic.jpg

**Voltage Divition Circuit.  A couple of hours into reading my Teach Yourself Electricity and Electronics book revealed this circuit.  In a nutshell, you need to match your split voltage (E1) to supply voltage (E) ratio with the R1:R ratio (where R1 is the resistor on the ground side, and R is the total circuit resistance). The E1:E ratio is 9:12, or .75.  The resistors that I had on hand that came the closest to this ratio were 220 ohm and 75 ohm.  The R1:R ratio comes out to 220:295, or .746.  Taking a volt-meter to this circuit gives me a split voltage of 8.95.  Close enough!

12v to 9v circuit - 140.jpg

Wiring the Relays.  A picture of the relays with its wiring for four separate circuits (relay power, Arduino trigger, LED control, and relay control to outside the box) would be too messy, and probably not too informative, so below is a schematic sketch of the wiring.  Making it all look neat is a different matter (still working on that myself).

Relay Hookup - 144.jpg

To prevent shorts, use shrink tubing or other methods whenever possible.

IMG_0140.JPG

Arduino Hookup

As shown in the 'Wiring the Relay' diagram above, use 22 gauge solid wire to connect the positive triggers of the relays to the digital outputs of the Arduino.

Once the software has been uploaded to the Arduino and everything tests out OK, use a little bit of hot-glue where the wires connect to the Arduino to prevent the wires from pulling out during field installation/vibrations.

IMG_0166.JPG

Connect the 5V Arduino pin to the Vin terminal on the RC circuit, the GND Arduino pin to the GND RC circuit terminal, and the Analog In 1 Arduino pin to the Vout RC circuit terminal.

Once the software has been uploaded to the Arduino and everything tests out OK, use a little bit of hot-glue where the wires connect to the Arduino to prevent the wires from pulling out during field installation/vibrations.

IMG_0162.JPG

Exterior

To help keep the interior of the project box weather proof, I use 2-position and 3-position barrier terminal blocks.  This also has the benefit of allowing easy field installation, as all you'll need is a wire stipper and a screw-driver.  If you have to open up the box or solder in the field, something is wrong.

Power & Sensor Inputs

On one side of the project box, attach a 2-position and a 3-position terminal block.  To attach the terminal blocks, I drilled 1/8" holes, and used #6-32 x 3/4" screws and nuts.

Drill a 3/16" hole underneath each terminal block to feed 22 gauge wire though.

Drill a 1/4" hole next to the power block for an LED.

Label everything.

IMG_0142.JPG

Relay Inputs

On one side of the project box, attach three 2-position terminal blocks.

Drill a 1/4" hole underneath each terminal block to feed 16 gauge wire through.

Drill another 1/4" hole further underneath each terminal block for the LEDs.

Label everything.

IMG_0145.JPG

Weatherproofing

Use hot-glue, silicone, epoxy, etc. to waterproof all wire openings.  Also waterproof the underside of the LEDs, as this also helps keep the LED holders in place.

IMG_0149.JPGIMG_0154.JPG

USB Hookup

Extend the Arduino's USB port to the outside of the case using a B-to-B female USB cable.  This will allow easy field firmware upgrades and troubleshooting (real-time log printouts) without having to open up the box.

IMG_0159.JPG

Temperature Sensor

The Arduino is programmed to use an LM34 temperature sensor.  These are inexpensive, but you do have to wire them yourself.  The data sheet for this sensor is here, but the relevant part related to wiring it is this:

LM34 Connection - 145.jpg

I use the following color scheme when wiring the temperature sensor:  +Vs (Vin) = Red, Vout = Black, GND = Green.

This temperature sensor will be spending its life measuring water temperature in a solar collector, so once you've finished soldering on the leads, make sure to waterproof all exposed metal.

IMG_0160.JPG

The length of wire to solder onto the temperature sensor should be about 2'.  This is enough length to mount to the collector, leaving enough slack to attach to the collector's bottom.  In the field, a longer length of cable will then be used to connect this 2' length to where ever the Arduino controller box is located.

Other Components:

  • PCB for Circuits: Due to my poor soldering skills, I will be replacing the standard PCB board as seen in the picture above with this one provided by Radio Shack, which has nice easy traces in it already!
  • 2-way and 3-way PCB terminal block.  I use the 2-way terminal blocks for the 12V to 9V circuit, and a 3-way terminal block for the RC Circuit.
  • Barrel plug for Arduino.  5.5mm O.D., 2.1mm I.D.  Adaptaplug "M" from Radio Shack.
  • LED lights.  Make sure to get form-factor T1.  In my Wiring the Relays diagram, I use a 1.5K ohm resistor for the four LEDs.  If using LEDs that don't have a forward voltage of 1.9V and a forward current of 2mA, then use the LED Resistor Calculator.  The LED lights I'm linking to are slightly brighter and cheaper ones I'm thinking of using next time.  They have a forward of voltage of 1.5V and a forward current of 25mA.  According the the LED Resistor Calculator, I would use a 120 ohm resistor for these.
  • LED Holder.IMG_0156.JPG
  • 22/4 solid wire.  Used for temperature sensor, and 90% of wiring inside of controller box.
  • 16 gauge stranded wire.  Used to hook up the relays to high-voltage 2-position terminal blocks (wired to the rainbirds/pump).
  • M2.5 spacer and screw.  Used attached the Arduino, relays, PCB to the metal floor of the project box.
  • Resistors: (1) 220 ohm, (2) 75 ohm, plus what is used for the LED circuit.
  • Capacitors: (1) 1uF, (1) .1uF.
Tags:
FileSizeDateAttached by 
 12v to 9v circuit - 140.jpg
12V to 9V circuit
18.69 kB17:13, 21 Sep 2009aewerdtActions
 IMG_0098-numbered.JPG
Arduino Controller Box Components
2.62 MB16:21, 21 Sep 2009aewerdtActions
 IMG_0140.JPG
LED with Shrink Tubing
456.74 kB12:52, 23 Sep 2009aewerdtActions
 IMG_0142.JPG
Power LED with sensor hookup and labels
700.19 kB12:52, 23 Sep 2009aewerdtActions
 IMG_0145.JPG
LEDs and Relay hookup labels
743.52 kB12:53, 23 Sep 2009aewerdtActions
 IMG_0149.JPG
Hot glue all wire openings
482.8 kB12:53, 23 Sep 2009aewerdtActions
 IMG_0154.JPG
LEDs - Hot glue underside
477.86 kB12:53, 23 Sep 2009aewerdtActions
 IMG_0156.JPG
Standoffs
611.68 kB09:03, 24 Sep 2009aewerdtActions
 IMG_0159.JPG
External USB extender
517.06 kB09:03, 24 Sep 2009aewerdtActions
 IMG_0160.JPG
Waterproof temperature sensor
304.23 kB09:04, 25 Sep 2009aewerdtActions
 IMG_0162.JPG
Temperature Sensor to Arduino hookup
516.62 kB09:04, 25 Sep 2009aewerdtActions
 IMG_0166.JPG
Relay trigger to Arduino hookup
1105.5 kB09:04, 25 Sep 2009aewerdtActions
 LM34 Connection - 145.jpg
LM34 wiring
14.14 kB09:23, 25 Sep 2009aewerdtActions
 Relay Hookup - 144.jpg
Relay Hookup
161.93 kB13:01, 23 Sep 2009aewerdtActions
 schematic.jpg
RC Circuit
77.42 kB17:03, 21 Sep 2009aewerdtActions
Comments (1)
Viewing 1 of 1 comments: view all
Looking at your voltage divider circuit, while that may work for now, I honestly would not use that for anything long-term. While it outputs 9V, that is the unloaded voltage. Add an Arduino, and that voltage is going to start sagging pretty quickly. Add the rest of the circuit components it needs to power, and it could easily drop down to 7V and start wasting over a quarter Watt of power.

My suggestion: try running the circuit without the 9V splitter. While 12V is the recommended maximum (and where the battery voltage is going to spend most of its time anyway), the Arduino is fine to handle voltages up to 20V, as long as you aren't adding a significant load (which you aren't). This will shave about half a watt off of the circuit's power draw; and any power saving methods in a solar electric system is a good thing. edited 01:43, 18 Jun 2010
Posted 01:41, 18 Jun 2010
Viewing 1 of 1 comments: view all
You must login to post a comment.