One of my ‘to-do’ projects is an automated plant/garden watering system for those times when we’re away from the house on holiday for a week or longer. Previously, I’ve placed my chilli plants and bonsai tree in the bath with an inch of water to allow the plants to soak up the water. This isn’t be best way to do this and can cause the roots of the plants to become saturated which is worse for them than a brief cycle of under-watering. OK, enough background; let’s move on.
This article won’t design the entire system; this article is to provide information and the knowledge required to interface to inductive loads – relays, pumps, solenoids etc.. As I’ve previously posted, an arduino cannot sink the current requirements of an inductive load so an interface is required to switch the current through the load.
First steps:
Find out how much current your load requires. This can be easily found from the data sheet by reading it! If you don’t have the datasheet, then you’ll need to power the load with a PSU and measure the current flowing through it with a multimeter to understand the loads requirements. I’ll show you how I did this with a relay and a water pump.
Connecting a multimeter set to amps in series with the positive end of the power supply and positive end of the pump with a clamp diode to reduce the effects of induced current when the power is switched off the meter showed the pump drawing 0.35A, 350mA of current while pumping the water. Great. Knowing the load current is much higher than the 20mA the arduino can sink from one of the digital outputs I know I need an transistor that can handle at least 350mA of collector current. Having a look through the data sheets on the transistors I have in my component box I discounted my ZTX108s, 2N2222, BC109,2N3415 and had a choice of BFY51, BC639 and TIP142L.
I (initially) decided to use the BFY51 as it can cope with the demands. It didn’t quite work out in practice as it told me in would in theory! Keep reading 🙂
No collector resistor is required as the pump’s inductor puts up a DC resistance. So referring to our base resistor calculator we know that to ensure the transistor is saturated Rb=((Vswitch-Vbe)/Ic)*hfe(min) for the BFY51 this gives 368.57Ω so use 330Ω as the nearest preferred value. I wired the circuit and it worked, but not quite as expected the transistor was getting really quite hot after a few seconds – I checked the wiring again it was all fine so what was going on? measuring the collector emitter voltage it was showing nearly 6V! in saturation it should be about 0.2V. This is where all the heat was coming from the transitor was on,working in its liner mode but not saturated. I tried another BFY51 as they were manufactured in 1982 and have been reused in various projects. Same effect – weird. Next step I checked the input circuit and there was the problem. I was using a 6V battery and it was on its way out – under load it was reading 3.2v so the base current was enough to turn the transistor on but not enough to force it towards saturation. Once the battery was replaced all was perfect – a nice cool transistor and a fully operational pump! Placing the meter in series with the supply and pump 0.35A flowing! Perfect! stage one complete.
One response to “Interfacing medium-power loads with an arduino”