# PICAXE controlled pneumatic popup spider using CHI0030 Project Board



## HalloweenRick (Nov 25, 2005)

Hello all. I finally have time to devote to the electronics of this prop, and would like to stick with the CHI0030 Project Board as this is my first ever PICAXE project. I have been following the posts of Halstaff, Fritz42, and Hpropman with interest, and while I believe I can closely mirror Halstaff's pneumatic project coding, I'm having difficulty figuring out how to wire the Project Board. I found this schematic of Steve O's from Garage of Evil, but would like more guidance. Here is what I would like the spider to do:
Trigger prop from manual trigger
Air goes to 12v solenoid AND 50 sec USB Mp3 board is triggered
Prop stays up 5-8 seconds
Prop lowers ( or I could trigger back manually)
I'm all set on parts I believe, I've got 2 pin headers and power supplies, but I hate to just have to "play" with a project board and ruin it, even if it is only $10. Basic questions that I have first are:
1.Can I safely control 12v through the project board without a relay?
2.Does it matter which pins I use for the OUT pins to the 50sec Mp3 and 12v solenoid? Garage of Evil lists a different task for each pin of the PICAXE chip. 
Thanks for whatever help you can provide


----------



## hedg12 (Jul 6, 2008)

I don't have one of those myself, but looking at the info on the web it appears that it has a ULN2803 on outputs b0 through b7. The ULN2803 is a Darlington transistor array that takes the low level outputs of the pic and "bumps them up" to 500 milliamps or so. 500 milliamps might be enough to trigger your solenoid, but you'll want to check the specs on the solenoid to make sure. If it were me, I'd use a relay - they're cheap.
As far as output pins to trigger the sound recorder goes, you should be able to address any of those pins (b0 - b7) to play your sounds.


----------



## fritz42_male (May 5, 2009)

As hedg12 said, you might be able to trigger a solenoid but it's safer all round to buy some relays and use those on the outputs. The 50sec boards might need not work on the outputs and at the very least you would have to wire a common ground.

Do you have one of the new chi030 boards that can work with split power or the older one?


----------



## HalloweenRick (Nov 25, 2005)

Its a split power board.


----------



## fritz42_male (May 5, 2009)

Then I'd fit the optional 7805 regulator and power it off 12v and use 12v valves/solenoids. if a single uln output can't drive it then you can either drive a relay or double up on the uln outputs.


----------



## fritz42_male (May 5, 2009)

Incidentally, just taken delivery of some neat relay boards. Input off my vlc or a standard picaxe output and secondary on the relay of 10A at 250v. Onboard transistor, led and back-emf protection diode.

These will be up on the website below soon. Email Miles for further info:

http://www.ciseco.co.uk/content/?page_id=1646

I also have some of his bistable relay boards -very handy!


----------



## HalloweenRick (Nov 25, 2005)

Here is a REALLY Dumb question. I'm now ready to hook up a 12v 500ma AC Adapter Wall Wart to the board to begin testing with my 12v solenoid. I've mastered running LED's off the outputs and have gotten my 50sec USB MP3 player to play off B.6 pin. So now I need to cut the resistor above R8 on the CHI0030 project board. So here are my 2 questions that will inevitably cause you PICAXE veterans to roll your eyes:
1. How do I hook up this 12v Wall Wart to the board? Its got a Ac Adapter end, do I just run a thick piece of bare wire in it to V+ on the power end of the board or what? I watched Garage of Evil's 



on this an I can't see how he made the connection! He's on a breadboard and I'm on the CHI0030 project board, but you get the idea
2. Do I need to run addtional power to the PIC side of the board? I think the answer is no in that the 12v will run everything, but I'm not sure.
Thanks for your helping this hapless PICAXE noob.


----------



## bradndez (Jul 26, 2011)

I'm just starting on the picaxe too. So don't do what I say. I just want to give a go at an answer to see if I understand what I think I understand. I repeat Do Not Trust Me I'm just seeing what I know. The expert will hopefully correct me 

Let me answer number 2 first. Yes you need 5v going to the board to run it. You connect the battery pack to the left side power (where it says PIC). The wall wart connects to the right side where it says PWR. As I understand it the right side is just to run external components, not the board itself. I reason this out because it is said over and over that 12v will fry the PICAXE. But, once again I could be wrong I'm new to this too.

Now question 1. The wall wart has the part that plugs into the wall and a wire to some sort of connector. If you cut the connector off you will have two wires (black and red) Just solder it to the board on the right side (PWR) and your good to go. But once again I may be wrong.

Thanks for letting me test my knowledge


----------



## hedg12 (Jul 6, 2008)

As I see it, bradndez is pretty much correct. You'll need to provide power for the picaxe to the left side (looking down on the board with the power connections on the bottom.) DO NOT let the picaxe see more than 5v - you will let the magic smoke out of it! Don't try to power up the board with the wall wart without removing the resistor at the top of the board.

As for the wall wart, you'll need to cut the end off & wire the power supply directly to the board. The wires might not be red & black, though. Be safe & use a multimeter to find out which wire is + and which is -.


----------



## Spooky Dave (May 12, 2011)

Hey Rick,

I'll see what I can add to help. This is my first year with the PICAXE too, but I've already finished my first project. Whew!

Okay, so as far as connecting the wall wart to the board. Simple. Cut off the end, split the wires and expose the last 1/2-inch or so and solder straight to your board. Before you do, however, you really need to check your wall wart with a multimeter. Is this regulated? If not, even a wall wart that says 12V could actually be putting out something more like 18 or even 20. I buy these all the time for a quarter each from a local thrift store and they're all over the map. Occasionally I find one that works, though, and I run with it.

As for the two sides of the board, yes they need different levels of power. 12V will kill your PICAXE almost instantly. To do this, you can either run two power sources--you know, if you love extra wires and buying batteries (heh)--or you can use a 7805 regulater (See Steve O's Garage of Evil tutorial for how to set that up) to turn the 12V into a steady 5V for that side of the board. That way, you only need to run one source of power to your board, which cuts down on wires and hassle. Well, cuts down on hassle once it's set up right. Heh. 

But from what I can tell about the true PICAXE veterans out there, if they've running two power levels, that's almost always the way they do it. I went that route for the one project I've since completed and it works like a charm. I have 12V on the left side, which run a solenoid valve and two 12-V spotlights, and 5V on the other side which run my PICAXE, but which could also run servos or other LED's with proper resistors for 5V.

Coding should be pretty simple. Feel free to email me if you need some help there. But I thought I'd mention one more thing. Are you not building all of this ahead of time on a breadboard? Trust me, the breadboard is a huge help. I got set up with one and it's incredible how many errors and goofs I solved along the way before getting ready to solder up the actual project board. If I'd had to desolder and troubleshoot that way, I might have pitched the whole thing in the garbage. Building it all first on a split power breadboard is absolutely invaluable if you ask me.

Good luck, and please let us know how it turns out! I can tell you, the first time I walked through my beam break and had the whole prop run as programmed all by itself, I was doing a happy dance like no other. This was after three years of running all my props manually. 

Have a good one!

Dave


----------



## HalloweenRick (Nov 25, 2005)

Thanks to all who responded. I was dumfounded when I lopped the end of my 12v 300ma adapter and hooked it up to my multimeter-it read 16.5v! So now that leads to another 2 questions:
1. Where will I find a TRUE 12v 300ma or 500ma AC Adapter/Wall Wart? Do I just keep going to Goodwill and hooking them up, or do I buy a Radio Shack $29 AC Adapter. I see Electronics Goldmine has some for $2.99, but I assume I may run into the same problem I had on my first one.
2. If I build the Garage of Evil relay with the 7805 Mosfet, can I use this 12v/16.5 V AC adapter and use it safely with my CHI0030 project board?
Thanks again for all your help.


----------



## pshort (May 6, 2008)

Are you using an AC or a DC adapter? According to the documentation that I've found in all of 5 minutes searching and downloading, it appears that you need to provide DC power to the project board to both the PICAXE side of the board and to the output side of the board. If your solenoids require AC, you will need to use relays as suggested above to isolate the DC on the project board from the AC needed by your solenoids.


----------



## pshort (May 6, 2008)

The readings on your adapter do not surprise me. I don't think that there is anything wrong with it, it's just not what you expected.

At the risk of being technical, there are a lot of adapters out there that contain just a transformer and diodes, with maybe a capacitor, and without any regulator. So the voltage that you are seeing is just the (probably rectified) transformer voltage. The actual transformer RMS output voltage will always read high under no load (it will come down to the rated value with full load). That is the RMS output voltage, but what your DC meter will read is peak value, which is 40% higher, so I would actually expect that you would see a slightly higher voltage than 16.5V, perhaps as high as 18V.

To get a true 12V DC you would need a regulated DC adapter. It is not too hard to add a regulator to what you have, but that would be in another posting after it's determined that you want to go that way.


----------



## HalloweenRick (Nov 25, 2005)

I've got a 12v DC Solenoid I'd like to run off the CHI0030 project board-but I've been told to be sure not to let more than 12v hit the board-otherwise out comes the dreaded "blue smoke". I probably could build a regulator IF a buying a regulated DC adapter is prohibitive cost-wise.


----------



## pshort (May 6, 2008)

Is the output of your adapter AC or DC?


----------



## HalloweenRick (Nov 25, 2005)

Sorry its a 120vac AC Adapter converting to 12v 300ma DC Current.


----------



## Spooky Dave (May 12, 2011)

Hey Rick,

One more consideration. If you have a number of different projects you plan to use 12V on, it's awfully handy to use hacked PC power supplies. Lots of threads in here on how to do that, but what's great is that you get a nice steady 12V with really high amps. One PC power supply can do a lot for you. Of course, if you're only doing the one project, it may not be worth the hassle of hacking one.

Yeah, 12V regulated DC is the quickest, if not the cheapest, way to get your guaranteed 12V.

Good luck, and keep us posted!

Dave


----------



## fritz42_male (May 5, 2009)

Go to ebay and search for hard disk power supply and you'll pick up a dual voltage (12v and 5v) regulated 2a supply for under $4 delivered. Perfect for what you want to do.

Get at least a couple (as I had one faulty in my last order of 6 but couldn't be bothered returning it)

For higher output 12v only, buyincoins.com have a switched mode regulated 5a supply for about $11 delivered.

Higher than that and pc psus are your best bet.


----------



## HalloweenRick (Nov 25, 2005)

Great! Thanks Fritz, I've got 2 on order.


----------



## bradndez (Jul 26, 2011)

Fritz, I tried to find your post about the psu but all I could find was this link which is apparently gone.

http://www.hauntforum.com/showthread.php?t=20378

Could you lead me in the right direction?

Thanks


----------



## fritz42_male (May 5, 2009)

Not sure what you mean but if you want the 12V/5V ones, here is a link for those:

http://www.ebay.com/itm/NEW-AC-Adap...=Laptop_Adapters_Chargers&hash=item1c1b8b73c9

$3.17 delivered

And 12V 5A supply off eBay here:

http://www.ebay.com/itm/12V-5A-60W-...=Laptop_Adapters_Chargers&hash=item2eb79f3bfc

$7.50 delivered

All universal input e.g. 110/240V


----------



## bradndez (Jul 26, 2011)

Yeah, sorry about that, the 12v/5v ones. I saw them on ebay, but I just wanted to make sure there wasn't any other hack that needed to be done like the computer power supplies.

So basically you just snip of the connectors and connect the wires to the board? No other hacking required?


----------



## HalloweenRick (Nov 25, 2005)

I'm having some trouble getting my PICAXE to do what I want. I really couldn't tell you if its a programming problem or a wiring problem...so I'm going to post my code and a picture for the PICAXE savvy. I'm attempting to build a pneumatic pop up spider, but controlled by a manual switch and not a PIR. At the moment, my switch is turning the 12v solenoid on and off, but my 50 sec USB Player will not play at all. So here are my questions:
1) Can I run the regulated 12v power to that 50 sec USB MP3 Player from Electronics123.com on those outputs, and if I can't, how would I?
2) Is there a mistake I'm making in the code that is not allowing it to turn on?
3) Can my code be improved/simplified any? 
Thanks in advance to the all knowing PICAXE guys here. Here's the code and photo:
PS All thanks to Halstaff who blazed the trail in making a PICAXE contolled spider and allowed me to peek at/liberally steal from his project and code.

'Picaxe 18M2 Spider, Hand Held Trigger and 50 Sec USB MP3 Player

#Picaxe 18M2
Init: let b0=0

Main:
If PinC.1=1 then Jump
goto Main

Jump:
pause 1000
high 4 'Spider jumps
pause 1000 'Pause for 1 sec 
high 3 '50 Sec USB Player on
pause 3000
low 3
pause 3000
low 4 'Spider resets
pause 3000 'Pause 
Goto Main


----------



## halstaff (Nov 18, 2009)

I think your problem is that you are running the 50 second board directly off the contacts. Those boards require a dry contact to trigger. Add a 12V relay between the Picaxe board and the audio board and it should work.
You can check out my prop controller thread to see how I had one hooked up at http://www.hauntforum.com/showthread.php?t=26536


----------



## JeffHaas (Sep 7, 2010)

I agree with Halstaff - you want to build a small project board with a relay on it. When you send pin 3 high it will turn on the relay, activating the sound board.

Look in Picaxe manual 3, page 8 for the schematic. "Standard Circuits 3 - The Relay Interfacing Circuit."

I built several of these for my use this year. Here's a picture of one next to an 08M, in a project box. You can recognize the parts from the schematic. I'm using a small 5V relay that plugs into a chip socket. Note - there is no visible diode in this circuit because this specific relay has one built-in.


----------



## fritz42_male (May 5, 2009)

The CHI030 will drive a relay without a transistor. Wire the relay directly to the output of the ULN chip and +v (a ULN is a Darlington Array and sinks power to ground)


----------



## JeffHaas (Sep 7, 2010)

Good to know! That's not mentioned in the CHI030 docs. I'll have to get one some day. Right now I have a small army of 08Ms running things as VLC Controllers.


----------



## robp790 (Jan 8, 2008)

The ULN interfernce could be causing the sound board to not trigger. I installed the 23xx series of ULN. That leaves me with two channels with no interference. I dont know if this is the problem with a 50 sec sound board but with serial communication to my sound board, it did. Also with my cowlacious sound board.


----------



## fritz42_male (May 5, 2009)

If you need another 'unboosted' output from the Picaxe, simply remove the ULN chip, bend the relevant in and out leg out of the way (vertical if you want) or snip them off then put the chip back in. Then bridge the 2 pin holes in the socket with a bit of insulated wire over the top of the chip.

ULN chips make it easy because the input and output pins are directly opposite each other.

Edit: I forgot that on 18m2 chips inputs can be reassigned as outputs so you don't need to do the above - just pic a pin on the left hand side.


----------



## HalloweenRick (Nov 25, 2005)

Sorry I'm not quite following: Halstaff it looks like you have a ULN2003 chip as your relay, but isn't that already on the CHI0030? Or do I need another? The problem is I don't have any more to make a relay, but I do have some 7805 MOSFETs and a solid state SPDT relay 120vac to 12v. Can I make any of those work or do I need to order something? Or if you can think of anything to build a relay from parts from Radio Shack I can go get those. Thanks again to all you guys for your help.


----------



## fritz42_male (May 5, 2009)

All you need to do is to go and get a 12v relay from Radio Shack. Wire it in where the sound board is now and then wire the sound board to the normally open (no) contacts on the relay. Job done!


----------



## JeffHaas (Sep 7, 2010)

Rick,

What Halstaff is saying is that with the Picaxe CHI030 board, you don't need any extra parts to make a relay work. My post & picture above are for the Picaxe boards that do NOT have a ULN chip on them. The ULN has the parts inside it that I added to my small project board.

With a CHI030...One side of the relay is the coil, which is connected between the V+ and the pin on the Picaxe board. The audio board is connected to the "Common" and "NO" (Normally Open) contacts on the relay. When the Picaxe program sends the pin high, the relay will energize and the contacts will close. This "pushes the button", or closes the connection, for the audio board.

Look on page 3 of this PDF:
http://www.picaxe.com/docs/chi030.pdf

They don't show a relay there but it's the same idea. V+ runs along the outside right edge of the board.

Jeff


----------



## HalloweenRick (Nov 25, 2005)

Got a new problem-I have built the relay that takes the 12v power supply down to 5v using a 7805 MOSFET, and now have got audio-everything is working great!
UNTIL- I smoked the ULN- I was running tests and changing the delays to see what would be best, and white smoke plumed up from the ULN2803 chip! I tried another-but smoked it on the first try! I have taken a multimeter reading of the regulated 12v supply- and get 11.9V. The only things on the output side of the board are the 12V solenoid and the relay to the 50sec USB MP3 Player. Do I now just have a bad chip socket from smoking the first ULN2803, or is it something that I have wired incorrectly. Do I take a chance of putting my last ULN2803 in this chip socket and changing the output pins, or do I try a whole new CHI0030 board? Thanks again for all your advice all, I know I've been a pain.


----------



## Spooky Dave (May 12, 2011)

Hiya' Rick,

By any chance are you running your forward voltage through the ULN2803? Based on my limited understanding (which is, essentially, just a couple of props built thus far and studying up on Steve O's Picaxe series), you need to use the ULN to switch ground, not power.

Not sure if that helps. Steve O's video in the Picaxe series about higher voltage devices explains it a bit further. Thus far (knock on wood) I've been able to successfully hook up the ULN on several different boards, and haven't blown anything up yet. 

Hope you get it figured out!

Dave


----------



## Spooky Dave (May 12, 2011)

Lol, just wanted to clarify something. When I mentioned I hadn't blown anything up yet, that was not at all meant to be a neener-neener-neener comment! If anything, this stuff has been super hard for me to figure out and I'm more than pleasantly surprised that I haven't knocked out an entire city block's electricity with my foraging into this field.

More to the point, is that if I can figure it out, it really can work! My best guess, again, is that you might be trying to switch forward voltage instead of switching ground. Even then, I'm surprised that the measured 12V would do that. Strange. 

Dave


----------



## Spooky Dave (May 12, 2011)

Here's Steve O's video about switching ground on these.

http://www.garageofevilnetwork.com/profiles/blogs/picaxe-switching-higher


----------



## HalloweenRick (Nov 25, 2005)

Thanks Spooky Dave, and I got your PM, but I'm using a CHI0030 Project board with the R9 resistor cut as per the manual-so I've got the 3 AA Batteries powering the input/Picaxe chip side of the board, and the regulated 12v power supply powering the output side of the board. The picture is on the 3rd page of this post. I'm still hoping it was just a bad ULN-but if I've wired/programmed it wrong its entirely possible- this is my first major PICAXE project- and it was going pretty good till the white smoke (and on the bright side, it did look pretty cool when it happened-after my primal scream and stream of obscenities was over!)


----------



## Spooky Dave (May 12, 2011)

I'll bet that indeed looked cool. My personal best happened a couple months ago when I wired an LED incorrectly, sans resistor, and, with a loud pop, the top half of the LED went flying across the room. Good times!


----------



## Dead Things (Apr 4, 2009)

I would make sure that the +V and the 0V from your power supply are correct. I had a 12VDC wall wart and according to the diagram on the wart, center was +V and sleeve was 0V. However, it was reversed. Smoked a LM7805 regulator circuit. I now put a meter on damn near everything I do with electronics.
And I can appreciate your frustration. Have been working on a Picaxe controlled witch and pretty well everything that can go wrong has!


----------



## hpropman (Jul 27, 2008)

Rick I sorry I have not seen this thread before. Did you get it working? was the voltage reversed if it was not then I would check for a short between the + voltages and the ground. with no power in the circuit do a continuity test with you meter to test this.


----------



## HalloweenRick (Nov 25, 2005)

Actually what happened was I was using too high a 12v adapter. I bought a 12v 2a adapter, but the CHI0030 board uses that ULN2803 chip- which tops out at 500ma. So I got a new 12v 500ma adapter, and its working great now. I should post the final code and a video of it working after Halloween. Thanks hpropman and all of you for your help.


----------

