Executive Summary
We designed a radio-controlled vehicle that uses an “active” suspension system, which detects liquid spills (e.g. Water, oil, etc.) in a transport container we created using a simple water sensor. The system is based on a 4-wheel/DC-motor chassis with many supplement components such as: two servos, an accelerometer, a water sensor, a passive suspension system (which entails a spring or rubber band) we designed ourselves, and an Arduino Mega 2560 micro-controller. We adding a platform on top of the chassis of the vehicle and stabilize it in order to be able to transport materials, by stabilizing the add platform we were able to protect the transport container from small vibrations from effecting the effectiveness of the transport of any material placed on the platform.
Our initial concept focused on the ability of the active suspension system with ground detection in a radio controlled car using an Arduino Mega 2560 to calculate the change of the platform. The Arduino uses an ultrasound PING sensor to detect the spread of vertical movement between the ground and the vehicle as well as ahead of the vehicle itself detecting ledges and holes. Then, the accelerometer z-axis value is compared between the initial state value and the new state value. Finally, the Arduino corrects the platform by adjusting the servos angles on the (x, z) and (y, z) planes. The PING sensor also focuses on edge detection, where the Arduino stops the vehicle when the ping sensor detects a high distance between the vehicle and the ground.
The vehicle solves for emergency and luxury freight handling of sensitive materials such as delicate glass, hazardous radioactive elements, etc. The water sensor provides a quick notification of any lost load, which can alert other people and vehicles, but is not required for the system to work.
Objective
In this project we aim to combine creativity with engineering aspects. By combining multiple sensors and motors with our design we where able to create a real practical vehicle that test different areas of the design. At first actually designing how we wanted this vehicle was very challenging due to the fact that we wanted a pivoting plate extending above the original chassis, which will have a certain range of movement. We succeeded with the design creating the complete design with our desire pivot point that shows the functionality of our design. We also learned that it is easier to drive 3 wheels instead of 4, which our design had 4 but by using a motor shield by Seed Studio, which is a flexible add-on for the Arduino. A motor shield allows easy control over every type of motor there is such as DC motors up to two, one stepper or a servo. During installation we realized that the motor shield had its own library, by having it’s own library we were not able to access simple functions in order to execute motion with the DC motors. We had to research motor shield and find its actual library and store it as a header file along with our code where the executed the movement of the motors. We aim to achieve complete functionality of our creative design will all components and sensors working cohesively together.
Background
Since we are both fans of the automotive industry this was the perfect project for us. Implementing hardware and software with an RC car to have a suspension function was quiet challenging in the beginning; the problem to solve was keeping the transport plate stable as the vehicle goes through all sort of rough terrain. We watched countless videos of the company BOSE new suspension idea and we took account and formed our idea based off that we have provide the link to an sample video below. The BOSE suspension was being experimented on sedans and was for drivers and passenger’s comfort and luxury it was a ridiculous idea but there are people who could appreciate such comfort. The sedan with BOSE suspension displayed would basic stay level no matter how many bumps to go over or if driven through a pot hold it was extremely leveled and the total opposite compared to traditional car suspension even luxury cars such as Mercedes’s Benz, BMW, Lexus or Infinite who has their own luxury suspension systems. We notice a fault in this type of suspension basically because of the improvement in the suspension system the performance of the car was decreases. As in how fast the car could around a corner, the new suspension system affected the centrifugal force of the car, say an average car could handle a curve at about 60 mph the improved suspension car by BOSE would only be able to safely take that very same corner at a much less speed approximately 30 miles less with this defect we has to take account in our application possible having to show the function of the vehicle at a slower pace to avoid unbalancing since this vehicle is intended to transport sensitive materials this is very ideal. We have never worked on a project such as this and we hope to succeed in controlling the vehicle by Bluetooth and showing the functionality of the vehicles suspension system.
Scope and Limitations of the Project
During this project we came across many issues, but was able to over come. Some of the issues had to do with these components: {Motors, Servos, Ping sensor, Bluetooth module, Code (Sketches), Accelerometer, water sensor}. Most issues we were able to solve except one or too that still lingers, since we are using four DC motors it was hard to give adequate power to each motor from the Arduino 5 V power supply it just wasn’t enough power so we had to simplify the motors and combine each side turning the four motor input into a 2 motor input the left and right side combine together. With the motor shield control the Pulse width modulation sending power to the motors we came to the conclusion that an external power supply was needed so we had a 9V battery pack and that solved the issue. As for the servos we had sufficient power we just needed the find the correct angles that was need to adjust the axis of the transport plate to keep the plate leveled to avoid spills. The ping sensor was quite easy once we had the code working we had done some ground testing to find out certain distance. Since the ping sensor will be used to detect the distance from the chassis to the ground we was able to do that. We stored that value in a variable and used it, as a default for the distance from the chassis to the ground was about 7 cm’s. The hardest part of this project was controlling the vehicle with the Bluetooth module; besides creating our designed vehicle it failed in comparison to getting the Bluetooth module to communicate with the arduino to relay commands to execute functions from our code. Using the software serial library we were able to set up communications but as for sending and receiving the Bluetooth module failed in that area.
Detailed Description
Our project function is to be able to safely transport sensitive materials either liquid or solid objects securely over different types of terrain such as hills going up or downward as well as detecting ledges and holes using the ultra sonic sensor to determine the distant from the chassis to the ground, saving that value of that distance and using it to differentiate the difference between a upward hill, downward hill or if the distance received by the ultrasonic senor is an extremely large value it will consider the terrain to be unsafe to travel with transport and stop immediately then either going right or left if chosen path is much more safer. While going up or down a hill like situation that we created the vehicle would automatically be at a certain angle with the (x, y, z) planes which we stored the stabilized values of there planes in different variables using the accelerometer and passed them through a function to keep the calibrations. So if the vehicle was going up a hill detected by the ping sensor based on the stored ground distance and comparing it to the new detected value it will be determined as a upward hill and as the vehicle climbs up the material being transported will be at risk of spilling or falling over so to prevent that using the values we passed in the recalibration function and with two servos, one to control the (x, y) axis and the second to control the z-axis we should be able to change the top transport plate to stay leveled at all times even in such situations as an upward hill or downward hill. Then once the vehicle is leveled again the servos are supposed to reset the top transport plate since the (x, y, z) axis is at their stabled state.
Since we measured the distance from the chassis to the ground using the ping sensor we received a distance of 7 cm’s. With that value saved we used it to compare with different functionalities such as how high of a hill the vehicle can climb or how low of a hill can the vehicle drive down. With does variables we were able to determine what will be safe for the vehicle to process by using selection statements we compared if the sensor is sensing values way larger than the stored value for example (sensor Distance >= ground distance value + 10) in centimeter, the vehicle will immediately stop due to the unsafe terrain to transport. The vehicle will then redirection it self to a different and safer path. Another cool function is a water spill detection system, if the vehicle is transporting liquids there is a water module senor that will read any spills in the transport container. The water sensor is set to test for water spills every couple of seconds if the test comes back positive for water defected a buzzer will sound, if the buzzer goes off the three consecutive times the buzzer will sound continuously to alert personnel’s there is a spill and the vehicle will stop.
System Design
The Arduino Mega 2560 is a microcontroller board based on the ATmega2560 (datasheet). It has 54 digital input/output pins (of which 14 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. The Mega is compatible with most shields designed for the Arduino Duemilanove or Diecimila.
Capabilities, Qualifications and Participation of Team Members
- Mikhail Bennett (13148438)
-In charge of documentation, researched every component being used.
– Software Development: sketch’s for various arduino components
-Tester
- O’Neill Champagnie (23023386)
-Designer / builder
– Software Development: sketch’s for various arduino components
-tester
Testing Results and Analysis
We succeeded with the design creating the complete design with our desire pivot point that shows the functionality of our design. We also learned that it is easier to drive 3 wheels instead of 4, which our design had 4 but by using a motor shield by Seed Studio, which is a flexible add-on for the Arduino. A motor shield allows easy control over every type of motor there is such as DC motors up to two, one stepper or a servo. During installation we realized that the motor shield had its own library, by having it’s own library we were not able to access simple functions in order to execute motion with the DC motors. We had to research motor shield and find its actual library and store it as a header file along with our code where the executed the movement of the motors. We aim to achieve complete functionality of our creative design will all components and sensors working cohesively together.
Conclusions (and Future Work)
This project was fun we faced many barriers and over came many as well. Ultimately the main issue we had was interfacing the Bluetooth into with our vehicle to have control with and android app there seem to be a problem with the communications over the serial pins. For future reference I believe we should possible use a controller to have complete control over the vehicle it would be a more stable way to interact with the vehicle. I believe this will be more work but more reliable hence fourth a better option.
References
List all the references following the APA style. The Newer versions of MSWORD provide some tools to mage references. The following links show the guidelines for the APA style.
Reference list:
-http://www.arduino.cc/en/Reference/Libraries
-https://www.youtube.com/watch?v=eSi6J-QK1lw
-http://www.cplusplus.com/reference/
http://www.mantech.co.za/datasheets/products/A000047.pdf
Electronic sources:
–https://owl.english.purdue.edu/owl/resource/560/10/
–https://www.draw.io
Source Code
#include <SoftwareSerial.h>
#include “MotorDriver.h”
#include <Servo.h>
#define ACCELX A0
#define ACCELY A1
#define ACCELZ A2
#define WTRSENSE A3
#define BUZZSTATUS 39
#define TRIG 2 /* Trigger pin is connected to pin 2 */
#define ECHO 3 /* Echo is connected to pin 3*/
#define PULSE 10 /* Milliseconds low*/
#define PAUSE 15 /* Milliseconds PAUSE to reset trigger pin*/
#define WAIT 2 /* Pause before pulsing */
#define grndVal 4
Servo ServoA ;
Servo ServoB ;
SoftwareSerial BTSerial (18, 19);
void AccelStatus(int AccelX, int AccelY, int AccelZ) {
int i, j, k;
i = analogRead(AccelX);
j = analogRead(AccelY);
k = analogRead(AccelZ);
Serial.print(“Accelrometer Value of X is: “);
Serial.println(i);
Serial.print(“Accelrometer Value of Y is: “);
Serial.println(j);
Serial.print(“Accelrometer Value of Z is: “);
Serial.println(k);
}
void WaterLevelStatus (int WaterLevel, int BuzzerPin) {
int i;
i = analogRead(WaterLevel);
Serial.print(“Water Sensor Detects this number: “);
Serial.println(i);
while (i < 200) {
digitalWrite(BuzzerPin, HIGH);
delay(PAUSE) ;
digitalWrite(BuzzerPin, HIGH);
delay(PAUSE) ;
digitalWrite(BuzzerPin, HIGH);
delay(PAUSE) ;
Serial.println(“Possible Water Leakage”);
return;
}
}
/* single program for motor control
Author: Mikhail Bennett
Revision: Oneill Champagnie
Created Date: 02/27/2015
Modified Date: 05/10/2015
*/
#define BAUD 115200 /*Fastest Serial Monitor for Print-Out Messages*/
#define PAUSE 0
int d[3] = {analogRead(ACCELX), analogRead(ACCELY), analogRead(ACCELZ)};
int a[3] = {0,0,0};
void checkLevelStatus (int AccelX, int AccelY, int AccelZ, int CAccelX, int CAccelY, int CAccelZ)
{
if (AccelX > CAccelX)
{
int p = 1;
for (p; AccelX > CAccelX; p–);
{
ServoA.write(p);
ServoB.write(p);
return ;
}
}
else (AccelX > CAccelX); {
int i = 1;
for (i; AccelX != CAccelX; i++) {
ServoA.write(i);
ServoB.write(i);
return ;
};
if (AccelY > CAccelY)
{
//Code to compare Accelerometer X : Needs number from calibration}
int p = 1;
for (p; AccelY > CAccelY; p–);
{
ServoA.write(p);
ServoB.write(p);
return ;
}
} else (AccelY < CAccelY); {
int i = 1;
for (i; AccelY != CAccelY; i++) {
ServoA.write(i);
ServoB.write(i);
return ;
};
if (AccelZ > CAccelZ)
{
//Code to compare Accelerometer X : Needs number from calibration
int p = 1;
for (p; AccelZ != CAccelZ; p–);
{
ServoA.write(p);
ServoB.write(p);
return ;
}
} else (AccelZ < CAccelZ); {
int i = 1;
for (i; AccelZ != CAccelZ; i++) {
ServoA.write(i);
ServoB.write(i);
return ;
};
}
}
}
}
void Movement(int mvedir)
{
switch (mvedir)
{
case 8:
Serial.println(“Motor is ON”);
motordriver.goForward();
delay(500);
break;
case 6:
Serial.println(“Vehicle is turning RIGHT”);
motordriver.goRight();
delay(500);
break;
case 4:
Serial.println(“Vehicle is turning LEFT”);
/*Turn LEFT*/
motordriver.goLeft();
delay(500);
break;
case 2:
Serial.println(“Vehicle is STOPPED”);
motordriver.stop();
delay(500);
break;
}
}
void setup() {
motordriver.init();
Serial.begin(BAUD);
motordriver.setSpeed(1000, MOTORB);
motordriver.setSpeed(1000, MOTORA);
ServoA.attach(7);
ServoB.attach(6);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(BUZZSTATUS, OUTPUT);
pinMode(ACCELX, INPUT);
pinMode(ACCELY, INPUT);
pinMode(ACCELZ, INPUT);
int a[3] = {d[3]};
pinMode(TRIG, OUTPUT); /* Sets trigger pin to output */
pinMode(ECHO, INPUT); /* Sets echo pin to input */
Serial.println(“Ultrasonic tranducer range finder”);
}
void loop () {
int d[3] = {analogRead(ACCELX), analogRead(ACCELY), analogRead(ACCELZ)};
AccelStatus(d[0], d[1], d[2]);
checkLevelStatus(d[0], d[1], d[2], a[0], a[1], a[3]);
pingStatus();
}
/*
UltraSonic Sensor code
*/
//#include <MotorDriver.h> /*motor shield library*/
#define TRIG 2 /* Trigger pin is connected to pin 2 */
#define ECHO 3 /* Echo is connected to pin 3*/
#define PULSE 10 /* Milliseconds low*/
#define PAUSE 15 /* Milliseconds PAUSE to reset trigger pin*/
#define WAIT 2 /* Pause before pulsing */
#define grndVal 10 // << change to const variable to set ground distance from MTV
long unsigned int duration = 0, inches = 0, cm = 0;
long unsigned int ObjDistance = 0, ObjHeight = 0, grnd_Distance = 0;
// where main codes executes
void pingStatus() {
/* Pulses the trigger of the ultra sonic sensor or range finder */
digitalWrite(TRIG, LOW); // makes sure trigger is set to low
delayMicroseconds(WAIT); // this is a nessecary wait for successful sensor operation
digitalWrite(TRIG, HIGH); /* Set trigger to high to send pulse */
delayMicroseconds(PULSE); /* sends a semi high pulse wait needed to allow succesful pinging */
digitalWrite(TRIG, LOW); /* sets the trigger to low to prepare for echo */
duration = pulseIn(ECHO, HIGH); /* sets time signal on echo pin */
grnd_Distance = duration; // saves distance to floor
inches = (( grnd_Distance / 74) / 2); // distance in inches
cm = (( grnd_Distance / 29.1) / 2); /* Distance in cm */
/* Serial monitor output to check ground distance */
Serial.println (“Ground Distance” );
Serial.println ( “Distance to Ground: ” );
Serial.print (cm);
Serial.print (” cm”); // print out distance of obstacle in centimeters.
Serial.println(“n”);
// selection statements to check for obstacles and the height
if (grnd_Distance < grndVal) {
ObjHeight = (grndVal – grnd_Distance); // assign real time object height
Serial.println (” There is a Obstacle in the path !”);
Serial.println (” The obstacle Height: “);
Serial.print (ObjHeight);
}
else if (grnd_Distance > grndVal) {
// stop all motors we are at the end of the road!
// motordriver.stop();
delay(5);
Serial.println(” Hit the Brakes we are at the end of the Road!”);
//motordriver.goRight();
}
else {
Serial.println (” No objtacles detected path is clear!” );
delay(PAUSE);
}
delay(1000); // wait 1 second before next pulse