Thursday, April 23, 2015

Well volume measurement - Theory (Part I)

Hi there! My post today is more theory than practice, but this is also needed.
When I thought of making a weather station, one of the items I wanted to acquire is the well water volume that I have, this way I can study the water dynamics and learn something about it and its use.
To do it there are mostly 3 ways:
- Ultra-sound device pointing to the water, acquiring the water level.
- Pressure measurement device on the bottom of the well, enclosed in a waterproof box with some membrane allowing the inside of the camera to increase/decrease pressure, measuring the water weight.
- Pressure measurement device on top of the well, enclosed in a tube, filled with the corresponding water level, measuring the water column.
Knowing the depth of the well and the diameter of the rings we can calculate the volume of water using the formula:
V = π radius2 height

The first option is expensive regarding good waterproof ultra-sound sensors, the second has the water-proof design flaw, which is difficult do go around, so I aimed for the third option, which uses a physical principle that can be consulted here and here.
Basically it's something like:
A sense tube is connected to the pressure sensor which resides on top of the water column. The tube goes all the way down to the bottom with an opening near the down end, forcing water to go into the tube. When the liquid fills the well, it also fills the tube till the same height. The trapped air in the tube is compressed, being measured by the sensor on the top of the column. The increase in pressure is proportional to the depth.
Regarding my case, and taking consideration of this: 0.1 meter H2O (conventional) = 98.0665 pascal, and knowing that I have a 7.8 meters depth well, a totally full well would return 7649.187 pascal, an empty one would return something like ambient pressure (on top of the well) minus 7.8 meters depth (easy huh?). The mentioned value allows us the use of a 0.1 meter resolution (used as resolution base value) which means an amount of about 31,4 litters up or down.

Wednesday, April 8, 2015

Agentuino

Quite a while ago I bought an ethernet shield for my arduino, and since then I wanted to use it on my weather station. You may ask why, first it has an integrated microSD shield, and secondly you can use it by issuing SNMP commands to set/get variables and create, afterwards, RRD graphics. The complicated part was to get a compliant library to manage decently the SNMP commands, I didn't find what I wanted, so... I changed the source code to make it happen!
I used the agentuino library, lots of info here: agentuino
The changes I made will not work with the "old" Agentuino.h, as it is incapable of dealing with FLOAT and to set values other than strings, so, you can use my changed library, replacing the old Agentuino.h file with this one. Using it you can manage to do some simple testing like setting an LED on/off, or even fading it (if using a PWM port) this simple examples can be taken to other levels, and you may use your network connection to automatically or manually setting the house-lighting on/off or fade it, start/stop the loan watering (it can be automatic using a crontab command, for instance) among other things you may remember may be useful.
The code I developed is available here and I called it weatherduino because it's intended to be used in the weather station, but you can call it whatever you like and use it freely as long as you link the original work to this page. At the time I'm expanding it to support the arduino MEGA.

Sun tracker - part I

A couple of weeks ago I got some new (used) batteries for my solar station, as you can see on the picture on the right. If they were new, I'd have something like 36 Ah, but they where on heavy duty, so I'll be happy with a humble 20 Ah. Nevertheless it came to me that if my solar panel was equipped with a solar tracker I'd increase the power production in something like 20/40% , having a more profitable battery bank. FYI the most important tracker is the E-W axis, the N-S can be almost neglected and it'll be suffice having an arm setting position for Summer, Autumn/Spring and Winter times.
For the tracker motor control I bought a couple of H-bridges, in this case the L293D, described in the bottom picture:
The chip deals with 600mA max current, tolerates peaks of 1.2A. It uses 5V for regular working, except for pin 8 which should feed the needed motor voltage (in this case I'll use 12V), needless to say that the GND pin from the 12V power-source should be connected to the GND pin of the 5V power-source.  I must say that the electronics part is quite easy to achieve, the difficult part is to manage to create a cheap and robust mechanical system, I disassembled an old HP deskjet printer and used the tray motor, it uses 19V nominal, 24V max, quite good to use in this project with 12V, it drains only 150mA of current (I measured 200mA, 400/450mA if holding the wheel). I'm now assembling it and will have pictures soon! The electronics and programming will be showed up also at that time.
The L293D truth table:

Weather Station - part I, sensor shield

Hi! I've been away for some time, but still doing things, just not publishing them as regularly as I would like to...
Well, but getting back to work , using some vase plates, of good plastic (they do not break when drilled) I managed to create a sensor shield, using 7 small plates, 2 bigger plates, 3 spacers like the ones on the right image and 3 screwed bars of 15 cm each. Drilled a big hole in the middle for a plastic tube on 6 of the small plates, leaving the big ones untouched  and on of the small ones. The objective is to create an insulated, rain free area inside the plates.
So, I have plastic plates, which the sun will possibly warm up during summer, but they are spaced allowing the air to flow and the sensors are inside an acrylic tube which is made of a rather different material preventing the warming up/cooling of the inside, hence, better isolation.
You can see on the left an almost finished view with a large plate, some small plates, a spacer and the acrylic tube. The finished piece is downside. It'll be painted on a more neutral color, like white or pale grey (I have a bottle of paint spray with this color, so why not use it? :D ).
The next step is to seal the upper and bottom holes with mosquito net, to assure I don't get unwanted guests inside, and then I'll wire cable from the arduino Mega box (possibly CAT5e which I have lots of spare meters) to connect the 2 (planned) sensors inside, a BMP085 barometric pressure and a HIH-4030 humidity/temperature sensor.
Afterwards I'll need another shield like this one for the luminosity sensor (hasn't arrived yet). A piezo will also be used to detect the rain intensity. The wind vane and anemometer will use a different housing.

Cheers!