Author Options:

Arduino Car Answered


So in computer engineering I've got to make a arduino based car, I've added a whole bunch of features such as IR tracking, obstacle avoidance(proximity sensor), optical tracking(follow a black line), and remote control through an android based phone.

Since I'm a total newbie to technology I'm having trouble. I would appreciate it if You guys can point me towards resources and arduino libraries(for coding) that will work for me. Right now for coding I've only got basic pseudo-code setup since I do not know what libraries to use. I have searched up many sketches online and looked at them but didn't really understand any of the code.

Here's the basic pseudo-code I got setup on the things that I've got to work on:

DC Motor(4 of em for the wheels) (I also plan to add a stepper motor for turning right and left so if you could direct me on that as well)

//Import necessary library
//Setup the motors and pins

//If signal for forward received
//Code for moving forward
//Set speed

//Else If signal for backward received
//Code for moving backward
//Set speed

//Else If signal for right received (keep turning right till stop signal received)
//Code for moving right
//Set speed

//Else If signal for left received (keep turning left till stop signal received)
//Code for moving left
//Set speed

//Else If signal for stop is received (Should we slow down to a stop or just stop?)
//Code for stop
//Set speed

IR (I've got transmitting and recording diodes)

//Import Library

//Declare Pin for the IR Sensor

//While loop: Move Right
//If IR signal is received
//move forward
//Jump back to top of loop

Proximity Sensor (obstacle avoidance mode) (I might either use the one from Lego kit or buy a separate one )

//Import Library

//Declare Pin for proximity sensor

//While Loop: Send out sonar(echolocation or whatever) every second
//Is there any obstacle?
  //Yes, turn right so many degrees, and go back to while loop
  //No, move on forward at set speed

//If you’re surrounded and cannot exit send out a message through flashing LED's

I'm not asking for the code or for any of you to do all my stuff for me, I'm just asking for direction and resources.

Thank You



4 years ago

Since it is a school project noone will offer you much help here as it would be considered cheating.
Check the Arduino websites as they offer a lot of information on all their libraries and codes.
But with all the stuff you want to include it is not for the beginner at all and will require some serious digging and code matching on your end.
You will find the basics but you still have to combine them and link them so they work for your project.
I would focus on one thing at a time.
Get the running gear and remote working then bit by bit you add the other "features".


Reply 4 years ago

I am allowed to use online resources as long as it isn't being done for me. Anyways, for the programming part I was going to start working on my wheels (motors) and was wondering is there a way to write the code without using libraries or is it possible for me to view the code in the library? Could you tell me how.

Thank Yoou