terça-feira, 14 de setembro de 2010

Arduignon: Sources...

First source of all. How to connect a LM35 temperature sensor to the Arduino. This includes the sketch for the microcontroller and the sketch for Processing to display a nice graph. I used this with some modifications. Thanks to the author!

http://pscmpf.blogspot.com/2008/12/arduino-lm35-sensor.html

This is how to connect a LCD to Arduino using only two wires, saving outputs for other purposes:

http://www.scienceprog.com/interfacing-lcd-to-atmega-using-two-wires/

segunda-feira, 13 de setembro de 2010

Arduignon: some pictures...

This picture was taken during a test with a LCD display. I was testing the program, the display shows the temperature and the humidity in the first row. In the second row are some values I needed for the calculating of the relative humidity. At that moment it wasn't working correctly, I made some mistakes, but I was happy to make the LCD to work correctly.





Then I tried another LCD, modified the program, correcting my errors and started the tests with the icebox...











This is the relay card being tested. I could make it with 8 relays, but 4 is enough for this project for now. This was made with a shift register. The relay driver is very simple, only one transistor, one resistor and one diode per output. I connected a heating element (just a Ni-Cr wire) and a peltier element to simulate a heater and an air-conditioner, so I can control the temperature. Humidity is controlled by turning both heating and cooling on at the same time. Water starts to condense on the peltier element and humidity is reduced.

This graph was made with Processing after I corrected the calculation. It now includes the dewpoint. At the right side it shows the exact moment when I switched the drying process off, humidity instantly started to rise. To create a very humid ambient I dropped some water in the icebox, then just turned the heater on. To control humidity by turning heating and cooling on at the same time the program included a temperature setpoint to keep temperature at a maximum level. Building the circuit was the easy part, programming was hell! Although the program is simple at first sight, I had a hard time (and a long one) getting it to work correctly. And it isn't complete yet! This first version only works as a thermo-higrostat, there are lots of function to implement and the circuit lacks a real time clock too.

Arduignon: temperature ok, but humidity?

So I can measure temperature... Great deal, this is described a hundred times over the web, I need also humidity. There are several humidity sensors around, but most of them are capacitive or resistive types. This kind of sensors are fine, but they have some problems. Resistive sensors need an alternate current to work, capacitive sensors fail when condensation occurs (resistive sensors also), I also couldn't find a reseller in Brazil, so I decided to use two temperature sensors in a psichrometric configuration. One sensor is wetted and both are maintained in a constant airflow. The evaporation occurring on the wetted sensor lowers the temperature and this can be used along with the dry sensor temperature to calculate the relative humidity.
This calculus also needs some other parameters like air pressure, but this is of little impact on the overall result so a fixed value according to the altitude should do... In the future I will try to include a barometric sensor.
Years ago I made some tests using this to make a higrostat and it worked fine and so it did with the Arduino. My first attempt with the Arduino gave me precise readings, but way too sensitive to little temperature variations and electromagnetic interferences. I solved this by using decoupling capacitors and some programming tricks.
After testing this configuration for several weeks, I concluded it is the best solution for my needs. It depends only on one kind of sensor, gives me temperature, humidity and dewpoint readings, and is very precise. Now I'm working on a prototype to test this in the real world. It has a LCD, three buttons to adjust the parameters, four high-power relay outputs and communicates with the computer, all in one! In the next postings I'll describe the circuit, some aspects of the Arduino programming and the use of Processing, I will put some pictures and graphs I've got simulating a cultivation room using an icebox, a heater and peltier elements. I also will describe ideas in controlling temperature vs humidity, a tricky task when it comes to get the perfect ambient for your mushrooms...

My first project: Arduignon

I've been working for some years with mushroom growing, and always had the wish to control the climate with a computer. I built some circuits using ADCs but they were not what I wanted. Then I discovered Arduino, and started to wonder how to use it for this purpose. I kept on surfing the web looking about this and for my surprise there was an instructable with exactly what I was intending to build:
http://www.instructables.com/id/Environmental-Mushroom-Control-Arduino-Powered/
GREAT! Or maybe not... I was hoping to be the first one to develop it... ;) Just kidding! I really liked this project, it includes temperature, humidity and CO2 readings! WOW!
Well, if someone did it, why wouldn't I get my own project to work? And so it started...
I bought two Freeduinos (why? later Iĺl tell about this) and started by testing the "Hello world!" routine. Hey, it worked!
Next I connected a LM35 temperature sensor and... VOILÁ, it worked too! I can measure temperatures, I can RULE THE WORLD! BWAHAHAHAHAHAHA!
The first step was done, there's no return now!

Starting!

First of all, install linux on your computer!!! Ubuntu is great! It's stable, easy and full of features.
Then go to

http://www.arduino.cc/playground/Linux/Ubuntu

and follow the instructions to install the software for your Arduino.
After all done you'll have everything needed to start your projects!