Hi, I have a basic automatic watering project setup using an arduino nano, 12V power source, resistor, relay, water pump, humidity sensor and a BC547. Everything is connected and works, but the sensor reading seems to be affected by the pump running. The reading is correct when the pump is off and way to low when the pump is off.
This can only be observed when the pump is powered directly from the 12V power source. When I power it using the arduino 5V pin, the pump spins slower, but the readings don't seem to be affected. I thought it's better if it's powered separately rather than directly from arduino's 5V.
Here's my setup:
Diode across the relay please.... Inductive kick will end that transistor's life rather speedily.
This question comes up in one form or another almost every day.
Motors always generate electromagnetic interference (EMI) and this gets into the high impedance analogue pins.
I notice your circuit has no decoupling capacitors at all, so start with sprinkling some of those around.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html
I am also not sure why you have a transistor in there. You have a relay so why do you need a transistor.
You should also look into putting appropriately voltage specification capacitors directly across the motor, as well as a reverse biased diode.
Also look to keep physically the wiring of the sensors away from the wiring of the motors.
Don't those relays have flyback diodes already? There are alot of threads saying there's no need for one. I'm using this one:
You never said you were using a specific relay module, So I just assumed the worst.
Thats a 5V, you should NOT have it connected to 12V
Motors always generate electromagnetic interference (EMI) and this gets into the high impedance analogue pins.
Thank you, a lot of info for a newbie, I'll look into it. Single capacitor across the sensor doesn't seem to help though, but at this point I'm not expecting an easy plug-in solution for this issue.
Also if this is caused my EMI, why would it work as expected when powered through arduino's 5V? I'm genuinely curious as I've no idea. Is it because of lower voltage?
You also don't need the BC547
You also don't need the BC547
I know I'm not supposed to follow every random tutorial on the internet, but is this one completely fundamentally wrong then: How to build an automatic watering system for plants using Arduino ?
They say it's a 12V relay but the picture shows a 5V relay.
They don't say which relay or pump to buy.
There are also other things wrong
Did you also see my reply in post 6
Did you also see my reply in post 6
Yes, makes more sense now..
So at this point we don't know if the 5V relay has been damaged or not by applying the 12V.
If it were me, I would buy a new relay.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.