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)
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.
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)
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 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?
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.
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