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.
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?
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.
What resistor I have to use?
My transisto (TIP120) it’s already a darlington
I would like to avoid delays, or pauses, I am using the sensor as an interrupt.
What is your proxy sensor?
Is it open collector output?
This is the sensor Robot Smart E18-D80NK
· RED: +5 VDC
· GREEN: Ground
· YELLOW: Output: Open Collector Pulldown: Use 10K Pullup resistor to +5V
- Normally the output is 5v, and when it detect something the output becomes 0v.