Small Relay Problem
willthiswork89
Posts: 359
ive got everything working, basically i uses 3 NPN transistors... when i use low it activates the 5 volt relay(dont ask but for some reason when its low it activates not high?) thats one question... why is it the oposite of normal transistors? it activates the voltage when the base is low not high. THe next thing at hand,
DO
High LeftRelay 'Set to NC
pause 1000
Low LeftRelay 'Set to NO
pause 1000
LOOP
then works perfect, and it works the same with the right relay... but when i put both together one will not shoot.
i have one wire from each relay (3) soddered together and ran to the VDD then i have each of the other ones going to its own transistor with its own variable pin.
so why it is not able to fire them?· should i seperate the VDD wires from being 1 to 3 seperate? i notice the LIGHT dims when it goes to flick the relays. any help would be appreciated
-willthiswork89-
DO
High LeftRelay 'Set to NC
pause 1000
Low LeftRelay 'Set to NO
pause 1000
LOOP
then works perfect, and it works the same with the right relay... but when i put both together one will not shoot.
i have one wire from each relay (3) soddered together and ran to the VDD then i have each of the other ones going to its own transistor with its own variable pin.
so why it is not able to fire them?· should i seperate the VDD wires from being 1 to 3 seperate? i notice the LIGHT dims when it goes to flick the relays. any help would be appreciated
-willthiswork89-
Comments
Any chance you've got the NC and NO contacts interchanged?
The connection should be: + voltage to one side of relay ' sounds like you do
collector of npn to other side of relay 'make sure it is the collector
emitter of npn to 0 volts
base of transistor through 1K resistor to Stamp pin. 'you have to have some resistance here to protect he Stamp
Tom
I suspect you have to take what Kevin ("Will"), and possibly other folks new to electrical or electronics device·say, wth a grain of salt. This is especially true when he/they speaks of "NO" or "NC" contacts on anything. This can be a very deceiving concept to many new to electrical/electronics and electro-mechanical devices. I am not sure whether this is the case here or not with Kevin, but confusion is VERY prevalent.
Having been in the wholesale electrical supply industry for a number of years, and having dealt with all sorts of customers - seasoned electricians and Saturday morning novices alike, let me offer my way of explaining NO and NC to those not familiar with the concept, or for those not presently comfortable with it.
Nearly all folks have the concept of OPEN and CLOSED contacts down firmly. OPEN is OFF, and CLOSED is ON. Simple as that. The problem seems to come with the terminology "normal". That may seem odd to some, but until you're TOLD what "normal" is, how could anyone guess at the proper or appropriate definition? (rhetorical)
Here's what I said to my customers, as an aid to understanding this concept:
Regardless of the type of device you're speaking about, and regardless of whether it's electrical, electronic or otherwise, if you toss a device on my (sales) counter, without any wires attached to it, and no power applied to it, that's the "NORMAL' state of any such device, PERIOD. No arguments!
No cutomer ever left my counter confused about "NO" and "NC" contacts after that explaination.·I don't say that to "toot my own horn" but to offer this as a practical, useful·and understandable definition of "normal" as it applies to electrical and electronic devices, regardless of their type or eventual use..
At that juncture (in the "normal" state)·one can use a multimeter or continuity checker to determine the state or status of every contact on the device. This is definitive, and is NOT subject to ANY interpretation. In fact,·the definition above just removed any possible (mis-)interpretation that may have existed (in·one's mind)!
One often hears something like the following, from an adamant customer or dis-beleiver, who wants to hang on to his/her old (and incorrect)·beliefs:
"But my relay is ENERGIZED most of the time, so that's what's NORMAL". To that I say - ·HORSE FEATHERS, COW PIES and POPPYCOCK!! I really don't care how it's used later in the day!·"Normal" is the "dead" state, with no energy applied to it, COMPLETELY - COMPLETELY REGARDLESS of how it's used in a circuit!
This was certainly NOT directed to you Tom ("Stamptrol"), but is just intended for "general consumption". <BURP> :-)
Regards,
Bruce Bates
the relay will go
*Tick*
pause
*Tick*
and ill take it from its pole and touch the negative of my source and it goes
pause
7.8
pause
0
same thing with the right side. but when i try to control both of them one switches and the other doesnt...arnt all transiustors high for current to go through them?ill check my connections but hopefully someone can figure this out!
The above link is from the parallax site. Yours is possibly the most often asked question by novice STAMPers.
That doesn't mena the answer is necessarily simple, it's just asked alot. Here areome suggestions. The RadioShack grab bag transistors are cheap for a reason. Keep them for spares, one you can identify the pin outs with a meter. For now go to the SHACK and purchase ( in single quantities ) it is radio shack Catalog #: 276-2016.· $0.69 each. You need a diode to connect exactly as shown in the above article.
Dimming lights sound like you may be·overloading your power supply. YOU COULD BE DAMAGING YOUR STAMP If you are sinking the relay coil current via you stamp pin. Check you soldering, to be sure you soldered you connections securely.·The connections·should be·shiny without bubbles streaks or brown stuff. Parallax has TONs of usseful information on their website. Go to the home page and use their seach for Downloads> Nuts and volts. Lots of short,to the point articles with enough theory to explain without overwhelming you.
Finally you might want to swap LEDs for your relays. They draw a lot less load and should test your program logic adequately. You may need a larger power supply for you relays, maybe even a separate one. Which may create additional issues.·I'm not trying to complicate things, I'd just hate to see you burn up your·STAMP. It's really·, really hard to get the smoke back in.
Happy·Stamping
Philip Gamblin·
Please do not interpret this as being condescending...this type of "step-by-step" approach usually works out for the best in the long run.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
you must post the exact scematic as you ACTUALLY have things hooked up for anyone to help. the schematics you have been drawing in other posts look, well, hard to follow. it is most likely you are hooking things up wrong.
1. check that you are getting a logic high (1) off the PINS at the Stamp FIRST
2. check that both relays actually will turn on by hard connections to the 7v
3. make sure you have a wire ran from both grounds on both supllies, otherwise you may have two different ground references floating around in space causiong problems
4. before connect any more stuff willy nilly, please do this leds test below and report back the result. you must start at square 1 before going forward, unless you love frustration and posting and no results. you cvan use 7 volts instead of the 24 shown, you can use any resistor between 220 and 1k on the led side).
5. PLEASE check your rersults on this simple test with your NPN. Theen build two tests with two leds, and report the results.
6. post your exact code
If you don't wont to do it, no problem, you are asking for more of the same headaches. walk before you run as stated on numerous ocassions already.
http://www.pcb123.com/pcb123benefits.php?source=button_index
in my opinion, forget the relays till you can make leds work right with the schematic provided earlier
PIN -> 1k ohm->BASE
VSS->Collector
Relay-> Emitter
basically one relay controls the positive end, without this relay turned to the normally open side there is no positive to the two other relays, so basically the positive goes to one pole on connector of the pole the other goes to nothing, the output of the relay goes to the two other relays both on oposite sides of the relay
RELAY1->NO->Positive Battery
Relay2->NC->Positive Battery
then
Relay1 ->NC->Negative Battery
Relay2->NO->Negative battery
that way when its on its NC it is both negative and positive allowing it to run one way(as long at the front relay is switched on) and then when i switch them to the normally open it goes the other way... but whats happening is that they both work but only when they arnt both having to be ran....
heres the code
' {$STAMP BS2}
' {$PBASIC 2.5}
PosSource PIN 15
Right PIN 14
Left PIN 13
DO
LOW PosSource
HIGH Left
PAUSE 1000
PAUSE 1000
LOW Left
PAUSE 4000
DEBUG "Firing Right",CR
LOW Right
PAUSE 2000
LOOP
lots of pauses for a little bit of a chance to listen for them actuating
Post Edited (willthiswork89) : 8/3/2006 4:08:26 AM GMT
Try this, turn on pin 13 ONLY to make it run in one direction, turn on pin 14 ONLY to make it run the other direction. I put in a speaker since I don't have a motor illustration. Make sure your VSS(GND) is tied from both sources. It will run without the diode, but it is not a good idea. Try to turn off one output before switching on the other. You can do the same thing with motor #2.
i tested the transistors to see if my relays were telling the truth and
DO
HIGH 13
DEBUG "HIGH",CR
PAUSE 2000
LOW 13
DEBUG "LOW",CR
PAUSE 2000
LOOP
when the debug menu says LOW the voltage is 5.0 volts
vide versa for high...im guessing its the type of transistor because they ALL do it in the entire box of 15
Post Edited (willthiswork89) : 8/3/2006 5:01:27 AM GMT
What effect this has on your relays not working? Not sure, I would bet money your circuit is not functional, which is why I offered you one that would be simpler to build, and could be more easily understood.
Breadboarding is the only way to go until you are sure of your circuit.
···· I had a look at the schematic you posted. I couldn't tell exactly which relay pin is which, but I could tell that you've got the collectors of your transistors connected to Vss ( or 0 volts).
··· Several of us have asked, suggested and posted sketches which ALL show the collector going to the relay. And the EMITTER going to O volts!!!!!!
·· Based on the info shown in your sketch, interchange the leads on each transistor E and C and the circuit will work. You also should have diodes on each relay coil, as has been suggested.
· Best o' luck
Price of Basic Stamp 1 Starter Kit - $79.00
Price of entertainment accorded by this discussion, particularly posted schematic and discussions of electronic·component theory of operation - PRICELESS.
PS -·"What is a Microcontroller" is a free download from the Parallax Website.
PPS - I am not making fun of your lack of electronic knowledge.· I am making fun of the fact that you are consistently ignoring the good advice that you are getting.
Post Edited (Nate) : 8/5/2006 10:20:45 AM GMT
(insult removed by moderator)
Post Edited By Moderator (Aristides Alvarez (Parallax)) : 8/4/2006 2:40:08 PM GMT
I would have to disagree - My advice for you to get and read WAM would help you a lot.· Also, if you ever do follow your inclinations and end up in some sort of Engineering career, you will be well advised to learn to write English with proper spelling and punctuation.
Nate
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Positive of 7.2 Motor Battery->Relay->RelayDirection1 and 2
if relay is not turned on no power is going to the direction relay, thus not allowing the motor to move.
http://www.expresspcb.com/ExpressPCBHtm/Download.htm·· 'Free schematic software
www.discovercircuits.com/··· 'a whole lotta circuits!,· eeeeeeeeeeeeeeeeeeh!
Your code scheme should look something like:
Foward· CON· 1
Reverse·CON· 0
speed··· VAR· WORD
'set direction & speed to foward, ramp up speed and ramp down speed
OUT1 = foward
FOR speed = 1 TO 1000
PULSEOUT 2, speed
NEXT
FOR speed = 1000 TO 1
PULSEOUT 2, speed
NEXT
'set direction to reverse, quickly ramp up and slow down speed
OUT1 = reverse
FOR speed = 1 TO 1000 step 2
PULSEOUT 2, speed
NEXT
FOR speed = 1000 TO 1
PULSEOUT 2, speed
NEXT
This is a VERY dirty version and will need a lot of tweaking to work smoothly. This program will set the direction of the motor with either turning on the relays or not, and by adjusting the value of PULSEOUT, you can control the speed of the motor. Pin 1 goes to your transistor(s) for turning on the relays, and Pin 2 connects (prefferably through an optocoupler) to the MOSFET's gate pin. Note the Source, Gate, and Drain·connections of the MOSFET. Also since your porobably using the power from an onboard voltage regulator, you'll need a separate power supply going to this circuit and the transistors you use to turn on the relays. Best of luck!
Another good rule of thumb when designing circuits is to choose components with double the required voltage,current, or power rating than you need. It'll reduce agrivation, and extend the life of the circuit.
And to those who like to be lazy and unimaginative herefourth, if you do not have anything constructive to contribute, do not bother clicking the post reply button in the first place! You can very well see this person is just getting started in electronics & BStamps, sometimes they just need a lil wack to get the gears turning!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Definetly a E3 (Electronics Engineer Extrodinare!)
"I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
http://www.writersstore.com/product.php?products_id=114
you state that you have a scanner for your computer so please scan the back of the box your relay and transistors came in and let us see if we can help with that info.
I also agree with the drawing you gave the B and C are around backwards.
When you look at the drawing on the back of the bock note that you are looking at the bottom of the transistor (leads facing you) not the top of the transistor.
Another tip dont solder it all to a PCB before breadboarding it..
Hope we can help you.
PIN 1 Emitter
PIN 2 Base
PIN 3 Collector
then it says Bottom View
D(thats hat it looks like)
and inside the D it goes
3
2
1
so, you can see that with the transistor leads facing up it indeed is backwards. the box says
This PNP Transistor is designed as a general purpose amplifier and for switching applications at collector currents of 10ua to 100mA
now... the box for the relays...
Coil Voltage
Nominal: 5VDC
Maximum: 6.5 VDC
Nominal Current: 89.3 mA
Pick-Up Voltage: 3.5VDC
Drop-Out Voltage: .25VDC
Coil Resistance: 56 Ohms (+-) 10%
Life:
Electrical: 100,000 Cycles
Mechanical: 10,000,000 Cycles
now can somebody inform me on what some fo this stuff is, i know the coil voltage and i know the nominal current is what is draws to work but the rest im lost on... thanks!
·· The reason why your transistor turns your relay on when the output pin is low means you have a PNP transistor which flows current through E to C when the B signal is low.
·I have added a schematic of a two relay curcuit for you to try. I dont know if the curcuit will operate off the WAM board so you may need to build a smal 5v powersupply to run the relays...the 5V on the schematic.