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.

Controlling Switches and Motors via Parallel Port

Status
Not open for further replies.

JobbinJP

New Member
Hi!

Could you help me in controlling a switch or a motor (i.e turning on /off and changing direction) by my computr via the parallel port .

Also tell me how to programme it using Microsoft Visual Basic (i have a little experience using it , in my school course )
 
hi jobbin,

If you are using Win XP you will require a routine called inpout32.dll, this will enable your VB programs to control the parallel port.

If you have Win 98 or 98SE then your VB should have easy access to the port.

Lets know what your Win operating system is.???

At the end of the printer cable you are using, you will need a small pcb, so that you can mount the LED's and other components.

If you want to drive items like motors and relays, you will need a bench power supply to power them.

If you cannot write your own VB program, we will guide you.

Eric
 
the other end of the printer cable is just like the parallel port pin (female). How do i connect the pcb to a pin like this ! What PCB?

inpout32.dll - where do i get it from? I dont know if i have it!
 
Last edited:
hi,

Do a google search for inpout32.dll, its freeware. When you have downloaded it, place it in your Windows/system32 directory.

If the parallel cable you have is a spare one, you can either get the mating plug, so that you can solder wires to that
or cut off the socket from the end of the cable.
You will have to make a note of which wire goes to which pin on the other end.

Which ever way you choose of connecting the 'free' end of the cable you will require a PCB [ printed circuit board]
or something similar so that you can fix your LED's too.
You could just hang them to the end of the wires, but that will soon become a 'pain' to keep working on.

If you are not sure if you have inpout32.dll, use XP to search your hard drive, its unlikely that you already have it.


Eric
 
Last edited:
hi,
When you have downloaded it, place it in your Windows/system32 directory

Attached is VB5 i/o program that you can use and modify to suit your projects.
Paste the inpout text part in your VB prog as a module, the rest of the text as the VB form, OK.

When you have prepared the end of the printer cable, let us know and we will explain the next step.

Do you have multimeter ?

Eric
 
Last edited:
how do i connect the pcb to the female end of the parallel port cable
yes i do have a multimeter .

ok my cable is ready!!

But i got a vb-test program along with it

But what do i do for the form?
I didnt get any VB5 o/i form with it!
 
Last edited:
if you have the form can u send me an image of it ? i can make (i'll try to).

they are asking for 'dllport.dll'
 
Last edited:
hi,
This from my previous post.

If the parallel cable you have is a spare one, you can either get the mating plug, so that you can solder wires to that
or cut off the socket from the end of the cable.
You will have to make a note of which wire goes to which pin on the other end.

Which ever way you choose of connecting the 'free' end of the cable you will require a PCB [ printed circuit board]
or something similar so that you can fix your LED's too.
You could just hang them to the end of the wires, but that will soon become a 'pain' to keep working on.


You can use the VB program that came with the inpout32.dll if you wish.

As a test, connect your meter to pins #2 and pin#19 of the cable and set the meter to 10 volts say, use the VB program to switch pin2 ON/OFF. The volt meter should read about 0v or +5v as you switch the pin.

Google for parallel printer port pinout for the rest of the pin assignments.


Eric
 
ok i got a program with the following txt box- (adress) and (data) and it has two command buttons (in) and (out).

How does this program work? this program had come with the 'inpout.dll'

im very sorry but i'm using a digital multimeter! and all i have is DC , AC , Ohms , Continuity !
 
Last edited:
how do i switch pin 2 on?
what shouldd i type in adreess?
What in data?
which button to press in/out ?

Hey! but without doing anything itself there is 5v between pin2 and pin19

(you might find me irritating but i'm just 14 and i dont kno much bout electronics)
 
Last edited:
how do i switch pin 2 on? what shouldd i type in adreess? ............ Port 378

What in data? which button to press in/out ?
.............. make data 0, press out.

What in data? which button to press in/out ?............ make data 255, press out

Its possible that you have +5v already on pin 2, its the way its configured.

Using your DC meter can you turn pin #2 ON and OFF ???

Eric
 
hey man!! it Worked!! koool .

But doesn't it have enough ampere for a motor?

and how did you know that to activate pin# 2 it is port 378?
how can i know how to activate pin# 5 or any other pin?
 
Last edited:
hi,
Well done!.

Download from a Google, the Pinout for the Printer connector.
It will give you the port addressess and which pins are which. example: 378, 379 and 37A.

Its important you get this port pin info, you will need it.

No, the pins are not 'powerful' enough to drive motors or relays, [try a LED]

Thats why you need the PCB I keep on about, you will need to put transistors and other components on, if you want to drive motors.

Do you have a dc power supply, say about 12Vdc, you will need something to power your motors.

Let me know when you have the pin outs.

Eric

EDIT: added a *.pdf that have used for port work
 
Last edited:
hi,

A couple of questions.

Do you have a specific project in mind? Example: drive a LED or Relay or a small DC motor.

If yes, then what LED's, motors do you have, if any. ?

I would suggest that you look at a hobbyist catalog and find a prototyping board, the type you just push the components into pin sockets. [no soldering].

Are you now confident you can switch the pins on the parallel port using VB.?
Did you try the LED ?
Did you get the parallel.pdf downloaded to your PC?

Its important that you give us the answers so we can advise.

I can tell that you very keen to 'get going' on the project, but plan what you intend doing.
It will save you time and money in the long run.

EDIT: Google for 'parallel port projects' there are many projects to choose, also tutorials.

Eric
 
Last edited:
If yes, then what LED's, motors do you have, if any. ?
yes, i have everything ! my dad is an electronics engg. but he neither encourages nor does he help me with my dream projects (like this)

I know how to solder!!!! I am the one who always represents my school in robotics in the UAE , so i'm familiar with it!

yes , i do have a final aim !

' i want to control a series of motors through my computer!

For eg. when i click a button , first motor#1 should run for 10 secs , then motor# 2 for another 2 sec along with moto# 3 and so on.....'

Are you now confident you can switch the pins on the parallel port using VB.? ....pin #2 , yes i am confident. but rest of the pins- i don't know!

Did you try the LED ?... yes it did work switching on/ off ! !! really!

Did you get the parallel.pdf downloaded to your PC? yes i downloaded it , but it sounds very strange to me....lilke greek!!!
 
Status
Not open for further replies.

Latest threads

Back
Top