Relay Problem

One take away from a few years living in N. Carolina… you boys in the south have bigger guns ;D

Do you have zombie fodder for field testing that cannon? The kids maybe?

I make my attendees earn their flyin’ monkeys!

No. I’m done testing on the kids. I about caused some serious eye damage to my 16 year old from 30’ away :frowning: I have a special zombie mask for my walking undead specimens to wear during the presentation :slight_smile:

OK so how many fewer zombies are there in Nashville? Any collateral damage (ie is there still a Nashville .NET User’s Group)? Of course we want video of the zombie slaughter.

I’m happy to report that I’m the only zombie left in the Nashville area :slight_smile: Presentation went great. However, I do have to fine tune it. One thing I discovered last night is that a discussion of microncontrollers in general is way too big a topic. After two hours of arduino & NETMF we hadn’t even touched Gadgeteer! Good thing we’re having a Gadgeteer lab Thursday! It’s going to be awesome. Looks like we’re going to end up with as many as six Hydra & Spider kits by next week and two or three of those we’ll be able to give away thanks to our generous sponsors. I have high hopes this will eventually spawn off a NETMF users group :slight_smile:

Pics & video to come. I recorded the whole thing but I’m obviously going to have to do a lot of editing to just pull out the highlights and compress the time down.

EDIT: Here’s a pic from one of the attendees. It was a packed house. We had to pull in extra chairs. 40+ people. There’s a lot of interest in either NETMF or zombies… :wink:

I’m doing a Gadgeteer presentation for the Calgary .Net User Group in May, but I won’t be able to shoot any Zombies as we have a labor shortage in Calgary and so even Zombies are much needed employees somewhere. I’m just going to focus on Gadgeteer as that is a topic I’m going to have a hard time just keeping around 2 hours.

When I go up to Edmonton to present to their group, maybe I can pick off a couple of Zombies there :slight_smile:


Is that a small air compressor? nice :slight_smile:

Does the compressor turn that thing into a high rate of fire nerf gatling gun?

That’s actually just a 5 gallon tank of compressed air. It’s used to propel the Nerf darts. The barrels rotate via a NEMA17 stepper motor. Not a very high rate of fire mainly due to the motor speed. But this is something I’ll be working on next. I’d like to be able to unload all eight barrels in under a second :smiley: One of the next steps will be to eliminate the tank and go to a CO2 based system like with paintball guns. Charging the ballast is rather slow with the current setup. Being able to fire directly from the tank would make high rate fire a lot easier.

I’m also looking for a better way to regulate the air pressure. When running off the tank right now it can shoot a wall 40’ away with almost zero verticle drop :smiley: The water sprinkler valve is also VERY loud. If anyone was sleeping prior to the first test shot they were quickly awakened.

If you have not got it working yet. From your circuit it would appear that Q1 has a grounded collector, shouldnt it be a grounded emmitter?

Hmmm… I’m certainly no expert. Would that cause this weird behavior? I’ll dig into that more tonight when I have a little more time.

Well I am having a little difficulty reading your circuit, but I think it could be a little more than the transistor. If the manual switch works then the transistor could also be connected incorrectly ( do’es the manual switch have the same function as the transistor?). I’m away for a few hours but will look again later. I may have to scribble down your circuit to make more sense of it ;D

Yea, sorry about that :-[ I’ll try to spend a little more time on cleaning it up this weekend. I’ve been primarily working from the wiring diagram.

The weird thing is that everything works perfect when BOTH the 12V supply and the USB are connected. When I unplug the USB then everything starts acting funky. You’ve got me thinking now… I wonder if something is being grounded differently by the USB. I had been focusing on the extra current provided by the USB but it could actually be the grounding…

Oh ya I’d crank up the pressure and keep that valve as you can’t have anyone sleeping during the presentation and perhaps a little bit of armor piercing tippage on the darts will help get that wall out of the way as apparently its way too close for proper demonstrations.

I was thinking of building something like this to help keep the deer out of my cherry trees, but perhaps I was thinking about this wrong and I should be using the cherry trees as bait and build something like this for stocking up the freezer with Bambi. hmmm a Bambi module for target acquisition and fire control, ya I’d buy a couple of those.

I asked the Windows Kinect guys if they could allow modifications to the skeletal model so I could identify other beasties etc based on skeleton matching. If they made the skeleton data an input like an xml data file then that would be cool as I don’t want to shoot the cat, I like him, he earns his keep around here.


I wonder what does it look like when a Kinect sees an animal. Does it try to make a man walking on all four?

@ ianlee74,

Some suggestions.

If your circuit diagram is correct Q1 is connected incorrectly you should have the emmiter connected to ground. Your first breadboard pictorial looks ok, but the second pictorial you have added a resistor to the relay ciruit, which means its always on, even if the conntacts are not closed. You should insert a 0.1uF cap either side of the 5v regulator (good design practice). You, as well as other people, like to add the USB 5v to the output of another regulator, this practice does not help, if you dont have enough current then use a bigger regulator maybe 1Amp, not doing so can add random noise or oscillations, as the regulator trys to control something it has no control over. When drawing your circuit, have the VCC at the top and the 0v at the bottom, and put your componets between them, if you have more than one power line then detach the circuit and do the same. You will find it a lot easier to read. ;D. Looks like a fun project.

Davef, thanks for all the suggestions!

I’ll try reversing this. Unfortunately, it’s all on a protoshield now so these changes take a little more time :frowning:

That 10K resistor was added as a pull down to keep the relay from sticking closed after it was energized the first time (see early thread discussion). If there’s a better way to fix that, I’m all ears.

Do you mean I should put a cap on both sides or on any side (doesn’t matter)?

Technically, the output of the regulator is going to the 5V pin of the Panda. The USB 5V is only there so I can debug & upload programs. The intent wasn’t to provide additional current but results as a side effect. What other way can this be done?

I’m using a L7805 VR which is rated at 1Amp. My current measurements from the 12V power supply showed peak current at under .7A. So, I think I should be fine there.

Yea, sorry again. One of my objectives this weekend is to clean that up and maybe move it over into Eagle. Fritzing is great for keeping up with the mess you end up with in a small breadboarding project but I’m learning that something with this many parts really isn’t ideal to try and maintain in the breadboard view of Fritzing. I’ve also found that the breadboard & schematic views in Fritzing are not always 100% equivalent which is troubling. In their defense, I guess it is still beta software…

You dont need tobe sorry about the CD, but before I comment on the issues you posted other than the Reg., you really need to solve if Q1 is connected correctly, as the collector has tobe more positive than its emmitter to work!

The caps have tobe connected arcoss input to ground, and output to ground.
You will find that the relay will turn on when the power is appied due to the lpc2387 pins being high until your program runs and pulls the pin low, as you probably already know, (that will tell you that all is well) so you will need to put something in to hold that off for a sec or so, I will look at that for you.

EDIT: The most simple method would be to add a switch between the 12v supply and the relay and selonoid coils, add a low current led between Q1 base and ground as an indicator, one, to indicate when to turn on the coils supply,(when the led goes off). two, led on, when the coils are activated by the uC. :slight_smile:

EDIT 2: Sorry I just fell into the same trap as a.n.other. You need an opto-coupler, not a transistor, because the transistor wont turn on enough with 3.3v on its base.

It’s too pretty a day to be playing with this right now :smiley: I’m going to move all of this back to the breadboard this evening and try to work through this.

I don’t have any. Any suggestions on what to order?

You will still need the transistor to drive the opto-coupler, look up a 4N25, use them both as emmitter followers, the important thing is to know the relay coil resistance, so at 12v, thats a min resistance of 12/0.1 = 120 ohms for the coil. You also need to limmit the current for the optocoupler input to 60mA so 3.3/0.06 = 55 ohms, 56 ohms is the prefered value. It’s Important to know the relay coil resistance.
You will also need to remove the 10k resistor you added, and apply the switch and led mod above.

I’ve done a pretty picture for you. The device in the box is the 4N25.