Fritzing Diagram

Fritzing Diagram

This is my Fritzing diagram for my RoverBot. I have made all attempts to ensure the standardisation of colour coding of my connections to the circuit board +5v is colour Red, Gnd is Black and the Data signals for the ultrasonic and line tracking sensors are orange and blue, and the H-bridge wiring for data signals to the Arduino are Blue, Purple and Green.

 

The connected pin numbers on the Arduino will be how I wire up my RoverBot and those same pin numbers will be used as the bases of my Arduino code. My variable settings will be as follows:

int lineL = 4; // Left line Tracker
int lineC = 3; // Center Line Tracker
int lineR = 2; // Right Line Tracker

int enableA = 13;      // Enable Motor A use pulse width modulation to change speed
int enableB = 5;       // Enable Motor B use pulse width modulation to change speed
int leftForward = 12;  // Left Motor Forward
int leftBackward = 11; // Left Motor Backward
int rightForward = 6;  // Right Motor Forward
int rigthBackward = 7; // Right Motor Backward

#define TRIGGER_PINL  A0  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PINL     A1  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define TRIGGER_PINC  A2  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PINC     A3  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define TRIGGER_PINR  A4  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PINR     A5  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200  // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
 
NewPing sonarLeft(TRIGGER_PINL, ECHO_PINL, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
NewPing sonarCenter(TRIGGER_PINC, ECHO_PINC, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
NewPing sonarRight(TRIGGER_PINR, ECHO_PINR, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

Leave a Reply

Your email address will not be published. Required fields are marked *

Post navigation

  Next Post :
Previous Post :