Interfacing P4 and a car...

Status
Not open for further replies.

Myth Pharoah

Baseband Member
Messages
74
Hey guys... remember me? I was here for a while and left again? Anyway this is kinda of an Hardware question for any HW experts out there.

This year(final year) of my technical education we have make a big project to show. So me and my group members decided that we make kind of an interfaced thing between a computer and a external computer. So what we're planning to do is make a car (simple box with 4 wheels) and some how get it interfaced with a computer. How is that possible?

Like if your press the up arrow the car will go up, if you press down it will go down and left and right. You get the point...

One of my friends told me that one guy some how interfaced a few LEDs to the printer port and made them glow by pressing keys or something. One guy in another forum told me to do it through the serial ports (which I know nothing about).

Any one hear know anything of this?

We've studied the basic micro controllers (8155, 8255, 8279, etc) so I have a little know how of how interrupts and such work.

Any idea any one?
 
Ok.. I did a bit of work with this kinda thing a LONG time ago.. I'll try to dredge up the memories here for you..

Probably the easiest way would be to go through a serial port.. A serial port is just a simple comm port and operates at a very base level (information goes in... information comes back.. That's it)..

Where you are going to run into a bit of a problem is with the interpretation of that information. You would have to code a program that sent information to the serial (or comm) port. That's fairly easy to do (I was doing it in Qbasic), and very well documented in the programming languages that I have seen/used. Since there isn't really anything that the computer will need to be checking in relation to the activity of the "car" you won't need to worry a whole lot about any information coming back. In fact, there shouldn't be any coming back..

However, and here is where it gets tricky.. On the "car" end.. you will need a curcuit board of some kind that interprets the information coming from the computer. The card would follow this logic patern -when I recieve instruction A I will send a digital signal to curcuit B.-

Curcuit B would optimally be connected to a actuator of some sort that would close a curcuit and cause an action (ie causing the rear wheels to spin when pressing the backward and forward arrows).

This is very similar to the way an RC car works. The only major difference would be that the "car" and computer would be physically connected with a cable.

I would look very closely at how an RC vehicle works and fashion it after that. You can get RC actuators very inexpensively now, and I am sure that there are probably lots of books available about how RC vehicles work..

Hope this helps some..

Alexander
 
RC - Remote Control (like Tyco RC)

http://www.tycorc.com/us/index.asp

I've never worked through parallel ports for a hardware interface, but I don't see why it wouldn't be possible. It's a type of communication port too, you would just have to do some research and find out how to code a program to pass information through it. It shouldn't be overly difficult, alot of printers still use parallel ports as the harware/PC interface.

Alexander
 
No the problem is how to interpret that signals sent through the port. I'm pretty sure sending data will be easy, but can I understand it? I can make it so that when the up arrow is pressed a certain switch goes into ON state and so on?
 
i'm wondering what sort of information you would be sending to and from the "car" anyway, would it be to tell the car to make an action or is it something completely different?
 
Well I want it this way.

I'll have 4 different circuits for each direction movement.

So what I want is, when I press the up arrow, the switch for going forward will be go into ON state, or if not the circuit will be completed in other words.... how do I do that? Transistors?

So like when I press the up arrow key, some signal is sent through some silly port, which completes the front motion circuit.

Any idea how I can do this?
 
then it would just rely on what hardware you've got for it:
yes i think having the right transistor would help; there are different types of transistors, the"AND" "OR" "XOR" "NAND" "NOT" "NOR" - there might be more

XOR:
1 & 1 = 0
1 & 0 = 1
0 & 1 = 1
0 & 0 = 0

AND:
0 & 0 = 0
0 & 1 = 0
1 & 0 = 0
1 & 1 = 1

OR:
0 & 0 = 0
0 & 1 = 1
1 & 0 = 1
1 & 1 = 1

NAND:
0 & 0 = 1
0 & 1 = 1
1 & 0 = 1
1 & 1 = 0

NOR:
0 & 0 = 1
0 & 1 = 0
1 & 0 = 0
1 & 1 = 0

NOT: just cancels everything out
1 = 0
0 = 0
 
Well I know all those operations and their truth tables... but how do I understand them? I'm know I'm being stubborn here but I have no idea.

Like say I send a signal over the 3 pin(that's a data pin right?) to the car. Now the 3rd pin is connected to the forward motion circuit, ok?

Now on the car, I only have 2 motors to control motion, and now the 3rd pin is connected to this forward motrion circuit.

So how does when sending say logic 1, to pin 3 complete that circuit?
 
Status
Not open for further replies.
Back
Top Bottom