Monday, 22 August 2016

An Arduino Powered Watering System

So it's finally been made.
In preparation for our trip to Italy, Louise's housemate Alastair and I have made an Arduino Powered Watering System.

The idea we formulated was to have a large water butt which lets water flow into a secondary container at set times. Once in the morning and once at night outside of the intense sun hours.
This secondary container will have water taps that are always on so water flows through. This was designed so we only have to power one servo to let all the water supply needed out in one go.

The list of things we needed and our estimate prices were;
----
rechargeable 12v battery lead acid - £8 - £20
Solar Charge Controller Panel Battery Regulator Safe 10A 12V/24V - £5 - £10
Tower Pro SG-90 SG90 9g Micro Servos  £2 -£4
Arduino Uno R3 - £5
25L - 45L tub - £7 - £25
long plant plot with flat sides - £3 - £10
air tight water taps - £3 - £4 each most retailers (5)
hose pipe - £5
Solar panel charger 10W 12V £15 - £40
2 Channel 5V High Level Trigger Relay Module - £1.50 - £5
Car wire Fuse - 15p
Dc Dc Step Down Converter Voltage Regulator 24v 12v To 5v Usb Charger Voltmeter - £1 - £3
------------------------------------------
In the end the total cost was: £80 (including broken parts) + £10 for a wooden frame
------------------------------------------
First we created a wooden stand to hold the 35L tub we had, hastily constructing it on the allotment using tools from the shed we'd inherited with the plot. We made sure there was just enough room for the secondary containers shelf so that the water was as high as possible. The higher the secondary container the easier water would flow into the pots using gravity alone.
The stand with two shelves


We then fitted the solar panel, a 12v 10w device that we connected to the roof of the greenhouse using bolts and a bit of wood. Making sure the solar panel faced south so as to get sun from morning to night. The solar panel hooked to the solar regulator which we attached to the left front stand so we could easily see the battery levels.
The regulator has three connection points; + and - for the solar panel, + and - for the battery and + and - for the thing being powered. In our case the Arduino. 


********************
Lesson 1: Just because an Arduino can take 12v input... it does't mean it should. 
hint - smoke and fire
********************
The servo - chosen after the terrible instrument called the solenoid, read more HERE - was attached to a water butt tap which it turns 75 degrees to an open position for x amount of seconds before closing. It then repeats the process having left enough time for some of the water to have got into the soil.


********************
Lesson 2: If you can't find the right resistor, do NOT connect a 12v power source to a 5v servo
********************

To make sure the servo isn't always on and therefore draining battery. The servo needed to have power to it stopped when not needed. To make this happen, the arduino was connected to the relays IN1 so that control of whether to power the servo could be decided by us. We then wired the servo to the IN1 relay output so it could be powered in these time.


Now. Lesson 1 taught us what havoc charging 12v to 5v device could cause, so we decided to obtain a 12v to 5v step down convertor, this would allow us to regulate the incoming power to the arduino and the servo whilst also reducing power usage.

 ********************
Lesson 3: Powering a step down convertor in reverse - 5v in the 12v ports and vice versa - results in ringing ears

********************

The next thing we added, to reduce the possibility of blowing everything up too often was the fuse, which meant the fuse would take the fall. Its actually had some value and we've only blown one up so far!

In all these fires and explosions, the only thing we haven't destroyed yet is the 12v car battery which has thus far served us well. This also connects to the solar regulator -  a very simple device that controls how much energy the Arduino receives, how much the battery takes and when to fill up the battery. 


The final pieces to discuss is the secondary tub. This is only suppose to fill up with just enough water to release into the taps connected to its sides. It does't need to be large as it should be dispensing water at the same rate it is receiving it. If it isn't then you are releasing too much water, either from the primary store or the taps aren't open enough.

**********************************

Below is a picture of the system drawn out:


**********************************

In Action:




If you would like to see the arduino source code, feel free to email me on aiden.g@live.co.uk



       

Saturday, 20 August 2016

The Snail Paced Drip Of The Solenoid

12v Magnetic Solenoid Valve
Whilst looking at options for making an Arduino powered watering system, I brought a “12v Electric Solenoid Valve Magnetic DC N/C Water Air Inlet Flow Switch ½”, attached it to a bucket of water and plugged it into a 12v battery. Immediately I heard a quick clocking noise as the magnet worked and water started flowing through. Slowly.

Very, very very slowly.

Drip, drip, drip. It became obvious that it would take a long time to water the greenhouse plants using this as we could be using anywhere up to 2 litres a day. This would drain energy the whole time it was activated. Whilst not a viable option for the project we decided to take it apart and find out how it works.

First came off the four screws at the top and then the white plastic that looked like a spinning top. Inside the long pole was a spring and a metal piece known as an “armature”. When current is passed into the solenoid, the core works to close the air gap between itself and the armature pulling it towards itself. This leaves a small opening at the “tap” allowing water to pass through. It would appear to be heavily reliant on pressure as added pressure made the flow marginally quicker but this was limited by the spring which is used to push the armature back in place post energizing.



Potentially what we could have done is cut some of the spring to allow more pressure when the magnet is activated, drawing the armature closer in. Again this change would be marginal whilst risking the possibility of not being able to seal the water gap when power is no longer supplied.


It would appear a servo would be the next thing to look at.

Wednesday, 10 August 2016

Watering your plants whilst on holiday.

My girlfriend and I have an allotment. We also enjoy going away for periods of time to see family and friends, or to go and see a bit of the world. Which is fine in rainy Britain for my outdoor plants, but less forgiving for my green house plants which can range from tomatos, to seedling carrots, to strawberry plants and herbs.

So what to do when we go away? We COULD pester our friends and flat mates but we can’t expect them to check up on our plants all the time. As I probably wouldn’t want to do it for other people.

This is a short blog about some of the options available to me. Based on the following requirements:
·      Needs to be able to water for around 7 days
·      Needs to provide the right amount of water for the plant it's serving
·      Needs to be able to service seed(ling)s
·      Accounts for different sized pots

Option 1: Upside Down Bottle
The classic upside down bottle in the soil. This consists of putting a hole or slightly opening a bottle lid, turning it upside down, cutting off the bottom and filling with water. This slowly releases water into the pot for the eager plant.
Benefits: Quick, effective, simple to make, simple to use.
Limitations: Need to buy many to deal with demand, hard to regulate water flow and maintain water amounts, needs bigger bottles for bigger plants which takes up room and is ugly.

Option 2: Mighty Dripper Ultimate Plant Watering Kit
You can find this product here
Similar system which allows for more pots to be watered from the same source. This hangs off a hook and drip feeds water all day to your plants.
Benefits: Cheap (£17), scalable for water output, can give more or less water to different plants
Limitations: Limited to 10.5L so limited number of days it can be used before refill.


2. http://www.verticalveg.org.uk/how-to-make-a-genuinely-self-watering-growing-system/
Link 2 is a very impressive way of watering your plants, and given time and resources infinite, it would be my preferred choice of watering.
Benefits: Allows plants to take what water they need, self-maintaining, no need for pots, can water the garden for a long time
Limitations:
Requires a lot of space, can be difficult to create and maintain, expensive.


Option 4: An Arduino controlled watering system

https://www.youtube.com/watch?v=oOmF2KA9Z0w
An Arduino controlled system would be able to water plants at a specific time, using mathematics to work out how much water a plant needs, based on the type of plant, size of the pot and the current temperature/soil dampness.
Benefits: Scalable, easy to code (if you know how), can be supplied by any water supply, parts are cheap (Arduino costs around £5), can be hidden away
Limitations: Needs a battery (potentially dangerous in a home), hard to code(if you don’t know how), hard to build, can be expensive if you need to buy lots of parts.


This concludes an overview of the options I saw. There were some variations but all used similar techniques which gave it the same benefits and limitations.

Any hints or tips on what I should do? Have you made your own watering System? Let me know in the comments.

A Refreshing problem to have...

So to begin, I'll set the scene.
I was creating a script to test an IIB set up i had/have. I was setting the HTTP port and the SOAP port to use the global listener rather than embedded listeners and also testing a IBM MQ message flow.

After creating the script, I deployed a bar file of three flows; one for a simple request and respond on MQ, one that sends a request to the HTTP port, and a final flow that sends a request for a SOAP wsdl.

Now the bar file deployed and the http request worked fine. Well done me. But upon testing the SOAP request I kept getting the error "The resource does not exist".

The test i was deploying was as such
       "curl -i http://localhost:myPort/mySoapTest?wsdl"
So i tested;

  • The spelling of the command
  • The flow inside the bar file
  • The HTTP command for SOAP
  • That the bar file wasn't corrupt
  • That the execution group was running 
  • The integration server was deployed
  • The same command but at the default port of "7080"
VOILA. It worked. Which suggested the SOAP connector wasn't listening globally (to the broker).
To check i ran;
   "mqsireportroperties myBroker -e IVP -o ExecutionGroup -n soapNodesUseEmbeddedListener"
which returned "false" showing the soap node should be using the global port and not 7080.
To check this I ran the following command.
  "mqsireportproperties myBroker -b httplistener -o HTTPListener -a"
The results showed that HTTP Connector had two connectors. 
One of these connectors suggested that the HTTP port was set to the global port, the other was a SOAP connector and suggested it was still using its default port.

So it would appear, that the two are out of sync and in order to solve this problem, all i needed was a simple "refresh" to make sure all the connectors are up-to-date.

So my advice is this.

refresh MQ Queue Managers and IIB brokers after listener and port changes.*
*maybe after other things too... I'm yet to learn these.