Strange behavior when using Relay X1

I’m using the Relay X1 to control a pneumatic solenoid from a Fez Spider board.

The solenoid runs off of a 12 volt battery and only draws about .3 amps. I have the Fez Spider powered by a USB client DP module.

When the relay is open and the .3 amps are flowing to the solenoid there must be some kind of power drop on the gadgeteer board because the computer beeps like a new USB device is being attached.

If I swap the solenoid out with a light bulb, there is no longer any beeping. I’ve tried this with two X1 modules and I get the same result.

Looks like the spike generated is to high and causing the to reset. Would you be able to send us the solenoid so wet can study this? I think using a cap would help.

Hi there,

Is the beep after you have switched the the relay to the one state? (from you text it would appear to happen as you switch the relay off. Is this the case)

Are you powering the USB DP module from an external power supply? If not, can you try this?

What is the voltage you are switching?


The the beep comes after the relay closes. I guess that means that the USB connection was interrupted when the relay was on, and then the computer recognizes it again once the relay was closed. I’m only switching 12 volts. I could try powering the USB DP module with an external power supply, but I think that might just hide the problem. Whatever is causing the computer to beep through the USB connection is probably having some other effects on the board.

Gus, I think I understand what you are getting at. I imagine that the solenoid has very low resistance initially and thus generates a very short spike in current. The .3amps I measured with my multimeter is the draw when the solenoid is engaged in a steady state.

What address should I send the solenoid to?


Please send it to our address from the contract us page to my attention.

Will do. You’re the only Gus I assume?

To Gus Issa please

It’s very strange that this should happen in the first place.

If the +12V supply is isolated from the USB supply and it can as there is no need to have a common ground in this type of application, then there is no reason for the drop in the supply at the USB DP module.

This sounds very similar to the issue on another thread in relation to the 16 channel board. There the use has a similar issue when switching and external load.

The only real time this would happen is cross coupling via the PCB but I assume that the layout is such that the high voltage contacts are kept clear of the switching side.

I would have suspected the switching current of the relay pulling down the 5V rail but you said it does not do this when switching with a lamp connected. Relays do not take extra current based on the switched voltage or current.

Just out of curiosity, would it be possible to post a schematic of the complete circuit showing each power supply. I know Gus is going to test with the solenoid but I have worked with system using relays to power high current hydraulic valves with none of the issues I am seeing here.

Here’s a photo of the setup. The solenoid is powered by a 12v battery, which is completely independent of the USB power.

The solenoid is wired to the relay such that it is normally off.

I guess the solenoid valve draws a big current spike in the first few milliseconds, which might somehow effect the relay. After that it settles down to a modest .3 amps at 12v.

The diode would only come into play when the relay is switch off. He says the reset occurs as the relay is switched on.

Anyway, there is nothing for the back EMF to dissipate into so you don’t actually need it. Did this all the time with solenoid valves on hydraulic system years ago. Systems are still working to this day with the same relay boards! :slight_smile:

For this issue, it does not make sense anyway as the supplies are isolated. :frowning:

It will be interesting to see what the testing results are after Gus gets a solenoid to test with.

I am very curious as well since relays are isolated so this should not happen.

I don’t believe it has a diode.

Here is a link to the solenoid valve manufacturer:

Nice link Andre.m

That must be some solenoid to be generating those kinds of noise but looks to be an easy fix.

This is also called a snubber but often includes a resistor in series with the capacitor.

jhoge123, can you locate a capacitor and try this?

I came across this in my search for the snubber network.

Something like a 470nF at 50V or higher should do the trick. I would try the resistor in series too. The calculation below shows a 300 ohm resistor.

The 470nF capacitor seems to have done the trick, although my first relay is kaput. I used my second relay and the valve seems to be opening and closing without any noticeable effect on the computer.

That said, I can’t be sure that it’s totally safe on the board. I’ll be eager to see what Gus comes up with.

Could you post a quick pic of what you did? I’m having a ton of problems with the x16 and looking at what others have done.

We received the package. We will look into it in couple days.


Here’s a photo of how I set up the capacitor, basically what was suggested earlier in this thread.

My understanding of the problem is that the magnetic field in the solenoid collapses when current is cut off, and produces a voltage much greater than what was used to excite the field in the first place. From a conservation of energy standpoint it makes sense, the energy in the magnetic field has to go somewhere when the power is cut off.

If the solenoid is wired directly to the relay, This burst of current generated by the collapsing magnetic field seems to arc over the contacts and wander into the Spyder main board and other parts downstream which aren’t too tolerant of voltage spikes.

There seem to be two separate approaches to do a snubber circuit - a diode and a capacitor. I’m not sure how to measure the effectiveness of this approach. The USB port no longer kicks out when the solenoid closes, but I’m still not sure it’s a permanent solution. Maybe the voltage spike is completely contained, maybe it is minimized to the point where it no longer effects the USB connection. Gus from GHI has one of the solenoids and will be posting later on this thread.

Hope the photo helps.

Oops forgot the photo.

1 Like

Photo helps a bunch. We put diodes on ours a long time ago and it took care of most of our issues up until we got a new batch of X16 relay boards. I’d put diodes exactly like you had, but it didn’t seem to make any difference over our diode versions. I hope Gus sees something too.

NXTwoThous, I am putting a film cap, .56uf across a solenoid valve to take care of the inductive load. I am still having problem with the x16 relay board initiailization problem. How did you take care of all the relays turning on at initialization?

I understand that the new firmware (version 11, I am using FEZ Spider, V10.1 now), should have the fixed on the SW side and there still need to be a 1KOhm resistor from pin 1 (5V) to pin 3 of the relay board. Have not try this yet and kind of concern about updating the firmware, after what I have to go through in order to get it working