I am building a BLE Motor Controller Circuit and I have some problem with connection dropout when switching the relay.

Here is the relay circuit

enter image description here

This is the active high circuit.

This is the relays block. If I connected the board without hooking up the motor, the relay can toggle just fine without any issue. However, when the motor was present, there was a problem with connection drop-out.

My initial inspection was that when the relay under load, switching the relay had a ~200ms delay, it might have built up charges on the Anode side of diode D1 and D2 so when the coil engaged and released, it spiked and pushed a large amount of voltage return to 5VDC rail. The 5VDC rail is connected to 3.3 LDO, so I think it caused disturbance to the MCU, and Oscillators, those are sensitive so it dropped the RF connection. Question is, wouldn't the LDO suppose to isolate the input voltage so the 3.3VDC is stable?

Propose fix:

  1. I am thinking of instead of connecting the Cathod side of D1 and D2 to 5VDC rail, I will connect it to the 180VDC rail. so it won't cause any disturbance on the 5VDC rail. Do you think it would work?

  2. Move 5VDC to the emitter and ground to the collector of Q1 and Q2, so diodes D1 and D2 would suppress spikes to ground?

Please advice me what is the good way to solve this issue.


  • \$\begingroup\$ "it spiked and pushed a large amount of voltage return to 5VDC rail", I'm afraid this is wrong. The purpose of those diodes is to suppress the spike. \$\endgroup\$
    – Long Pham
    Commented Jun 12, 2018 at 14:52
  • \$\begingroup\$ Try some decoupling capacitors. \$\endgroup\$
    – Long Pham
    Commented Jun 12, 2018 at 14:58
  • 1
    \$\begingroup\$ Erk. If the 5V and 3.3V are connected, then presumably the grounds are connected. If that is also connnected to the motor griund, then you will get a lot of garbage bouncing back at your controller. You need to use those optocouplers as they are meant - to isolate both sides. No ground and no power connection in common. \$\endgroup\$
    – JRE
    Commented Jun 12, 2018 at 14:58
  • 2
    \$\begingroup\$ You state that you can run the system fine, relays & all, as long as the motor is not connected. So your problem is not with the relays, it's with the motor. Is your 180V supply's ground connected to your 3.3V/5V ground? Do you have any 250Vdc rated capacitors you could use to try to filter noise generated by the motor? \$\endgroup\$
    – brhans
    Commented Jun 12, 2018 at 15:27
  • \$\begingroup\$ @JRE I wish I learned this sooner... I just fried the board AND the computer. Thanks! I will make the suggestion fix. \$\endgroup\$
    – AlexT
    Commented Jun 12, 2018 at 18:05

1 Answer 1


From the comments, I gather I hit the right spot.

The problem lies in having a common ground between the contoller and the motors.

The idea behind optocouplers is to be able to send control signals with out the noise of the high power device causing problems to the controller.

What's happening is that switching the motor causes voltage surges on the ground. Given that you are using 180VDC, those surges can be pretty large. Switching motors can cause problems even at lower voltages (the spikes can easily be many times the supply voltage.) Since you are using such a high voltage, I would assume thhe motor is large - the larger the motor, the more energy it will store, and the more powerful the spikes will be.

  1. Power the controller from its own 3.3V power supply.

  2. Use the optocouplers to transmit the control signals to the motor.

  3. Separate the motor ground from the controller ground.

That should improve things greatly.

  • \$\begingroup\$ Hey, Thank you so much for helping me out. I have another related question too. Is it possible to connect the GND of 180VDC to earth GND of 110VAC input side? The capacitor on 180VDC is quite large, 1000uF and it would be dangerous if there is no place for discharging the Cap. Thanks again! \$\endgroup\$
    – AlexT
    Commented Jun 12, 2018 at 18:42
  • \$\begingroup\$ That is a seperate question, and one I don't think I'm up to answering. That's more to do with safety and regulations. \$\endgroup\$
    – JRE
    Commented Jun 12, 2018 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.