Relay Problem

I’m so very close to finishing a project and now I’m having a problem I can’t figure out. It’s probably something stupid because it works sometimes and sometimes it doesn’t (most of the time). The problem is that once I bring D9 high and the relay is switched once D9 is brought back low the relay does not turn off. I know that D9 is doing what it’s supposed to because the green LED shows it’s state. Does anyone spot anything in my wiring that could be causing this behavior?

Anyone want to guess what this is???

If you disconnect the solenoid, ie the load, does that change the behavior? Perhaps the non-repeatability you’re seeing is because the current draw through the relay is too great, and it’s not breaking the contact (I’ve seen that as a “design criteria” for relays, otherwise I am talking out my a$$)

Check the voltage across the coil of the relay in On-State and Off-State.
… or better : 1st in Off-State, then in On-State, then again in Off-State.
Maybe the transistor is not completly shut off and the voltage at the coil is high enough to hold the relay in On-State. i.e. Some 12V-relays needs 10V to turn on but less then 6V to turn off.


Please excuse my limited english.

I don’t have the solenoid connected right now. In fact none of the external components are connected at the moment and I get the same behavior from the relay.

The voltage across the coil is as follows:
ON: 12V
OFF: 3.75V

I didn’t expect there to be any voltage across during the off stage. I added a 10K pull-down resistor on the coil and now it works! Thanks for helping me think :slight_smile:

BTW, this is the relay I’m using:

Now another little problem… My 12V source is a PS3 power supply (12V 30A). It should be more than enough to power everything. However, if I don’t have the USB cable attached to the Panda then my stepper motor doesn’t seem to get enough current to do more than move a few mm. If I plug the USB in then everything works as it should. I can’t believe that extra 500mA is really needed. Do you see anything else that could be causing this behavior? The Panda doesn’t appear to be rebooting.

Show the schematic

Architect, it might not be changed since the above.

Ian, I’d suggest you measure the current draw from your 12v source. Multimeter in line with it. That’s the acid test, what is actually being drawn. Ideally you’d measure the voltage as well to see if it sags at all, but if this is repeatable then you can measure it separately and see if it has significant fluctuation


Yeah I was hoping to see schematics so I can compare it with the above wiring.

You have been hanging out at ThinkGeek again haven’t you.

Sorry for the delay. I’ve had company all day. The latest schematic is attached but the only thing that’s really changed is the addition of the pull-down resistor. I measured the current from the 12V source with the USB cable not attached and it’s peaking at under 0.6A. Seems a little low to me considering it’s running a NEMA17 stepper motor and a larger water sprinkler solenoid. After thinking about it, I’m guessing the problem is the wiring between the 12V source and the mainboard/rail. I’m using some fairly small wire and the cable is about 4’ long. I’m going to beef this up and try again.

Well, of course… But, what makes you ask?

Something weird going on here… I replaced the wiring from the power supply to the shield. Turned on the power supply w/o the USB connected. The stepper worked! It went a complete turn as it’s supposed to. Then I noticed that the solenoid didn’t fire… So, I plugged the USB in and it all worked. Note that the 12V only behavior was opposite what I was experiencing before (solenoid was working but stepper wasn’t…). Then I unplugged the USB and it went back to just the solenoid working and the stepper only taking small steps. I’m totally bewildered now… Is there maybe something about the EasyDriver anyone knows of that might be causing this?

Do you have schematics for your fritzing wiring ?

Sorry, I haven’t organized that part of it yet. I’ll try to get something (probably crude) soon.

Here’s my first stab at turning the breadboard in Fritzing to a schematic. A lot still needs to be done to make it presentable but hopefully this will help. It’s all I’ve got time for tonight. An auto layout feature is desperately needed in Fritzing.

Here’s a quick glimpse of my “Zombie Cannon”. It’s a demo project I’m using for my presentation titled for the Nashville .NET User’s Group called “Tools for Surviving the Zombie Apocalypse: Microcontrollers, NETMF, & Gadgeteer”. The LED site is a flattened “cube” that demonstrates multilexed LEDs controlled by an Arduino. There is a rangefinder on the front that monitors zombies and sends signals to the Arduino via a Panda as the zombie gets closer. There are four stages. The site changes it’s pattern as the zombie gets closer and when it changes to just a small red crosshair, then the pneumatics are fired by a solenoid (via the Panda) and a Nerf dart kills the zombie. Also, there is a red laser that targets in on the zombie as he gets in the “very close” range as a last warning before the dart is fired. Due to time constraints, I haven’t really worked Gadgeteer into the project much yet but there will eventually be a bluetooth connection between a Gadgeteer & a smartphone app that can be used to externally fire & monitor the situation :slight_smile:

The plans and design files will all eventually be available on my blog & on Ponoko once I have some time to quit building and start documenting.

I’m still having the above issue if anyone has any ideas…

(please ignore my mess of an office. I still haven’t unpacked since our last move…) Yes, those are hot pepper PJs :smiley: Enjoy!

Looks interesting

I thought you were just going to use one of those cannons from ThinkGeek, but apparently they don’t penetrate thick enough armor for your tastes.

I bet you don’t have anyone sitting in the first 5 rows at your presentation as they will all be huddling in the back corner in fear :slight_smile:

Actually, the whole center isle will be roped off. One of the things I don’t quite have worked out is air pressure. My regulator doesn’t want to go below 30psi when I’m using a portable tank. The Nerf darts work great with only 10psi on my compressor in the shop. At 30psi, I can put an eye out from 30’ away. I do have some very special face protection for my test Zombie :wink:

Is that a whole box of FEZ monkeys in the background? :smiley:

No zombie defense is complete without a squadron of flyin’ monkeys!