And one final thing. It looks like you could seat that crystal just a little better.
EDIT: It also appears that Pin 26 from the Propeller is on Row 12 of the breadboard, while Pin 18 of the ULN2803 is on Row 11. Of course this could be an optical illusion, but that is the way it appears.
That was it! I didnt have the uln grounded to the propeller. The circuit from the propeller was not fully connected. Silly me. Thanks for all the suggestions! that stumped me for a moment there...
Step one complete, thanks for the sample code as well, i know how to read the spin language, but speaking it fluently usually takes a little tweaking...
This is actually an application for which the basic 2N2222 or equivalent bipolar transistor works quite well, and you can get a big pile of them cheap even at Radio Shack. Wire 200 ohms in series with the base, emitter to ground, collector to one side of solenoid, other side of the solenoid to 24VDC. Don't forget the backward connected diode across the solenoid to absorb the voltage spike it will make when you turn it off.
This is actually an application for which the basic 2N2222 or equivalent bipolar transistor works quite well, and you can get a big pile of them cheap even at Radio Shack. Wire 200 ohms in series with the base, emitter to ground, collector to one side of solenoid, other side of the solenoid to 24VDC. Don't forget the backward connected diode across the solenoid to absorb the voltage spike it will make when you turn it off.
Ive got a handful of 2n2222's, but i liked the idea of the uln2803 because it came with a protection diode built in, so just one part is needed. I am still open to using separate transistors so itll be easier to swap out in case one of them gets blown, it just depends on how much of an issue that would actually be...
You can pick up the TIP125 at RadioShack. It's a Darlington that can switch lots of current and it has a flyback diode built in (though I still put one across the device when I use them).
I think what localroger and JonnyMac may being trying to tell you is that you may end up with some problems by using one device to control a bunch of solenoids. Did you take a glance at the link I provided above, if not then here it is again.
@idbruce
Thanks for posting that link. The datasheets don't do a good job describing the current limitations.
The datasheet says that the outputs can be parallelled, so I guess you could use two ULN2803A chips for your seven relays but the current requirements might still be too high and you will need to use discrete components.
I took the power dissipation into account before suggesting the ULN2803.
The solenoid Darcy mentioned in his first post has a coil rating of 24V and 2.5W so the max current would be 104.2 mA.
The relay he mentioned later has a coil resistance of 2880 ohms so current would be 8.3 mA
As stated in the link provided The maximum output per pin goes from 500 mA (one output on at one time) to about 470mA with two on, down to about 160mA with all eight outputs on at 100% duty cycle. Look at the graph on page 6..
Yeah, i was concerned that the potential amount of power that the solenoids may require were going to exceed the limits of the uln2308, i was going to address that tomorrow when i had the parts gathered, the solenoid that i would be using might end up drawing more current too, depending on which one i get...
I took the power dissipation into account before suggesting the ULN2803.
The solenoid Darcy mentioned in his first post has a coil rating of 24V and 2.5W so the max current would be 104.2 mA.
The relay he mentioned later has a coil resistance of 2880 ohms so current would be 8.3 mA
As stated in the link provided “The maximum output per pin goes from 500 mA (one output on at one time) to about 470mA with two on, down to about 160mA with all eight outputs on at 100% duty cycle. Look at the graph on page 6.”.
Good observation on the max per pin when all 8 are in use. And i'm a she btw...
thank you for all of your help. the documents that you guys came up with were very informative, I've bookmarked the majority of them. the solenoids are up and running. Now i'm working on refining the code for this application, I may end up creating a new thread since the coding deals with a somewhat separate issue.
I successfully ran the ULN2803 operating 7 solenoids @ 24V and 3W each, alternating between on/off with a 1 sec delay, (mainly to prove to my boss that it would work, I knew it would . )
I did notice though that when I left all 7 solenoids constantly on, the chip started to warm up a bit, I feel that it might be good to add a heat sink just as an extra precaution so it'll be prepared for any worst case scenario.
It has been a while since I messed with one of these chips, but I am 99% certain that this is the hookup. Someone please correct me if I am wrong.
Bruce
EDIT: You could also cut down on the number of I/O pins by incorporating a 74hc595 into your design
But, you would only save about 3 I/O pins depending on your method, and add to the layout complexity, add and additional chip and board real estate (both upping mfr cost if you plan more than a one-off) plus a possibly more complex bit of code to do this. Also, whatever method you chose, consider using opto-isolators. 12+ or higher with sufficient current capacity shorting into the prop will most assuredly result in rapid dis-assembly of your prop and release of magic smoke inside. *smoke EQ *magic
But, you would only save about 3 I/O pins depending on your method, and add to the layout complexity, add and additional chip and board real estate (both upping mfr cost if you plan more than a one-off) plus a possibly more complex bit of code to do this.
Correction, considering 7 solenoids, that would be 4 pins, and yes it would add to the layout complexity, and yes it would take up real estate, but 4 I/O pins is a significant quantity depending on the project.
Bruce
EDIT: In one of my other posts, I state that I am not a big fan of the 595 chips, but they have their uses.
Also, whatever method you chose, consider using opto-isolators. 12+ or higher with sufficient current capacity shorting into the prop will most assuredly result in rapid dis-assembly of your prop and release of magic smoke inside. *smoke EQ *magic
Frank
Yes, I picked up some optoisolators as mentioned earlier in this thread, but I havent added it to the circuit yet. For now it just has a built in protection diode on the ULN, but at the very least i was going to add a secondary protection diode for each output
Might I recommend a parallax product for your finished design. The Digital I/O Board uses all the same hardware your using to drive your silinoids plus some extra hardware (shift registers) to save some I/O pins if needed,not required. With this board you wouldn't have to worry to much current draw or protection. I'm using it right now in a current industrial project, its proven very usefull and and saved me some hardware design.
Agree with Bruce regarding I/O pin savings. That was why I designed a 3 pin Hitatchi compatible LCD controller object. (Placed in OBEX for the curious and the critics)
But if I/O count is not a restriction, one I/O pin into a ULN2003/4 7 ch darlington driver with internal protection diodes. I have seen this countless times in many systems using motors and solenoids. For those wanting to play with > 50V, TI makes a device pin compatible with 100V rating, 75468/9,
Since you agreed with me, I will also agree with you. The 74HC595 will run with just (3) I/O pins, however, with just (3) I/O pins hooked up I had some problems with floating data. I am a firm believer, although I have never proven it, that the 4TH I/O should also be hooked up to eliminate this behavior. In which case, your following statement would also be correct:
But, you would only save about 3 I/O pins depending on your method
Might I recommend a parallax product for your finished design. The Digital I/O Board uses all the same hardware your using to drive your silinoids plus some extra hardware (shift registers) to save some I/O pins if needed,not required. With this board you wouldn't have to worry to much current draw or protection. I'm using it right now in a current industrial project, its proven very usefull and and saved me some hardware design.
Unforturnitly it looks like there out of stock until 7/29.
I agree that the Digital I/O Board is a great product that provides 8 high current outputs and 8 optically isolated digital inputs, all of which require 7 or fewer I/O pins. If higher currents and/or digital inputs were required I would be in 100% agreement, however for this application I feel it is overkill.
The ULN2803 can easily handle driving 8 120mA loads simultaneously. As for protection, It has a darlington transistor pair as a driver along with a 2.7K resistor between the input pin and the base of the first transistor. That offers a reasonable degree of protection in case the output transistor shorts.
If minimizing Prop I/O pins to drive the output were a requirement I would suggest using a TPIC6595 which combines the functions of a '595 and a ULN2803 in one chip. One or more TPICS can be controlled by as few as 3 I/O pins and provide a large number of outputs.
@idbruce, Re: “The 74HC595 will run with just (3) I/O pins, however, with just (3) I/O pins hooked up I had some problems with floating data. I am a firm believer, although I have never proven it, that the 4TH I/O should also be hooked up to eliminate this behavior.”
You are absolutely correct. In fact for both the '595 and the TPIC when only using 3 I/O pins to drive the data, serial clock, and register clock pins the gate (/G) should be grounded or have a pulldown resistor to ground, and the serial register clear (/SCLR) should have a pullup resistor connected to Vcc.
See my object in OBEX. 74HC264, pins 1+2 tied. Sorry to any reading, I neglected to draw in the /reset hardwired to +5v. No floats other than two unused outputs. Floating pins EQ bad form/design * mystery problems. Opto-isolators: a circuit level firewall in the original non-IT definition of the term.
Wish I knew who to credit, but came across the definition of FET a bit back, "Flame Emitting Transistor". I would add that MOS means "Maximum Object Scorching" at least from having to rebuild some tube rotor drivers in AMX4 series portable X-ray units. If they get a D-S short, the fuses normally go (totem pole, not H bridge). On the ones that punch the gate, they will usually destroy both stages of driver transistor and supporting passives and traces (IRF350s with 120dc and fused @ 6A) all the way back to the optos at the input. I keep a nice stock of parts for rebuilding these boards.
@kwinn - That TPIC6595 looks and sounds pretty nice
It is a very handy chip for driving small loads like relays, solenoids, indicator lights, multiplexing leds, driving small steppers, etc. The 5 input signals are identical ( though on different pins ) to those on the '595 so the '595 objects in the OBEX can be used for it. I have a board that uses 7 TPICS to control 56 relays.
Comments
Additionally, here is some test code for you.
Bruce
EDIT: It also appears that Pin 26 from the Propeller is on Row 12 of the breadboard, while Pin 18 of the ULN2803 is on Row 11. Of course this could be an optical illusion, but that is the way it appears.
Step one complete, thanks for the sample code as well, i know how to read the spin language, but speaking it fluently usually takes a little tweaking...
You are welcome.
Bruce
Ive got a handful of 2n2222's, but i liked the idea of the uln2803 because it came with a protection diode built in, so just one part is needed. I am still open to using separate transistors so itll be easier to swap out in case one of them gets blown, it just depends on how much of an issue that would actually be...
I think what localroger and JonnyMac may being trying to tell you is that you may end up with some problems by using one device to control a bunch of solenoids. Did you take a glance at the link I provided above, if not then here it is again.
http://sci.tech-archive.net/Archive/sci.electronics.basics/2005-10/msg00192.html
By doing what they suggest, the subject of that web page would never become an issue.
Bruce
@idbruce
Thanks for posting that link. The datasheets don't do a good job describing the current limitations.
The datasheet says that the outputs can be parallelled, so I guess you could use two ULN2803A chips for your seven relays but the current requirements might still be too high and you will need to use discrete components.
- Ron
You're welcome.
The solenoid Darcy mentioned in his first post has a coil rating of 24V and 2.5W so the max current would be 104.2 mA.
The relay he mentioned later has a coil resistance of 2880 ohms so current would be 8.3 mA
As stated in the link provided The maximum output per pin goes from 500 mA (one output on at one time) to about 470mA with two on, down to about 160mA with all eight outputs on at 100% duty cycle. Look at the graph on page 6..
Good observation on the max per pin when all 8 are in use. And i'm a she btw...
Sorry Darcy
@kwinn - Then she should be good to go
Bruce
Also sorry. You must admit though that Darcy is an unusual name for a she.
I did notice though that when I left all 7 solenoids constantly on, the chip started to warm up a bit, I feel that it might be good to add a heat sink just as an extra precaution so it'll be prepared for any worst case scenario.
But, you would only save about 3 I/O pins depending on your method, and add to the layout complexity, add and additional chip and board real estate (both upping mfr cost if you plan more than a one-off) plus a possibly more complex bit of code to do this. Also, whatever method you chose, consider using opto-isolators. 12+ or higher with sufficient current capacity shorting into the prop will most assuredly result in rapid dis-assembly of your prop and release of magic smoke inside. *smoke EQ *magic
Frank
Correction, considering 7 solenoids, that would be 4 pins, and yes it would add to the layout complexity, and yes it would take up real estate, but 4 I/O pins is a significant quantity depending on the project.
Bruce
EDIT: In one of my other posts, I state that I am not a big fan of the 595 chips, but they have their uses.
Yes, I picked up some optoisolators as mentioned earlier in this thread, but I havent added it to the circuit yet. For now it just has a built in protection diode on the ULN, but at the very least i was going to add a secondary protection diode for each output
http://www.parallax.com/StoreSearchResults/tabid/768/ProductID/658/Default.aspx?txtSearch=digital+i
Unforturnitly it looks like there out of stock until 7/29.
But if I/O count is not a restriction, one I/O pin into a ULN2003/4 7 ch darlington driver with internal protection diodes. I have seen this countless times in many systems using motors and solenoids. For those wanting to play with > 50V, TI makes a device pin compatible with 100V rating, 75468/9,
http://focus.ti.com/lit/ds/symlink/uln2003a.pdf
http://focus.ti.com/lit/ds/symlink/sn75468.pdf
Since you agreed with me, I will also agree with you. The 74HC595 will run with just (3) I/O pins, however, with just (3) I/O pins hooked up I had some problems with floating data. I am a firm believer, although I have never proven it, that the 4TH I/O should also be hooked up to eliminate this behavior. In which case, your following statement would also be correct:
Bruce
I agree that the Digital I/O Board is a great product that provides 8 high current outputs and 8 optically isolated digital inputs, all of which require 7 or fewer I/O pins. If higher currents and/or digital inputs were required I would be in 100% agreement, however for this application I feel it is overkill.
The ULN2803 can easily handle driving 8 120mA loads simultaneously. As for protection, It has a darlington transistor pair as a driver along with a 2.7K resistor between the input pin and the base of the first transistor. That offers a reasonable degree of protection in case the output transistor shorts.
If minimizing Prop I/O pins to drive the output were a requirement I would suggest using a TPIC6595 which combines the functions of a '595 and a ULN2803 in one chip. One or more TPICS can be controlled by as few as 3 I/O pins and provide a large number of outputs.
@idbruce, Re: “The 74HC595 will run with just (3) I/O pins, however, with just (3) I/O pins hooked up I had some problems with floating data. I am a firm believer, although I have never proven it, that the 4TH I/O should also be hooked up to eliminate this behavior.”
You are absolutely correct. In fact for both the '595 and the TPIC when only using 3 I/O pins to drive the data, serial clock, and register clock pins the gate (/G) should be grounded or have a pulldown resistor to ground, and the serial register clear (/SCLR) should have a pullup resistor connected to Vcc.
No input signal should be left floating.
See my object in OBEX. 74HC264, pins 1+2 tied. Sorry to any reading, I neglected to draw in the /reset hardwired to +5v. No floats other than two unused outputs. Floating pins EQ bad form/design * mystery problems. Opto-isolators: a circuit level firewall in the original non-IT definition of the term.
Wish I knew who to credit, but came across the definition of FET a bit back, "Flame Emitting Transistor". I would add that MOS means "Maximum Object Scorching" at least from having to rebuild some tube rotor drivers in AMX4 series portable X-ray units. If they get a D-S short, the fuses normally go (totem pole, not H bridge). On the ones that punch the gate, they will usually destroy both stages of driver transistor and supporting passives and traces (IRF350s with 120dc and fused @ 6A) all the way back to the optos at the input. I keep a nice stock of parts for rebuilding these boards.
Frank
It is a very handy chip for driving small loads like relays, solenoids, indicator lights, multiplexing leds, driving small steppers, etc. The 5 input signals are identical ( though on different pins ) to those on the '595 so the '595 objects in the OBEX can be used for it. I have a board that uses 7 TPICS to control 56 relays.