There are many types of robots, but they are essentially comprised of sensors, effectors/actuators, locomotion system, coputer systems, and controllers. A robot can extract information from its environment and use knowledge to move or it can live in the physical world and autonomously sense the environment around it and act upon it. Some examples of robots are humanoid robots, medical robots for surgery, and domestic robots such as autonomous cleaners.
Computer Science focuses on the development and testing of software and computational systems. Computer engineers work on desigining, planning, developing, and testing computer hardware. These engineers understand logic, system design, and computer interfacing to work on operating systems and software. The field of computer science is very broad and involves many topics ranging from articifical intelligence to information technology.
The Zumi AI robot is a self-driving car that uses sensors and cameras to navigate around it's surroundings using AI. Our team initially began by coding the Zumi robot using Python, but we realized that Blockly was simpler and quicker for this task. This project was a great way to learn more about how what AI is and how it works. The goal for this robot was for it to navigate a course that simulates exiting a damaged building.
One of the goals was to have the Zumi robot to steer clear from obstacles in it's pathway. This video shows the robot dodging a box of wires by changing it's direction when it senses something in front of it.
Here is the code that we made using Blockly. We programmed our Zumi Robot to reverse for 0.8 seconds and turn 30 degrees when the IR sensors got readings of objects in it's pathway.
Before working on our Ardunio Based Robot, our team used the SparkFun kit to learn more about autonomous robots, motors, and distance sensors.
Sparkfun Project 3B
Sparkfun Project 5A
Sparkfun Project 5C
Using the SparkFun Arduino kit our team built and programmed a robot that is able to follow a black line course on the ground. This type of robot is a RedBot that uses IR Reflectance sensors to detect characteristics about the surface below. The IR sensors emit beams of infrared light onto the surface below to measure the reflected signal. We learned that the IR sensors work better when they are closer to the surface below the RedBot as we ran into the issue that our sensors weren't low enough to the ground. Since the sensors weren't low enough, they were not able to illuminate the surafce below and measure the reflected light. Our team decided to weigh down the top of our robot by putting a phone on top, to push the sensors closer to the ground.
Here is the code that we wrote for our ardunio based robot. Essentially, when the sensor is on the black line then the sensor's LOW. When the sensor is on a white/pale surface then the sensor's HIGH. When both sesnors are low then the robot will move forward. When the left sensor is high and the right is low then the robot will turn left. Conversely, when the left sensor is low and the right one is high then the robot will turn right. Finally, when both sensors are high then the robot will stop moving.
Video of our robot detecting Henry
Our third project was to program a humanoid robot to locate and identify victims in a damaged building. The JD-Humanoid Robot features a lot of advanced robotic capabilities. Using built-in cameras it can recognize faces and it has a built-in speaker to talk, play music, and even play back our recorded voices. Our team was able to program our robot to recgonize human faces and once it detects one it says "I see you," waves, and walks towards the person. Here is a our JD-Humanoid Robot in action!
Example of our code
// Right motor (Motor A)
const int AIN1 = 13;
const int AIN2 = 12;
const int PWMA = 11;
// Left motor (Motor B)
const int PWMB = 10;
const int BIN2 = 9;
const int BIN1 = 8;
// Ultrasonic distance sensor
const int trigPin = 6;
const int echoPin = 5;
// On/Off switch
int switchPin = 7;
// Distance and behavior settings
float distance = 0;
int backupTime = 300; // milliseconds
int turnTime = 200; // milliseconds
const float distanceThreshold = 10.0; // inches
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(switchPin, INPUT_PULLUP);
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
pinMode(BIN1, OUTPUT);
pinMode(BIN2, OUTPUT);
pinMode(PWMB, OUTPUT);
Serial.begin(9600);
Serial.println("Robot initialized. Ready to explore!");
}
void loop() {
distance = getDistance();
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" in");
if (digitalRead(switchPin) == LOW) { // switch is ON
if (distance < distanceThreshold) {
Serial.println("Obstacle detected! Reversing and turning...");
rightMotor(0);
leftMotor(0);
delay(200);
rightMotor(-255);
leftMotor(-255);
delay(backupTime);
rightMotor(255);
leftMotor(-255);
delay(turnTime);
} else {
Serial.println("Clear path. Moving forward...");
rightMotor(255);
leftMotor(255);
}
} else {
Serial.println("Switch off. Motors stopped.");
rightMotor(0);
leftMotor(0);
}
delay(50); // brief pause between sensor checks
}
// MOTOR CONTROL FUNCTIONS
void rightMotor(int motorSpeed) {
if (motorSpeed > 0) {
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
} else if (motorSpeed < 0) {
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, HIGH);
} else {
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, LOW);
}
analogWrite(PWMA, abs(motorSpeed));
}
void leftMotor(int motorSpeed) {
if (motorSpeed > 0) {
digitalWrite(BIN1, HIGH);
digitalWrite(BIN2, LOW);
} else if (motorSpeed < 0) {
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, HIGH);
} else {
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, LOW);
}
analogWrite(PWMB, abs(motorSpeed));
}
// ULTRASONIC DISTANCE FUNCTION
float getDistance() {
float echoTime;
float calculatedDistance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2); // Ensure clean LOW pulse
digitalWrite(trigPin, HIGH);
delayMicroseconds(10); // Send 10 microsecond pulse
digitalWrite(trigPin, LOW);
echoTime = pulseIn(echoPin, HIGH, 30000); // Timeout after 30ms
if (echoTime == 0) {
Serial.println("Warning: No echo received.");
return 999.0; // No echo received
}
calculatedDistance = echoTime / 148.0; // Convert time to distance in inches
return calculatedDistance;
}
Tamiya Vehicle moving without sensors
Another example of the Tamiya driving without the sensors
Our group built and tried to program a Tamiya Track Vehicle to navigate a course that simulates exiting a damaged buildings. The Tamiya robot has Arduino, ultrasonic sensors, and bumper sensors. Additionally, our vehicle has a wooden chassis, a gearbox, tracks and their associated wheels and sprockets. The track vehicle is able to be built with two possible gear ratios, our team chose to use the high speed ration which is 58.2 : 1.
Readings we got from the Serial Monitor
Why we think our Tamiya bot didn't spin fast consistently
One of our biggest issues with the Tamiya bot was getting both wheels to spin consistently. We tried numerous codes, and tried debugging it many times, yet we still ran into the issue that the wheels would not spin consistently. Rather, the wheels would spin sporadically. Our team came to the conclusion that the issue must've been in the wiring so we rewired our whole circuit and again the wheels did not spin. If our team had more time we probably would've chosen different wires and parts for our circuit and made sure all of our connections were working.