mr. mister said:
i am to build two remote controlled toy sized cars, which both have inbfra-red receivers and transmitters
they are to be controlled by rf and the purpose of the infrared transmitter is for the two cars to be able to shoot at each other e.g. kind of like laser quest where people run around in vests with IR receivers shooting each other with infra red guns.
when one car detects a hit, it has to stop for 5 seconds before controlling it can resume. another option that could be added is (not necessarily) is that when the car has been hit three times, it stops completely and has to be switched off then on to start again (basically switching either car off then on resets their hit record).
problem is i have not experience in robot building and also i do not know how to interface the IR aspect to halt and stop control of the car.
Really it's not a robot, but just a radio controlled car, and you could use standard radio control gear to build the car part of the project - but you will need an extra radio control channel to 'fire' the gun (cars are often only two channel).
That deals with the first part of the project, the second part is the IR receiver/transmitter part. For a start you need somekind of encoding, to differentiate between the two cars - after all you don't want to hit a reflective surface and shoot yourself?.
You could use Holtek coder/decoder chips to do this, but a better option (because of the 5 second delay requirement) is to use PIC's to do it. I would suggest a small 8 pin PIC for the transmitter, and a similar one for the receiver (it will make it less complicated to use different PIC's for TX and RX).
The RX PIC simply reads signals from the IR receiver, and when it finds a valid ID code it disables the motor and starts counting for five seconds, after five seconds it enables the motor again. It would be just a matter of software changes to add a permanent stop after a number of hits, and trivial to do.
How you disable the motor will depend on your design, and how much standard radio control gear you use, but it should be very easy to do - even as crude as using a relay to switch the motor suply off.
I would suggest a couple of enhancements as well, both easily done using a PIC - disable the 'gun' as well as the motor after you've been struck, so you can't shoot back - and prevent the car been shot again for a number of seconds after it's been shot once (to prevent the other car shooting you every 5 seconds!), you would need to find a suitable delay period by trial and error - and you could even have shorter delays for better drivers?.
If you check my PIC tutorials the IR remote control tutorial could easily be used to do just what you want, remembering to change the ID codes so a Sony TV remote doesn't 'shoot' the car :lol: