Arduino reset when DC Motor Start

Hi to All,

I have a Serious Problem, I make this circuit.
My Aim is: the Dc motor Runs still the Proximity Sensor detect anything, after that the dc motor stops for X seconds.

the problem is that some times (not ever, and not at every time) when the DC motor start it immediately stops and restart.

Now I don’t know if:

  1. when the DC motor starts the arduino nano reset;
    or
    2)When the DC motor starts, it causes a lowering of the output voltage from the proximity sensor, and then to the arduino it seems that something has passed in front of the proximity sensor.

This is the circuit.

The code is very very simple, I thing that is a hardware problem, tonight I’ll post the code.

the output current of your power supply is probably insufficent when the motor starts the voltage drops and causes problems with the rest of the system

post your circuit? what is the motor and what is the rating of the power supply?

You forgot to add the circuit.

It's most likely a power issue: either you're powering the motor directly from the Arduino (don't!), or it's surge upon startup is too much for your power supply (get a better one, or at the very least add a large capacitor - try 220-470 uF - across the supply leads to handle this surge).

Sorry, now I have added the circuit.

This is the Motor Datasheet:

Overview JGB37-3530 is a high quality DC gearmotor available in a wide range of configurations, ideal for your particular application.

Specifications Operating voltage: between 6 V and 15 V Nominal voltage: 12 V Free-run speed at 12 V: 20 RPM Free-run current at 12 V: 120 mA Stall current at 12 V: 1.2 A Stall torque at 12 V: >40 kg.cm Gear ratio: 1:506 Reductor size: 29 mm Weight: 200 g

The capacitor is 2200uf 16 volt, (I have tried even with 1000yf 25 volt).

Diode info 20 Diode do41 SR560 5a 60 v

Transistor are TIP 120 ST Transistor Darlington

OP’s circuit:

Vincenzo93:
351427970d4a214affae74d436193b103c632063.jpg

This looks fine. The cap you use should be plenty big enough.

Vincenzo93:
Stall current at 12 V: 1.2 A

This is probably too much for your power supply. Make sure your power supply can handle this as continuous current without dropping voltage.

I would tend to use a good quality 4amp power supply here with some good decoupling capacitors

My Power Supply is a battery 12 volt 7 AMP/H But i tried it even on 12 v 100 Amp but it the seems :(

Amp-hour doesn't say anything on current supply ability of a battery, though most batteries will have no problem supplying 1.2A - especially with this kind of capacity ratings (is it a lead-acid battery?). Such a big cap should handily take care of any ripple that the startup of the motor causes.

Is that transistor wired correctly and of suitable type? If that's done wrong, it could be an over current on the pin that causes the reset.

After a search I choose that trantistor, I have reported data ( It is a tip120 ST) darlington.

Do you thing that It is wrong?

I am not sure that nano Arduino reset when DC MOTOR starts, I thing that It is a lower tension in out out of sensor when starts motor, so Arduino think that anything is passed on sensor and stop motor. ( Beacause It stop motor After low tension on pin D1 and sensor make down the output when anythink is near sensor.

Tonight I'll try to Connect the sensor to Power supply instead of Arduino

Transistor should be of the correct type - it's an NPN at least. The second question was to make sure it's connected correctly (pin 1 - base - to the Arduino; pin 2 - collector - to the motor; pin 3 - emitter - to GND).

A small resistor (250-1000Ω) between base and Arduino is also a good idea to limit current in the pin.

Try to figure out if the Arduino really resets - have it print messages to the Serial console: "switching motor on", then switch on the motor, followed by "motor switched on". If it resets the moment you switch on the motor you see the first, not the second.

Same for reading the sensor. Print the results.

That all gives you a much better feel of what your program really does.

Hi,
You need to wire your motor circuit DIRECTLY to the battery and the Aduino DIRECTLY to the battery as shown.

Put a FUSE in the positive lead to the motor.

Is your motor wiring heavy enough?

Put a 470R resistor in the base circuit as shown.

What is the value of the capacitor?
Catturaedit.jpg

Tom… :slight_smile:

TomGeorge:
Hi,
You need to wire your motor circuit DIRECTLY to the battery and the Aduino DIRECTLY to the battery as shown.

Put a FUSE in the positive lead to the motor.

Is your motor wiring heavy enough?

Put a 470R resistor in the base circuit as shown.

What is the value of the capacitor?
Catturaedit.jpg

Tom… :slight_smile:

first of all thank you all

  1. the battery is a lead-acid battery.

  2. the resistance in the basic circuit is there, but I forgot to draw it in the circuit, I put a resistance of 10 kOhm; as well as the fuse in the positive lead.

  3. the wiring of the engine is powerful enough in my opinion.

  4. For WMARLE you are going to try the serial prints, I have the impression that it does not reset, but simply starting the engine causes the output voltage to be lowered, which is equivalent to passing something in front of the sensor, so a interruption for arduino and it disconnects the power supply to the motor.

  5. what is the different to " wire your motor circuit DIRECTLY to the battery and the Aduino DIRECTLY to the battery as shown" unlike I did.

5)the fact that does not happen every time at the DC MOTOR starts reminds me of a disturbance, more than an error in the circuit, what do you think, can it be noise?
how could you solve it?

Hi, Can you please post a picture of you project showing you battery connections and motor?

If you look at the image I posted of your circuit, I have the power wires for the motor connected directly/straight to the battery terminals. The power supply wires for the Arduino are a separate pair going directly/straight to the battery.

This ensures that there is no motor current in the Arduino power leads.

What is the value of the capacitor and the diode?

As your transistor is a Darlington Pair, I would be using a 1K base resistor, even though 10K is working, that part of the circuit can be susceptible to motor noise.

Thanks Tom.. :)

10k for the resistor is too high, it may work as you're using a darlington transistor, still better to use a lower value and make sure the transistor base is saturated. Saves a lot of heat production in the transistor. Indeed no shared wiring can also help. Less noise on the wires leading to the Arduino.

The print statements should show you clearly if the sensor is triggered. One solution to that may be to ignore short signals from the sensor, or ignore the sensor input for a short time upon starting the motor, even though that shouldn't be necessary in the first place.

Hi, What is your proxy sensor? Is it open collector output?

Tom.. :)

TomGeorge:
Hi,
Can you please post a picture of you project showing you battery connections and motor?

If you look at the image I posted of your circuit, I have the power wires for the motor connected directly/straight to the battery terminals.
The power supply wires for the Arduino are a separate pair going directly/straight to the battery.

This ensures that there is no motor current in the Arduino power leads.

What is the value of the capacitor and the diode?

As your transistor is a Darlington Pair, I would be using a 1K base resistor, even though 10K is working, that part of the circuit can be susceptible to motor noise.

Thanks Tom… :slight_smile:

1)Tonight I’ll post the photo, now I am away from home.

2)The capacitor is 2200uf 16 volt, (I have tried even with 1000uf 25 volt).
Diode is do41 SR560 5A 60 v

3)How I can fix the noise in that part of the circuit?

[/quote]

wvmarle:
10k for the resistor is too high, it may work as you’re using a darlington transistor, still better to use a lower value and make sure the transistor base is saturated. Saves a lot of heat production in the transistor. Indeed no shared wiring can also help. Less noise on the wires leading to the Arduino.

The print statements should show you clearly if the sensor is triggered. One solution to that may be to ignore short signals from the sensor, or ignore the sensor input for a short time upon starting the motor, even though that shouldn’t be necessary in the first place.

  1. What resistor I have to use?

  2. My transisto (TIP120) it’s already a darlington

  3. I would like to avoid delays, or pauses, I am using the sensor as an interrupt.

TomGeorge:
Hi,
What is your proxy sensor?
Is it open collector output?

Tom… :slight_smile:

  1. This is the sensor Robot Smart E18-D80NK

  2. · RED: +5 VDC

· GREEN: Ground

· YELLOW: Output: Open Collector Pulldown: Use 10K Pullup resistor to +5V

  1. Normally the output is 5v, and when it detect something the output becomes 0v.

Hi,
As per the diagram below from the manual for the proxy, it needs a pull up resistor because it is Open Collector.
A 4K7 resistor from it s output to 5V, or turn the pullup resistor ON in the Arduino, using software command.
sensorProxy.jpg

Tom… :slight_smile:

SHT-015d.pdf (175 KB)

Vincenzo93: 1) What resistor I have to use?

Did you actually read the replies from TomGeorge (#11) and myself (#10)?!

3) I would like to avoid delays, or pauses, I am using the sensor as an interrupt.

When I said "a short time" I really meant that. 100-200 ms or so, and only upon startup of the motor. Using an interrupt is also not necessary for this - unless you really need a reaction time better than a microsecond, which is many orders of magnitude faster than your motor can ever react. Polling the pin will be good enough.

Indeed using an open collector output without pull-up resistor is asking for problems...

TomGeorge:
Hi,
As per the diagram below from the manual for the proxy, it needs a pull up resistor because it is Open Collector.
A 4K7 resistor from it s output to 5V, or turn the pullup resistor ON in the Arduino, using software command.
sensorProxy.jpg

Tom… :slight_smile:

The sensor alone works well without the resistor, arduino receives all the interruptions, I do not think it is a problem related to the sensor itself, perhaps an interference.

tonight I try with an open collector output resistor.

wvmarle:
Did you actually read the replies from TomGeorge (#11) and myself (#10)?!

Tonight I try to connect a 470R resistor

Thank you All.