Hello everyone
As I am new to Arduino and electronics
Need some help from experts here
I've connected a 12v relay to Arduino
With bc547 and a 10k resistor
To turn on and off a 12v motor
From signal of a ir sensor
Everything works fine when motor is NOT connected to system but after connecting motor relay keeps itself on after given delay of 1000ms
Motor keeps spinning
I've added freewheeling diode for relay and motor
Also added .1uf cap to both
But still it runs automatically
Motor
1.5 amps on peak and 1.2Amps for normal rotation
Both Arduino and motor runs on a same power supply of 12v 2 amps
Rather than posting pictures of your screen, it would be better to post the actual graphic so people can view it properly!
Unfortunately, the problem is all about how your actual wiring is laid out. All the connections to your motor need to be paired - active and return in a single cable or bundle. And kept entirely separate from any of the logic circuitry. These connections must come directly from the output reservoir/ decoupling capacitor at the very 12 V supply output.
That is to prevent switching impulses being radiated from the motor wiring. But the same applies to all the logic wiring - power and ground must travel from one part to another together, and signal and corresponding ground must also always travel together in order not to pick up such impulses.