Arduino Programming Setup
This module covers using plain open source Arduino hardware and the Arduino IDE for programming. To program you will need to either:
- Make an online Arduino Create account OR
- Install Arduino IDE and NewPing Library & I2C LCD Library either by unzipping it to your “Arduino libraries” or use the library manager.
Hardware refers to the physical and electrical components as opposed to the software which is code.
This module refers to two Arduino based robots: Little Bot & Big Bot
Little Bot: All 3D printed chassis- small two wheel drive with rear omni wheel, single IR line sensor and two ultrasonic sensors. The two motors are brushed DC motors with an L9110 motor driver IC
Big Bot: Large aluminium 6 wheeler or 4WD – brushed DC motors on each side are driven by a single 20Amp ESC (Electronic Speed Controller). Large 3D printed bumper houses IR Line Sensor and 2 x ultrasonic sensors.
Test Robot Sensors (Inputs)
We need to test the Robot’s sensors (outputs). To do this we need to upload a program that will display the IR line sensor and ultrasonic sensor values to the Arduino Serial Monitor and the LCD screen if you have that plugged into the robot.
You can open Little_Bot_Read_Sensors in Arduino IDE or open the code at Create.Arduino.cc then you can upload to your Little Bot. Please note typical sensor values over different surfaces and distances.
Test Robot Motors (Outputs)
The motors need to be tested. Do they work at all? Do they rotate the desired direction for forwards/backwards? Is Left/Right correct?
Upload the following code to your robot and run with the power on. The LHS motor should rotate forwards then backwards then stop, followed by same for RHS.
Lets program the robot to avoid obstacles with a single ultrasonic sensor.
Test, modify and improve code.
Stay in Ring (Back Off Edge)
We can use the IR (InfraRed) Line Sensor to detect black/white and see the edge of the Sumo ring. Staying on a table top using the IR line sensor is the same as staying in the Sumo Ring