Arduino Motor + Sensor Shield

Hey.. i’m making arduino shield to run 2 dc motors and read 4 hall sensors… code ok on breadboard but when both motors move at high speed, sensors sometimes give wrong reading… added 100nF caps near sensors, still happen… maybe interference??

Want to make PCB… how to separate motor traces from logic.. where to place caps? should sensors near arduino or near motors? also ground plane.. any tips for motor shield pcb?
 
Yeah the wrong sensor readings are likely coz of the interference from the motors ..... especially when running at high speed. Even with 100 nF caps .... breadboards can’t isolate noise well. On the PCB, keep motor power traces thick and separate from sensor and Arduino logic traces. Place 0.1uF decoupling caps close to each sensor Vcc pin, and if needed a small 10uF near the Arduino Vcc .... read this gude on decopling caps: https://learn.sparkfun.com/tutorials/capacitors/application-examples

Use a solid ground plane for Arduino .... and ideally route motor return currents directly to the motor power ground rather than through the logic ground .... think star grounding ..... read thi guide to understand planes: https://www.pcbway.com/blog/PCB_Des...gn_Considerations_in_PCB_Layout_862aaa8c.html
 
So the sensor glitches are mostly from motor noise and power coupling.

For PCB, do you usually place the sensors closer to the Arduino or closer to the motors, assuming the wires can be short?

And for star grounding, should I tie the motor ground to logic ground at a single point near the Arduino or near the motor drivers?
 
Sensors should be placed close to motors .... to get accurate measures ..... but keep the traces or wires short and routed away from high-current motor lines.
For star grounding, it’s usually best to tie the motor ground to the logic ground at a single point near the motor drivers .... that way high current return doesn’t flow through Arduino or sensor ground and reduce noise coupling.
 
How the Arduino reads the sensors could be the issue, with limited processing they may not be being read often enough. I would test to see what frequency the sensor can produce before the Arduino starts dropping data. Then make sure the system never runs more than about 75% of that frequency.
 
Hey.. i’m making arduino shield to run 2 dc motors and read 4 hall sensors… code ok on breadboard but when both motors move at high speed, sensors sometimes give wrong reading… added 100nF caps near sensors, still happen… maybe interference??

Want to make PCB… how to separate motor traces from logic.. where to place caps? should sensors near arduino or near motors? also ground plane.. any tips for motor shield pcb?
Yeah, that’s almost definitely motor noise messing with your sensor signals, especially at high speed PWM.

For the PCB:

  • Keep motor section and sensor/Arduino section physically separated
  • Use a solid ground plane, but make sure motor current doesn’t share thin ground paths with sensors (star grounding helps a lot)
  • Put 100nF caps right at each sensor and also a bulk cap near motor power input (100–470µF)
  • Add 100nF directly across each motor terminal to reduce noise at the source
  • Keep sensor traces short and away from motor traces/wires

In short: separate power/noisy side from logic side, and clean up noise at the motors themselves.
 
Top