Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

What relay should I use with Parallel Port?

Status
Not open for further replies.
No college or a university is not actually necessary but it helps, especially the lab time that affords good experience. Having a degree doesn't hurt either in the job market. During my school days I never had any courses or formal training in programming ( it wasn't quite invented yet :) ) however, I have managed to teach myself enough to meet my needs.

The attached is the circuit I used with the parallel port outputs when I was screwing with them. The base resistor could likely even be 1K but I used 3.3K. Using something like this the motor is On or Off with a single direction. Now if you build a small H Bridge your motor would have Forward Off Reverse using two bits from the port. The transistor can be a 2N3904, 2N2222 or a BC547 as just about any PNP switching transistor should work as configured in the drawing.

Ron
 

Attachments

  • 2N3904 Motor.gif
    2N3904 Motor.gif
    7.3 KB · Views: 689
During my school days I never had any courses or formal training in programming ( it wasn't quite invented yet :) )

Lol, Is it true that rainbows use to be in black and white? :)
 
Lol, Is it true that rainbows use to be in black and white? :)

Now that was really good! :) I do clearly remember watching the TV I watched in B&W and other ancient things.

Ron
 
Thanx Ron.

Actually, I tried building an H-bridge when I first started the project (i actually didn't know what it was called when i built it) and I came up with a design almost identical to the one here:

**broken link removed**

Before answering my questions below, can u tell me if the circuit above is built correctly? Is it supposed to work? If yes, then the problem described below is probably due to some error I have committed. I hope you can point it out to me.
I thought that using only one kind of transistors would save me a lot of headache. My circuit uses NPN transistor 2N3904. Whenever I turn A high (at two base pins), only 70 mA flows in one direction. When I turn B high (not forgetting to turn off A), 70 mA flows in the OTHER direction. So, basically, my circuit works, but the current is too low, even when measured at ground (i need at least a hundred milliamps for the DC motor).

I have been trying to find out why the current is too low. Note: each of A and B is connected to only one data pin of PP (what i mean is that both base pins at A are supplied by only one pin of PP. the same goes for B.) Do you think this is the reason the current to motor is too low?

(another thing: since LEDs are basically diodes, in general, is it ok if i use LEDs in place of some diodes like the snubber diodes they use in H-bridge circuits?)
Thanx guys!!! :)
I hope ur not bored yet!
 
Hi Ya

Nope won't work in a nutshell. When building a H bridge we use complimentary pairs of transistors NPN/PNP like a 2N3904/2N3906 or 2N2222/2N2907. Give this article a read.

To function correctly an H bridge needs to have the transistors driven into saturation which is a way of saying maximum conduction to where the voltage drop between the emitter and collector is as close to zero as we can get. Also I should point out that a combination like the 2N3904 & 2N3906 are not the best choices for a H bridge but will work OK. You want basic and works and they will work.

Nope, can't use LEDs. :) Even though in a sense of the word a LED is a diode it isn't what we want and doesn't have the characteristics we want. The diodes are optional in a real basic circuit anyway.

I would try using the simple one transistor circuit I posted a few post back connected to your PP and see if it drives your motor. Then I would move along to the simple H bridge using a 3904 & 3906 just to see how it works. Working off the PP I would use 3.3 K Ohm base resistors before trying 1 K Ohm.

I was going to build a working system today (Friday) but my day went ugly when truck battery was dead. End of life! :) Got truck running when wife got home from work and got a new battery. Not how I planned my day!

Ron
 
Wow! Thanx Ron!

Now that I read the article I have a clearer idea on how transistors work. The author of the article also explains that, under load, the transistors 2N3904/2N3906 are a bad choice for an H-bridge: "And the low-end 3904/3906 transistors were complete failures. Up to 2/3 of the power that should have gotten to the motors was wasted in the transistors of the motor driver h-bridge."

This explains a lot to me. Now I will do some more research and experimenting. Thanx again!! :)
 
Regarding my H-bridge project: I will now continue research and experimenting, thanx again! However, I need help with my other project. I am planning to switch an AC lamp (110 or 220 V doesn't matter) ON and OFF using a relay and Parallel port ( i will use an NPN transistor switched by PP to switch the relay ON and OFF) An external supply will be used for the relay coil (maybe +12V) I found many webpages and articles that would help me build the circuit. I just need to find the right relay model.

Can u please give me the model numbers of a few widely used (preferably inexpensive) relays?
Thanx everyone!
 
Regarding my H-bridge project: I will now continue research and experimenting, thanx again! However, I need help with my other project. I am planning to switch an AC lamp (110 or 220 V doesn't matter) ON and OFF using a relay and Parallel port ( i will use an NPN transistor switched by PP to switch the relay ON and OFF) An external supply will be used for the relay coil (maybe +12V) I found many webpages and articles that would help me build the circuit. I just need to find the right relay model.

Can u please give me the model numbers of a few widely used (preferably inexpensive) relays?
Thanx everyone!

OK consider using a relay with a 12 volt coil. A great source of 12 volt coil relays is an automotive store or since you want to run 120/240 VAC on the contacts a supplier like digi key is a good source. Omeron has a good line as well as other manufacturers. I'll get back with some suggestions.

Question... Are you in the US? Reason I ask is I am sure I have junk box stuff I could send you and no, I don't want anything for it.

The 12 volt power could also be gotten from the PC, which makes for easy. :)

Ron
 
Thanks for the offer, Ron! Unfortunately, I'm currently overseas now (in Saudi Arabia). Yup, the worst place for someone who wants to work with electronics! Down here, it's easier to find diamonds than electronic components! ( I actually found a store that sells some parts (at insane prices), like transistors and some relays and other stuff.)

It would be best if you gave me the model numbers of some of the most widely used relays (for AC). There is a chance I might actually find one at the store.

The 12volt can be taken from PC? do u mean by USB? i thought USB was only 5V.

Thanx! :)
 
Saudi huh? Not on my most favorite list of places to return to. :)

Before I forget, NO on the USB ports. Yes, they are 5 volts and I never recommend people get power from them. Simply because one quick little screw up and your port is dead. What I had in mind was the 4 pin molex connectors that power drives etc. Generally the system power supply (PSU) will have a few unused molex power connectors. You will see Yellow, Black, Black and Red wires. The Yellow is +12 Volts, the Red is +5 Volts and the Blacks are a shared common. Just an easy place to grab 12 Volt power. Easy because mating connectors are easily had for things like fans.

Anyway, off the PP I used a little 2N2222 transistor driven with a 3.3 K Ohm resistor on the base. Exactly as I showed in an image several post back. The relay I used was an Omron manufacture part number MK3P5-S with a 12 volt coil. The coil current was about 123 mA so just fine for the 2N2222. I used it only because I had a few.

A Google of Omron, Magnecraft, Guardian or Stancore should being up countless hits. Even though most automotive relays contacts are 12 volt they should work fine for basic lamp applications at higher voltages. I wouldn't worry about it. Since you are where you are sometimes you make with what you have.

I did work in Saudi and the UAE during the late 70s to early 80s a little. Mostly as a civilian component of the US DoD.

Ron
 
Thanks for the offer, Ron! Unfortunately, I'm currently overseas now (in Saudi Arabia). Yup, the worst place for someone who wants to work with electronics! Down here, it's easier to find diamonds than electronic components! ( I actually found a store that sells some parts (at insane prices), like transistors and some relays and other stuff.)
Thanx! :)

Can you order parts from Farnell? Have a look at the link.
**broken link removed**
 
Thanks for the link, Tom. I am amazed at how you managed to dig it up.

I actually already tried getting parts from Farnell. The problem is:

1- It's insanely expensive (to the extent that it's not worth it, especially since my projects aren't advanced enough to warrant such pricey tags.)
2- It takes a lot of time for parts to arrive, since they have to import them all the way from God-knows-where (maybe Germany or somewhere else).

But thanks a lot anyways! I managed to find a store (supplied by these guys: www.velleman.eu), and they sell most of the things I need at not-so-insane prices. I only need a model number of a relay that might work for my AC lamp switching project.

I just talked to my Physics high school teacher, and he will give me some old relays he has lying around. I will try them out, and check back if I need any more help. But, for now, I think I got all the help I need, thanks to you guys!

You guys are the best! Thanx! :)
Have a nice day!
 
Hello again Ron!

My Physics teacher gave me a relay to use in my project.

I just finished making the relay circuit, and I can now control a bulb with PP! Wow, thanks a lot for all the great tips! I even used the PSU from my PC as external supply for relay coil! (I accidentally made the yellow[+12V] wire and black[common] wire touch at first [the system crashed due to power failure]! I thank God my motherboard is still in tact, but it was a close one! I will be much more careful from now on!)
Once again, thank you guys!
 
Glad it all worked out for you. I know all too well depending on location how hard it can be to find even the simplest of parts.

Ron
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top