Background:
My friend and I have wanted to make a robot car that can go forwards or backwards with its left side, right side, both at the same time or stop completely.
Initially we were going to use three made to order "2 Channel 5V Relay Module". These were bulky so we decided to make our own by following diagrams shown here; Motors 1 (Specifically the very bottom diagram).
Our build:
We created two identical modules as can be seen in the image attachment "Picture 1". The attachment shows one of the modules which would control either the left or right motors.
The design relies on two arduino output pins giving instruction on whether the side the module is controlling should go forwards or backwards (input 1) or not receive power at all and therefore stop (input 2).
Problem:
This design only seems to be working sporadically, sometimes it will work for a long time, other times it won't start at all. Once it has stopped working it won't start until you reconnect the motors or power supply.
What have we tried?:
Re soldering in case there were loose wires
Connecting the motors to each of the separate points of the module to check behaviour is correct i.e. motors start, motors don't start.
fully charging the batteries!
Any ideas on what could be the problem? We're both fairly new to electrics.
This design only seems to be working sporadically, sometimes it will work for a long time, other times it won't start at all. Once it has stopped working it won't start until you reconnect the motors or power suppyl
Sounds like Electromagnetic Interference is causing the Arduino to hang.
Your relays are not optoisolated so there is increased chance of interference.
But you have a lot of power being switched. Do you have an transient suppression on the motors? Probably creating big pulse whenever you switch one off.
And where is "ground" . Should be a common point at the - connection of your battery, with separate ground wires from Arduino, motors, relays etc.
If your motor voltage is 13.5V or less, I would connect one of these directly across the motor power terminals.
As a second choice, could try a 1µF capacitor in series with 22Ω to 47Ω connected directly across the motor power terminals.
These are Reed Relays and they have a maximum contact rating of 1A according to the spec sheet. If your motor is drawing ~750ma or more your going to have contact arcing and these relays just won't last. Secondly I don't see any coil suppression diodes on each relay. This can cause the Arduino to act up, false trigger and possibly even damage the output pins driving them. I'm assuming your driving them directly from the Arduino outputs but coil suppression diodes should be used even when driving them with external transistors or FETs.
Consider using some of the many motor driver boards that are available for the Arduino. You will have much more control and less problems plus many of them are really cost effective.
Hi,
The relays have the protection diode built in so polarity of the relay coil has to be considered.
If the relays work initially then polarity must be right.
I agree about arcing contacts and motor suppression.
The contact s are probably welding together.