Arduino project 669

Hello, I am an electrical engineering student, in one of our courses we were asked to build a car and a transmitter. The transmitter is built from an Arduino controller, an infrared LED and a transistor, the transmitter transmits a signal at 38kHz and an envelope frequency of 100Hz and 200 Hz(I will explain later why). The goal of the vehicle is to locate the same signal to reach it and at the same time avoid obstacles and do it in the fastest time. The test is divided into 3 stages: in the first stage locate the signal at a distance of max 10 meters and without obstacles. The second step is to locate the signal with obstacles and the third step is like the second step only that the teams compete with each other and each one finally has to reach the transmitter with the envelope frequency chosen by the lecturer 100 or 200 in the fastest time.
My car works relatively well but I would love to know if anyone here thought of a better option.
In the car I installed 3 TOSP38 receivers, ultrasonic sensors and Arduino Mega.
Problems/inefficiency in the project:

  1. When there is an obstacle the vehicle does not receive a signal (the obstacle blocks the geometric path between the transmitter and the receivers) I solved the problem by making the vehicle move around the room until it recognizes it but in a random and ineffective way.
  2. The vehicle does not drive continuously, but drives a bit, checks the receivers, checks the ultrasonic sensor, and if there is a signal and there is no obstacle, it drives in the same direction. Here there are 2 problems. The first is that the length of time that the car drives is determined by me. Driving to stop takes precious time that is wasted (I was thinking of working with interputs or an additional Arduino for each sensor and using I2C communication) will such use ensure continuous travel?

Hi, is it possible for you to use a servo motor? if yes you could connect an ultrasonic sensor to it, rotate it and identify the obstacles (or the free spaces) rotate your car by the angle of the servo and move forward, than rotate back to the straight line position. (if I understand correct you have a line with obstacles and not a maze)

Edit:The rules in the "third step" weren't mentioned, is there a possibility of enemy car hitting your car? because if yes it can change the straight line movement of your car and will probably lead unreasonable behavior. Is that an issue?

@2 you should not need more than one arduino or interrupts. Instead you probably need non blocking code where the loop runs fast enough to read sensors and control the movements of your car.
Could you add your code so far?
Non blocking code does not use delay(), but uses millis() instead for timing of actions.
Search the forum for help on non blocking code. There is plenty examples out there.

When the "objects" have reflective surfaces, how well does your IR system work?

If you can have more than one sensor you can place another sensor in a IR opaque tube which will act as a directional sensor.

  1. Have the vehicle turn 90 degrees clockwise, move just far enough to clear the largest expected obstacle, then turn 90 degrees anticlockwise. Repeat if the signal is not detected.

  2. Remove any use of delay() over, say, 100ms and use millis() and state machines for timing those operations.

Sorry I can't suggest anything less "hand-waving" without seeing code, schematics, photos etc.

  • does the vehicle need to be facing the IR transmitter to receive it, and therefore knows the direction of the transmitter?

  • when searching, does the vehicle rotate?

  • would it make sense to mount the receiver on the side of the vehicle so that it can move perpendicular to the direction of the transmitter and once detected turn and moved toward the transmitter?

  • can multiple receivers be used?

  • once the transmitter is detected, can the vehicle move directly toward the transmitter or is it possible it will encounter another obstacle?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.