All On It's Own! Make Robot That Follows a Coloured Line Without Help
Video Demonstration
After completing this project, your car will operate on its own:
Objective
The manual can be used to inexpensively add features to a functioning toy car, which will:
- Add additional sensor circuitry to the front of the car.
- Add motor control circuitry to the torque wheels – the pair of wheels behind the car – and direction wheels – the pair of wheels at the front of the car.
- Add an arduino board connected with pre-exhisting circuitry on the car.
- Deactivate any RF or Wireless features – or just not use it.
Arduino eases the creation of fast and easy embedded development. Use the Arduino IDE' s C-like Processing language to write commands that will control objects connected to the arduino via the Analog or Digital terminals. It is open source and common to all computing architectures that use it. Each Arduino differ in the apps, for instance, to browse the web, do accounting, draw images, have compilers for programming languages – nevertheless, the kernel is the same. Microcontrollers are the industry industry standard for embedded systems, however necessitate knowledge of circuit analysis, digital systems, signals and systems. This makes them ideal for an institutional setting, over that of an outreach.
Unlike the Raspberry Pi, an Arduino Uno can accept analog inputs and process them to give analog or digital outputs. This is remarkably useful to make decisions about controlling the motor of the vehicle and make the steering wheels turn left or right.
Most introduction to engineering students will learn from this hands-on DIY about:
- Sensor network basics
- Algorithm design basics
- Flow charting
- Writing programmed code
- Circuit schematics
Description
This project explored to use an Arduino, please view it in Figure 1, which is available, but not limited, at canada.newark.com components.
And, a Light Dependent analog Resistor, see Figure 2, which is available, but not limited, at
The three terminals of the D18B20 – power, data, ground – are soldered carefully with Arduino's GPIO 3v3 pin, GPIO4, connect to GPIO ground pin. See Figure 3 to see Figure 4 to locate these pins.
The program for this lab at bit.ly/uoittempometer is in Python. Once is is called, it will probe the GPIO data pin at a given rate. This sampling is conrolled by the user in the programs source code. See Figure 5 to take a glimpse at the great ease with which the student can manipulate the sampling, for instance from once every hour to once every 1/1 000 0000 th of a second.
Resources
The student must check through all of the following materials. Missing components can be ordered from the websites, i.e. dx.com, fasttech.com, canada.newark.com, ebay.com, sparkfun.com, adafruit.com, and other website that gives you an inexpensive deal on your component/parts list. The student needs:
Laptop or any computer with Linux Ubuntu - this could be installed alongside with Mac or Windows.
4 wheeled toy car that can move and turn
1 Arduino
1 Micro USB, cable that connects to the computer to power Arduino's
1 Light Dependent Resistor Digital temperature sensor
Breadboard (not bread! It has many perforations) Please see Figure 6.
Jumper wires
Solder station with solder iron, solder, flux in your lab's station.
Tape, multimeter, measuring tape, cutting tools in lab's station.
Method
Before beginning read all the steps hereforth. Take some time to visualize the path the workflow below takes toward making the final Tempometer, start each step until the end. Pay close attention to the figures and diagrams.
FIGURE 3 Front view of the sensor module, consisting of LED emittors and photocells or photoresistors.
Step 1: Prepare ArduinoSwitch off your laptop. Take out your Arduino's and put it inside your laptop's or computer's memory card reader or USB card reader.
Now, power your Arduino by plugging in the Micro USB to the, while connecting the other end to the computer's USB.
You will see Linux as you boot on your screen. Once it asks you to login, type in default authentication credentials
Step 2: Connect the LDRs
Solder carefully – do not mismatch the terminal connections – the power terminal of the Light Dependent Resistor temperature sensor to the 3V3 Pin in the Pi, the data terminal to the GPIO 4th pin of Arduino, the ground terminal to any of the GPIO ground pins of the Pi – does not matter which ground you choose.
Step 3: Check the car
Before writing yourself or using pre-written program to read direction check if your Light Dependent Resistor is working.
To do so, first navigate to the system directory where Light Dependent Resistorhas a file allocated to.
You should see two lines of text, after you have completed the commands. The first line shows temperature reading 1 second or so ago.
Step 4: Python program that makes wheels move
FIGURE 4 Battery pack powering the line following car's onboard micro-controller and motion sensor modules.
All is well! Now implement the pre-written temperature reading script written Python.
Change the variables, intv and endWhen to your custom sampling rate and end time. However, you can end the temperature logging process anytime by pressing Cntrl + C while the program is being executed.
Once the program ends after the designated end-time or your Cntrl + C signal to stop it, the program automatically saves a text file in the same folder as where you placed your temperature-logger.py.
This text file has all the temperature readings. Each new line corresponds to the reading at that sample.
What You Program
Pre-made code for you are in source-code folder.
To accelerate a beginner to programming, the choice of language to do all controls and data logging on the Arduino is Python - a easy to use language where user doesn't have to control the internals of the program, like name spaces, memory allocation, data types, etc. All major Linux distributions come with the
Python Compiler pre-installed with it, making it easier to avoid the search for IDE's or rote step-by-step compiler downloads for Python.
Python is extremely powerful as a prototyping language. It is undesirable for high performance applications or extremely large software, such as an Operating System.
After you have completed your own data collection, you have the option to view our own test data called temperature-data.txt in the folder you downloaded from bit.ly/uoitlinefollower
Imperative Areas in Need of Improvement
This lab ensures that an existing toy car with or without RC is converted into a line following car. The obvious limitations of this car is the elementary algorithm used to control the car through the arduino. The current limitation are the following:
Car follows straight line.
Turns at angled corners accurately.
Turns at curved corners with very low accuracy.
Stops when both sensors are out of path.
Next improvements would address the above limitations by having:
The car turn at smooth angles.
Let the car retrace back to the coloured line once both sensors are off the track and on ground.
Increase the speed of the vehicle while it satisfies the above two expectations.
FIGURE 7 Screen shot of program controlling the Arduino Micro-controller, which directs the motion of car according to sensor readings.
Further Readings
To have a deepened knowledge in Linear Robotics, you should first gain a "knowledge scaffold and learning directions" of powerful math, science, computer technologies and engineering. Learn more as a student or teacher from free schools:
Once you feel confident, please Search with keywords "Linear Control Systems", "Robot Made with Junk Materials", "Robotics Cookbook" at UOIT Library or Open Textbooks and Open Encyclopediae:
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.