This initial phase of the project will focus exclusively on achieving movement. By starting with movement, students will immediately see the results of their programming efforts, fostering engagement and enthusiasm.
This step-by-step guide will cover adding motors to the chassis, installing the Arduino and L298 motor driver, completing the wiring as per the wiring diagram, and testing motor functionality. Students will test one motor at a time, ensuring it moves forward and backward, then proceed to test both motors together, verifying forward, backward, left, right, and rotational movements.
Mastering these basics will lay a solid foundation for more complex functionalities in subsequent stages.
You need the following components and parts to complete movement of the Robot.
This is a standard laser-cut chassis intended for mounting motors and other components.
Students have the option to drill holes for screws or use double-sided tape for assembly. The chassis material can be either cardboard or acrylic.
They will receive the Fusion 360 model if they wish to make modifications.
Alternatively, it may be included as part of a kit provided to them.
DC motors work by taking electrical power through direct current, and it converts that into mechanical rotation through the motor. You will use geared DC motors to move the robot's wheels at different speeds around a corner and at the same speed in a straight line so that the robot can travel on the line to a station.
The operating voltage is 3 to 6VDC. The load current is 70mA (250mA maximum). The gearing ratio may be 1:48 or 1:120.
Note: When using standard Arduino DC motors, it is imperative to ensure that wires are meticulously soldered onto the motor's thin tabs. Additionally, employing heat shrink tubing is recommended to reinforce these connections.
Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header and a reset button.
The DC Motor draws 70 to 250mA. The Arduino PWM output can only provide 20mA. Therefore, use the following motor driver.
The L298 is a dual full-bridge driver integrated circuit (IC) primarily designed to control DC motors.
It's commonly used in robotics, motor control applications, and other projects where controlling the speed and direction of DC motors is necessary.
The L298 IC can drive two DC motors simultaneously, with bidirectional control, meaning it can control the rotation direction as well as the speed of the motors. See How to Use a L298 Motor Driver for more information.
When assembling an Arduino robot, various miscellaneous items are crucial for a successful build. These include Dupont wires for flexible connections, screws and spacers to secure components, different gauges of wire for power and signal distribution, and heat shrink tubing for reinforcing and insulating connections, especially around motors and sensitive electronic components.
These components collectively ensure the reliability, efficiency, and durability of the robot's construction and functionality.
Assembling the movement components of an Arduino robot is a foundational step towards creating a functional and versatile robotic platform.
To ensure proper wiring and ease of assembly, it's beneficial to add wires to the motors before starting the assembly process, if this step hasn't been completed yet. This allows you to handle and position the motors more conveniently during installation on the chassis, ensuring secure connections and minimizing the risk of wiring issues later on.
See this video on the right to assemble the hardware.
By focusing on these hints specifically related to movement, you can ensure that the motion components of your Arduino robot are assembled correctly and function as intended.
Carefully assemble the robot, keeping the following in mind:
Motor Placement: Ensure motors are securely mounted on the chassis using the provided brackets, aligned properly with the wheels or other moving parts they drive.
Wheel Attachment: Attach wheels firmly to motor shafts or gearboxes using appropriate connectors or couplers to prevent slipping during operation.
Wiring Motors: use flexible wire to connect motors to the motor driver, following the wiring configurations below.
Motor Driver Setup: Configure the motor driver according to the motor specifications and Arduino compatibility, ensuring correct voltage and current settings.
Testing Movement: Test each motor individually to verify rotation direction and speed control using simple Arduino sketches or test scripts.
Securing Connections: Secure all wiring and connections with cable ties or adhesive mounts to prevent movement-induced disconnections or shorts.
Power Considerations: Ensure motors receive adequate power supply (voltage and current) to operate effectively without overloading the motor driver or Arduino board.
Fine-Tuning: Adjust motor positions, wheel alignment, and motor driver settings to achieve smooth movement and reliable operation of your robot.
Assembling the movement components of an Arduino robot is crucial for building a reliable and efficient robotic system.
Begin by carefully mounting motors on the chassis and securely attaching wheels to ensure stable movement.
Use the wiring diagram and table to guide the connection of motors to the motor driver and Arduino, ensuring correct alignment and polarity.
Incorporate Dupont wires to establish electrical connections to the Arduino pins. Test each motor individually to confirm proper rotation and functionality before proceeding.
Securing all connections with cable ties or adhesive mounts prevents accidental disconnections during operation.
By meticulously following the wiring diagram and assembly steps, enthusiasts and educators can create a well-structured Arduino robot capable of executing precise movements and navigating diverse environments.
First step is to test the left motor for speed and direction using this code:
digitalWrite( 7, HIGH);
digitalWrite( 6, LOW); // Swapping High and Low change direction
analogWrite (9, 160); // Speed 0 - to 255 (8 bit ADC)
Modify for the right wheel and test.
For movement you should create functions for each operation:
Forward
Backward
Turn Left
Turn Right
Rotate Left
Rotate Right
Create functions for various movements so it is easier to use it in the main loop. A good example is also to input variables for the speed so you have more control over the movement.
Example Code: