Reply to topic  [ 4 posts ] 
Sprinkler mover 
Author Message

Joined: Fri Jun 28, 2013 8:20 am
Posts: 6
Real Name: Jim
So my father-in-law has a HUGE lawn, which he likes to keep green. He moves sprinklers around, and it is a major scheduling issue to get the entire thing watered. We designed a system to move a sprinkler across the lawn so it would take less manual attention. It is basically a mini-winch, pegged into the ground at one end of the lawn, with a cord attached to the sprinkler which starts on the other end of the lawn. Every minute or so, the winch turns on for a second or two, drawing it a couple inches across the lawn.

The winch is built from a windshield wiper motor, and the timer is an ATtiny85 connected to an n-type MOSFET.

Here is the schematic:
Image

The program works fine and the prototype works fine. But when I wired up the final project, it has a problem. The ATtiny seems to be resetting at the end of the two second on cycle. I expect this is probably from the back EMF caused by turning off the motor.

My first design had a Schottky diode wired backwards across the source and drain of the MOSFET. However, I took it out because this particular MOSFET is supposed to already have one built in. It's a ON Semiconductor NTD4963N-1G Do I need to put that back in?

I didn't design any decoupling capacitors because I didn't know how, and the prototype didn't need any. I expect this is what will fix the problem, but I'm not sure how this is done. I will probably just try different values until I find one that works, but isn't there a formula or something to determine capacitor value? I know some circuit designs for standalone Arduinos have two decoupling capacitors. One 22pf and one .1uf. Why?


Sat Jul 27, 2013 10:22 am
Profile

Joined: Mon May 13, 2013 5:00 pm
Posts: 21
Real Name: John Hodges
Two armchair thoughts: 1. The reverse diode across the motor is vital, to give the switched motor current somewhere to go instead of making 10~100 volt spikes across the motor inductance, which can kill any controller. It can be cheap silicon, but must handle the full motor current. 2. If you're willing to throw money instead of time at the problem, optical isolation may fix it without having to think much. The $9 version of the Chinese L296H motor driver module includes isolators. If that's too bulky, we could steal his design for using a 25-cent isolator. This approach does require separate supplies.

Did I understand the question? --John Hodges


Sun Jul 28, 2013 10:16 am
Profile

Joined: Wed Mar 07, 2012 10:40 am
Posts: 123
Real Name: Robert
That configuration with two batteries is a good way to do it--but reverse EMF is almost certainly the problem given that the reset happens at the motor turn-off. I'd be looking for motor ground current making its way across any portion of the ground going from the processor battery ground to the processor. I'd also have to look at the specs for the mosfets--bigger mosfets usually require more drive current than a processor can supply (highly capacitive inputs, I usually see a transistor driver to give the necessary current). Sucking a lot of current into/out of a processor can cause internal ground offsets that easily could reset the processor.

Going back to your question, bypass caps supply transient current to a device when the power supply can't provide it (usually because there is enough resistance in the power connections to the device that sudden current demands cause a supply voltage drop or ground voltage rise). You could compute the required capacitor value by specing the current transients of the device and measuring the impedance (resistance is only part of it, you need the impedance to AC currents). Then use the RC circuit to derive the required capacitance to absorb enough of the voltage drop. Nobody actually does that, though--since there's no harm in adding too much bypass capacitance, people just stick on .1uF surface mount caps for every device, physically right across the device power and ground or as close as you can get (if you have to use axial devices, cut the leads as short as possible). Then they put a 20uF or more electrolytic in a few places around the board. I can guarantee if you don't do this you are never going to get very reliable operation, even without motors. Even power plane PC boards can't provide the required instantaneous currents of most ICs.

Bob


Mon Jul 29, 2013 8:26 am
Profile

Joined: Fri Jun 28, 2013 8:20 am
Posts: 6
Real Name: Jim
Thanks for your input. Here is the updated schematic. I added the 5v voltage regulator in order to simplify power supply issues. This way I can use a deep cycle marine battery and it's pretty easy.

Image

Unfortunately I burned out my FET while I was adding the diode. I left the 12 Volt supply hooked up while I unhooked the 5 Volt supply, and I think the gate floated too long and it got way too hot.


Mon Jul 29, 2013 9:07 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software