Showing posts with label DIY. Show all posts
Showing posts with label DIY. Show all posts

Friday, January 2, 2015

The TIP120 Arduino shield

  This article is about a homemade Arduino shield, using a TIP120. The TIP120 is a darlington transistor that works as an electronic switch, it can handle large power, such as 60 Volt, 5 Amp (for high power you should use an aluminum cooler). This approach has some advantages over a relay circuit, and some disadvantages too, as you all can imagine, one of the disadvantages is the use of 110/220V circuitry as the TIP only works with 60V, on the other hand you can use PWM on it, it is faster than a mechanic switch as the relay and I imagine it consumes lower power on switching than the relay.
I used the circuit on the right (which I found somewhere over the internet) to build a schematic as you can see on the image at the
right to build afterwards an Arduino shield.


At the top of the image we see the TIP and the Arduino connection, the Arduino signal (that can be a regular digital output with an on/off behavior, or a PWM digital output to provide dimming on a lamp/LED or motor) and the GND provided by the Arduino board. On the lower end of the schematic we have 2 board connectors, one for connecting the load with the polarity showed (the polarity is only important on devices which have one, in case of a DC motor the TIP is protected by a diode 1N4007 or similar) and the other to connect the power. The 1 k Ohm resistor should be replaced by a 4k7 because of ground fluctuations.
The final result can be seen in the pictures.



NOTE: Has been registered a situation where the input control pin had a fluctuating voltage and the load and power were connected leading the TIP to a ON false situation, a workaround could be increase the resistor value or ground the control pin. Not tested yet.


Monday, July 1, 2013

Soil moist monitor/manager and logger!

The 'what if' problem...
This project started with a LED, a moist probe and an arduino. Then I thought "what if" adding another probe? After that, "what if" adding an SD shield to log the values? 
When done, "what if"... You understand what I mean, I'm sure. 


So this ended up in a complex system as described:


- 3 Moisture probes, (max) which can be grounded (with a jumper or so) this way you can use from 1 to 3 probes as you need them. (as the one you can see in the picture)

- 3 Solenoid outputs, which will set up the watering of each probe plant (solenoid 1 will open if soil moisture probe 1 alerts for a thirsty plant.)
- 1 Digital thermometer, to log temperature.
- 1 LED.
- 1 Press button.
- 1 RTC (pointless to have a logger without date/time).
- 1 SD shield and card to retain system data.
- 1 arduino board or a DIY arduino board.
My self made board design can be viewed in the picture:
 Now, the most important, how does all this works?
You use as many probes as you want, with a maximum of 3, and connect all the devices, the system boots up, and the led will give you information about the moist:
- 2 blinks - too wet... :(
- 1 blink - GREAT! 
- Fading - too dry.

In the last state, the output pin for the solenoid will turn HIGH and open a TIP120 or a relay circuit (not done yet) to open the solenoid and then water the plant.
The time of each reading is 15 minutes, which changes to 2 minutes when a plant is dry and the solenoid opens, to assure a more accurate watering.
There is also a press button for knowing the water needs at any time, once pressed, 1 second or so later the LED gives you the information needed, not written to console nor SD card.
The logger has a format like this:

Initializing SD card... Warming up!! Starting!!!
Date    Time    Temperature    Pb1    Pb2    Pb3    V1    V2    V3    Ws1    Ws2    Ws3
2013-07-01    20:41:59    24.50    81.64    76.27    76.56     4.08     3.81     3.83    0    0    0   

 
It can be worked out in a spreadsheet or any program that deals with this kind of data, (separated by tabs). A file is created EACH month with a name like "201306.csv" which stands for the year and the month. V1, 2 and 3 are the voltage values read by arduino and Ws1, 2 and 3 are the watering status, a boolean value which is 0 or 1 depending of the watering status, 1 when watering.
I hope You enjoy this, (as I wrote, I have many flavors of this, with several combinations) now go monitor your plants, mine have never been so pretty since I started this, and though I don't have the solenoids working, the LED indications are usefull enough to get them awesome!
The code.The prototype configuration on the picture:
Used this SD library and this RTC library.      

Wednesday, May 8, 2013

RTC shield, I²C, Arduino compatible, DIY

Hi! I'm back, again with arduino and a new shield, once more a DIY shield. 
So, let's start! The picture on the right is the circuit used to build the shield (I want to thank my friend Nuno Portela, who grabed this, and converted to eagle schematic, printing and driling the circuit afterwards).
The schematic on the left is the proposed circuit, which was then printed. All the components are easy to find, so the final result is almost inexpensive.
I've attached also a picture of the final result, 2 boards with cr2032 button cells. 
Concerning the code, I couldn't find where I got mine, so I'm posting it here.
Enjoy!