LDSR (Life Detecting Space Rover)
by Kannan619 in Circuits > Robots
920 Views, 60 Favorites, 0 Comments
LDSR (Life Detecting Space Rover)
Space :it is a world of wonders...All stars ,planets,black holes etc are there....
Today we are making a space rover..Aim of it is finding life on planets.my rover has too many features but now i am tell here a few thing on it,because i wish all the begginer can making this . Here I am giving the idea. and will show you this project.
I don't tell To follow the same procedures.because i am making this rover with some waste maetrial on my home.
you can build it platform using good cardboard or something else...So i am giving just a model of it.You can build it with your wish...Lets start
Supplies
- node mcu
- l298n driver module
- battery 2.2A
- bo motor and wheel
- pir sensor
- arduino ide
- screw driver
- player
The tools and screw platform you can change if you want because it is a just a model
NodeMCU
here this is the code for node mcu.node mcu used for the movement of rover
#define ENA 14 // Enable/speed motors Right
#define ENB 12 // Enable/speed motors Left GPIO12(D6)
#define IN_1 15 // L298N in1 motors Right GPIO15(D8)
#define IN_2 13 // L298N in2 motors Right GPIO13(D7)
#define IN_3 2 // L298N in3 motors Left GPIO2(D4)
#define IN_4 0 // L298N in4 motors Left
#include
#include
#include
String command;
int speedCar = 800;
int speed_Coeff = 3;
const char* ssid = "NodeMCU Car";
ESP8266WebServer server(80);
void setup()
{
pinMode(ENA, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(IN_1, OUTPUT);
pinMode(IN_2, OUTPUT);
pinMode(IN_3, OUTPUT);
pinMode(IN_4, OUTPUT);
Serial.begin(115200);
// Connecting WiFi
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
// Starting WEB-server
server.on ( "/", HTTP_handleRoot );
server.onNotFound ( HTTP_handleRoot );
server.begin();
}
void goAhead()
{
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, HIGH);
analogWrite(ENA, speedCar);
digitalWrite(IN_3, LOW);
digitalWrite(IN_4, HIGH);
analogWrite(ENB, speedCar);
}
void goBack(){
digitalWrite(IN_1, HIGH);
digitalWrite(IN_2, LOW);
analogWrite(ENA, speedCar);
digitalWrite(IN_3, HIGH);
digitalWrite(IN_4, LOW);
analogWrite(ENB, speedCar);
}
void goRight(){
digitalWrite(IN_1, HIGH);
digitalWrite(IN_2, LOW);
analogWrite(ENA, speedCar);
digitalWrite(IN_3, LOW);
digitalWrite(IN_4, HIGH);
analogWrite(ENB, speedCar);
}
void goLeft(){
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, HIGH);
analogWrite(ENA, speedCar);
digitalWrite(IN_3, HIGH);
digitalWrite(IN_4, LOW);
analogWrite(ENB, speedCar);
}
void goAheadRight(){
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, HIGH);
analogWrite(ENA, speedCar/speed_Coeff);
digitalWrite(IN_3, LOW);
digitalWrite(IN_4, HIGH);
analogWrite(ENB, speedCar);
}
void goAheadLeft(){
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, HIGH);
analogWrite(ENA, speedCar);
digitalWrite(IN_3, LOW);
digitalWrite(IN_4, HIGH);
analogWrite(ENB, speedCar/speed_Coeff);
}
void goBackRight(){
digitalWrite(IN_1, HIGH);
digitalWrite(IN_2, LOW);
analogWrite(ENA, speedCar/speed_Coeff);
digitalWrite(IN_3, HIGH);
digitalWrite(IN_4, LOW);
analogWrite(ENB, speedCar);
}
void goBackLeft(){
digitalWrite(IN_1, HIGH);
digitalWrite(IN_2, LOW);
analogWrite(ENA, speedCar);
digitalWrite(IN_3, HIGH);
digitalWrite(IN_4, LOW);
analogWrite(ENB, speedCar/speed_Coeff);
}
void stopRobot(){
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, LOW);
analogWrite(ENA, speedCar);
digitalWrite(IN_3, LOW);
digitalWrite(IN_4, LOW);
analogWrite(ENB, speedCar);
}
void loop() {
server.handleClient();
command = server.arg("State");
if (command == "F") goAhead();
else if (command == "B") goBack();
else if (command == "L") goLeft();
else if (command == "R") goRight();
else if (command == "I") goAheadRight();
else if (command == "G") goAheadLeft();
else if (command == "J") goBackRight();
else if (command == "H") goBackLeft();
else if (command == "0") speedCar = 400;
else if (command == "1") speedCar = 470;
else if (command == "2") speedCar = 540;
else if (command == "3") speedCar = 610;
else if (command == "4") speedCar = 680;
else if (command == "5") speedCar = 750;
else if (command == "6") speedCar = 820;
else if (command == "7") speedCar = 890;
else if (command == "8") speedCar = 960;
else if (command == "9") speedCar = 1023;
else if (command == "S") stopRobot();
}
void HTTP_handleRoot(void) {
if( server.hasArg("State") )
{ Serial.println(server.arg("State"));
} server.send ( 200, "text/html", "" );
delay(1);
}
After uploading press the reset button for working properly.Select board as show in picture
PIR Sensor and Solar Panel
PIR sensor code
int LED = 13;
int PIR = 2;
void setup()
{
pinMode(LED, OUTPUT);
pinMode(PIR, INPUT);
Serial.begin(9600);
}
void loop()
{
if (digitalRead(PIR) == HIGH);
{ digitalWrite(LED, HIGH);
Serial.println("life detected!");
delay(100);
}
else
{ digitalWrite(LED, LOW);
Serial.println("Life Not detected!");
delay(100);
} }
Important thing PIR sensor has take some time to calibrate so it not work well at starting time.After calibrating time you can chance it
led is connectedd to 13 th of digitalpin amd pir sensor is connected to 2 of angalog pin.After it led asigned as OUTPUT and PIR as input and established serial connection.then if the value of pir is high.it detect Life otherwise not detected.It is meaing of program
you can connect solar panel in battery for charge it .because in space major soucres of energy is sun light
The Model of My Rover
I already Told you that i Add a few things in it .you can add more thing to it .If i add all the features my small brother and friends and all the begginers they can't make it .So i think this project can made begginers also.