Power Stability or Issue with USB devices

I am currently working on a project that is using an Arduino UNO, a MCP4131 digital potentiometer, 8 channel relay board, the USB Host shield form Circuit@home and the Xbox 360 wireless receiver. Everything seems to work ok, however when I play with turning relays on and off the usb receiver has a tendency to turn off\disconnect.

The power is supplied to the Uno via the barrel connector from a 12v to 9 volt buck converter.

The digital pot is using minimal power and I am only using 5 relays and the relay board is optically isolated using a 12v power source. 20ma + (5 * 30ma) = 170 ma at any given time. Just an estimate. From what I can tell the wireless xbox receiver uses approx. 200ma.

My guess is that I am drawing too much current or the power is spiking\dipping when I activate\deactivate some of those relays, causing the usb receiver to disconnect. If I turn on relays one at a time it usually works with out issues, and if I play with turning on and off multiple relays at a time it can still stay connected sometimes. Am I right in assuming it is a power issue? I need to unplug the receiver or do a reset to get it to connect again.

If its a power issue, is there an easy way to boost power to the usb shield. I looked at powered usb hubs, but I couldn't find any that would work off the 9v from the converter. Could I take a voltage regulator on the VIN pin and add it to the USB line or a usb powered hub? I am more of a coder than a hardware guy, but I'm new to both so any help is appreciated. (Everyone starts somewhere lol)

http://www.ebay.com/itm/8-Channel-12V-Relay-Shield-Module-For-Arduino-UNO-2560-1280-ARM-PIC-AVR-STM32-/321355696979

How are you isolating the relay board and arduino? What is the current rating of your ac adapter? What devices are you switching on and off and how much current do they need?

I have two 12v batteries. they are wired in series to power a motor control and a servo. Off of one battery I am pulling 12v to power some LEDs, the relay board mentioned above, and the 12 to 9v converter that powers the Uno. The Uno then powers the digital pot, triggers the relay board, and the USB Host shield which in turn powers the wireless controller receiver.

They all share a common ground of the 12v.

I posted a link for the relay board above. It has a 12v in and ground for the relays them selves and has opto-isolators that are powered by the 5v and digital pins as grounds from the Uno. The relay board seems to work flawlessly, it is only the controller receiver that disconencts\powers down when relays are activating or deactivating, but it doesnt always disconnect when relays turn on or off, probably 50% of the time.

It sounds to me like there is a lack of power supply decoupling in the system. Especially around the motor. What decoupling have you got on the motor?

The motors are powered via a Scooter controller which uses24v from the two batteries.

The motor leads come from the scooter and run into a DPDT relay to add a brake (a resistor to short the motors) and from there go to another DPDT relay that allows forward and reverse capability. Then 2 540 size motors are wire in parallel. The brake and forward\reverse relay are powered by the same 12v source as the uno\relay board and are activated by relays on the relay board.

In short:
24v system (Scooter controller > brake relay > Forward\rev relay > motors) and servo

12v System Relay board and 12v to 9v converter ( which powers uno, host shield, digital pot, receiver)

Scooter Controller: 24 Volt 500 Watt Controller (Model: YK31C)

Why not answer the question I asked?

I'm not exactly sure what you are referring to. So I gave you all the information I have on the motors. Although,I'm not sure why they are relevant when the issue is a usb wireless gamepad receiver shutting down\disconnecting which is on the host shield. The uno itself and the relays still work fine when the receiver disconnects, as part of a safety protocol I have the relays do a predetermined state when the receiver gets disconnected.

I'm not exactly sure what you are referring to

Grumpy_Mike:
What decoupling have you got on the motor?

Do you not understand what decoupling means? If not google it. It sounds like you don't have any and that can cause you exactly this sort of problem.

I did some research and some messing around with the project. It sounds like that might be the issue, but I'm not sure where to place the cap.

I disconnected the motors and motor controller and I still get issues when activating\deactivating relays semi-quickly. (When switching a relay it involves switching a relay on a 8 channel board, which in turn activates a larger relay). In my test, it is the larger relay switching that causes the issue. The larger relays are on the same 12v circuit as everything else.

Should the cap go by the larger relays? Or by the component that is having issues, in this case the usb wireless receiver on the usb host shield? How large of a cap and how many?

Do all the relays have fly back diodes on them? If not then fit them first.

It is always better to remove any interference at source than trying to reduce the effects on other systems.

How many? As many as it takes. Try one on each relay.
What value? Try 0.1uF ceramic, don't uses any othe sort of cap, it will not work.

Ok thanks.

I'm not sure if they have diodes, I can't find anything online for the relays. I'd hope they do, but with out ripping one out of its casing I'm not sure how to check. the only wiring diagram I found doesn't specify one specifically though. They are JQX-12F 2Z Thats what I get for ordering from Amazon I guess.

I'll add some caps to the motors as well, just for extra precaution.

Those do not contain a diode; most relays do not have one internally. It will be listed on the datasheet clearly if they do.

I'd also put a larger cap in for good measure, to help stabilize the power supply.

Just to verify.....

0.1uF ceramic caps to put on the motors.

For the relays, the coil specs are 120 Ohms @ 12 volts. That equals about .1A. A 1N4001 diode should work right? For a capacitor I should add one if I'm still having issues? Would the same 0.1uF ceramic work?

Wiring the diode and cap I would just connect both to each end of the coil contacts, not in series, correct? Sorry, like I said this type of hardware is brand new to me.

Diode Specs:
Vf - Forward Voltage: 1.1 V
Vr - Reverse Voltage: 50 V
If - Forward Current: 1 A
Max Surge Current: 30 A
Ir - Reverse Current: 5 uA

I would try a 10uF, not 0.1uF capacitor. If the 1N4001 burns up, get a higher-current rated one :slight_smile:

For the relays, the coil specs are 120 Ohms @ 12 volts. That equals about .1A. A 1N4001 diode should work right?

Yes.
The 0.1uF caps go on the motors which also should have diodes across them. See the attached.

solder_caps.pdf (299 KB)