"Neurobot 3" - Arduino Educational Robotics Kit, Autonomous / RC controlled

"Neurobot 3" - Arduino Educational Robotics Kit, Autonomous / RC controlled

Description

Hello World! :) My Name Is Nick Grigoryev, I Am A Professional Engineer, And I Love To Make Robots! I Created This Constructor Kit To Let Children To Learn The Code Of Arduino, To Prepare The Engineers Of Tomorrow. They Can Learn Ir Distance Sensing, Led Blinking (To Blink The Car Lights Is Much More Interesting, Than One Led), Servo Control, Gps Signal Acquiring And Processing, Lcd Screen, Piezoelectric Buzzers, Inertial Measurement Units, Etc. This Is A Third Version Of My "Neurobot 1" (Http://Www.Thingiverse.Com/Thing:1378603) With Lcd Screen, 3 Radars And Arduino Mega, But Without Raspberry Pi For Easier Assembly And Programming. It Is A Robot, Which Can Run In Autonomous Mode Or To Be Rc Controlled. It Runs Arduino Mega As A "Brain" And Three Ir Sensors (Distance 10-90 Cm) As His "Eyes". You Can Run Very Interesting Programs With "Adafruit Ultimate Gps Breakout" Sensor, Rtc (Real Time Clock) Etc., Installed On The Breadboard. To Assemble It, You Will Need To 3D-Print: Line_11 - 3 Pieces Line_7 - 1 Pieces Switchholder_Line7 - 1 Piece Plate_5X11 - 1 Piece Plate_7X11 - 1 Piece Servo_Holder - 4 Pieces Servo_Holder_Vertical - 3 Pieces Proximity_Sensor_Front - 3 Pieces Proximity_Sensor_Back - 3 Pieces Knob - 30 Pieces Line_3_13_Leds_Front - 2 Pieces Line_1_13_Leds_90_Deg - 2 Pieces Lcd_Holder_Front - 1 Piece Lcd_Holder_Back - 1 Piece Angle_1X1_135_Degrees - 2 Pieces Spacer_26Mm - 34 Pieces And You Will Need To Buy: Arduino Mega Or Uno - 1 Piece Sainsmart Servo Shield For Mega Or Uno - 1 Piece Lipo Battery - 1 Piece Lipo Checker - 1 Piece (Optional) 6 Volts Ubec - 1 Piece Sharp Ir Sensor - 3 Pieces 1/4 Inch Threaded Rod - 40 Inches, And Cut Them In Pieces: ...A) 106 Mm - 4 Pieces ...B) 98.5 Mm - 2 Pieces ...C) 91 Mm - 2 Pieces 1/4 Inch Nuts - 30 Pieces 6/32 Bolts 1-1/4 Length - 56 Pieces 6/32 Nuts - 56 Pieces Leds - 26 Pieces 220 Ohm Resistors - 8 Pieces Servo Extension Cable 30 Cm - 5 Pieces All The Links To Buy Them, Please See Here: Http://Www.Thingiverse.Com/Thing:1378603 (I Want To Keep One Updated List Of Things To Buy, To Keep The Order). If You Want, You Can Add Rc Control (I Usually Install Futaba Rx And Tx, But You Can Have It From Here If You Want: Http://Www.Hobbyking.Com/Hobbyking/Store/__190__190__Radios_Receivers.Html?Idcategory=190&Pc=). If You Want To Buy From Me This Kit Printed (All Parts Except Electronic Components Or All Components At Once), Please Write To My Email Below. Have Fun, I Hope, You Will Like It :) Nick Nikgrigoryev@Gmail.Com (C) Designed In California ******************************************************************* Program For Arduino: // (Uncomment These 3 Lines Of Code) #Include Servo.H // Includes Code Of "Servo Library", To Use The Servo Functions // #Include Liquidcrystal_I2C.H // Includes Standard Library To Manage Lcds // #Include Wire.H // Includes Library To Manage I2C Devices Servo Wheelservofrontpassengerside; // Creates Servo Objects To Control Four Wheels Servos Servo Wheelservorearpassengerside; Servo Wheelservofrontdriverside; Servo Wheelservoreardriverside; Servo Irservofront; // Creates Servo Objects To Control Three Ir Sensors Servos, Front, Left And Right Servo Irservoreardriver; Servo Irservorearpassenger; Liquidcrystal_I2C Lcd(0X27, 20, 4); // Creates Object "Lcd" On Address 0X27 For A 20 Chars And 4 Line Display Int Wheelservofrontpassengersidepin = 10; // Defines The Pin Numbers For Wheels Int Wheelservorearpassengersidepin = 9; Int Wheelservofrontdriversidepin = 11; Int Wheelservoreardriversidepin = 8; Int Irservofrontpin = 12; // Defines The Pin Numbers For Servos Which Turn Ir Sensors Int Irservoreardriverpin = 6; Int Irservorearpassengerpin = 5; Int Irfrontpin = A2; // Defines The Pins For Sharp Ir Distance Sensors Int Irpassengersidepin = A3; // Power Supply For Them Is Vc = 5V, Not 6V As For Hitec Servos Int Irdriversidepin = A1; Int Ledlightdriversidepin = 34; // Defines The Pins For Front Led Lights Int Ledlightpassengersidepin = 35; Void Setup() { Pinmode(Irfrontpin, Input); // Sets Pins Of Ir Distance Sensors In Input Mode Pinmode(Irpassengersidepin, Input); Pinmode(Irdriversidepin, Input); Pinmode(Ledlightdriversidepin, Output); // Sets Pins Of Front Led Lights In Output Mode Pinmode(Ledlightpassengersidepin, Output); Serial.Begin(9600); // Starts Serial Port At The Speed 9600 Baud Wire.Begin(); // Starts I2C Bus Lcd.Begin(); // Starts Lcd Object Wheelservofrontpassengerside.Attach(Wheelservofrontpassengersidepin); // Attaches Wheels Servos To Four Pins Wheelservorearpassengerside.Attach(Wheelservorearpassengersidepin); Wheelservofrontdriverside.Attach(Wheelservofrontdriversidepin); Wheelservoreardriverside.Attach(Wheelservoreardriversidepin); Irservofront.Attach(Irservofrontpin); // Attaches Ir Servos To Three Pins Irservoreardriver.Attach(Irservoreardriverpin); Irservorearpassenger.Attach(Irservorearpassengerpin); Wheelservofrontpassengerside.Write(93); // Sends The Signal To Wheels Servos To Stop Wheelservorearpassengerside.Write(93); Wheelservofrontdriverside.Write(93); Wheelservoreardriverside.Write(93); Digitalwrite(Ledlightdriversidepin, High); // Turns Led Lights On, Sending 5V To Leds Digitalwrite(Ledlightpassengersidepin, High); Irservofront.Write(90); Irservoreardriver.Write(171); Irservorearpassenger.Write(7); Lcd.Backlight(); // Turns On Backlight Lcd.Clear(); // Clears Lcd Lcd.Setcursor(7, 1); // Takes Cursor To Position 8 Of Line 2 Lcd.Print("Hello!"); Lcd.Setcursor(3, 2); Lcd.Print("Hulk Is Alive :)"); } Void Changespeedofwheels(Float A1, Float A2, Float B1, Float B2, Int Steptime, Int Cycletime) { A1 = -A1; A2 = -A2; B1 = -B1; B2 = -B2; Float An = A1; Float Bn = B1; Int N = (Int) (Cycletime / Steptime + 0.5); For (Int I = 1; I <= N; I++) { Int I_Want_Movement_Right = (Int) (An + 0.5); // This Is Real Movement, Range From -70 To +70 Int I_Want_Movement_Left = (Int) (Bn + 0.5); // This Is Real Movement, Range From -70 To +70 Int Pos_Right = -I_Want_Movement_Right + 90; // 60 Full Backward 120 Full Forward 90 Stop Int Pos_Left = I_Want_Movement_Left + 90; // 120 Full Backward 60 Full Forward 90 Stop Wheelservofrontpassengerside.Write(Pos_Right + 3); Wheelservorearpassengerside.Write(Pos_Right + 3); Wheelservofrontdriverside.Write(Pos_Left + 3); Wheelservoreardriverside.Write(Pos_Left + 3); An = (A2 - A1) / N + An; Bn = (B2 - B1) / N + Bn; Delay(Steptime); } Int I_Want_Movement_Right = A2; // This Is Real Movement, Range From -70 To +70 Int I_Want_Movement_Left = B2; // This Is Real Movement, Range From -70 To +70 Int Pos_Right = -I_Want_Movement_Right + 90; // 60 Full Backward 120 Full Forward 90 Stop Int Pos_Left = I_Want_Movement_Left + 90; // 120 Full Backward 60 Full Forward 90 Stop Wheelservofrontpassengerside.Write(Pos_Right + 3); Wheelservorearpassengerside.Write(Pos_Right + 3); Wheelservofrontdriverside.Write(Pos_Left + 3); Wheelservoreardriverside.Write(Pos_Left + 3); } Void Loop() { Delay(1000); Int Irfrontmassive[156]; // Declares 3 Massives For Front, Driver Side Int Irdrivermassive[159]; // And Passenger Side Semicircles Int Irpassengermassive[160]; For (Int I = 0; I <= 160; I++) { // Initialize Three Massives With Zeros Irfrontmassive[I] = 0; Irdrivermassive[I] = 0; Irpassengermassive[I] = 0; } Int Maxvectorfrontlength = 2000; // Starts The Vector Value With Closest Max Int Maxvectorfrontangle = 0; // Starts The Vector Angle With Zero Irservofront.Write(11); Delay(500); For (Int I = 11; I <= 167; I++) { // Fills Up The Front Distance Massive With Data From Front Ir Sensor Irservofront.Write(I); Delay (10); Irfrontmassive[I] = Analogread(Irfrontpin); If (Maxvectorfrontlength > Irfrontmassive[I]) { Maxvectorfrontlength = Irfrontmassive[I]; Maxvectorfrontangle = I; } } Irservofront.Write(90); Int Maxvectordriverlength = 2000; // Starts The Vector Value With Closest Max Int Maxvectordriverangle = 0; // Starts The Vector Angle With Zero Irservoreardriver.Write(12); Delay(500); For (Int I = 12; I <= 171; I++) { // Fills Up The Driver Side Distance Massive With Data From Driver Ir Sensor Irservoreardriver.Write(I); Delay (10); Irdrivermassive[I] = Analogread(Irdriversidepin); If (Maxvectordriverlength > Irdrivermassive[I]) { Maxvectordriverlength = Irdrivermassive[I]; Maxvectordriverangle = I; } } Irservoreardriver.Write(91); Int Maxvectorpassengerlength = 2000; // Starts The Vector Value With Closest Max Int Maxvectorpassengerangle = 0; // Starts The Vector Angle With Zero Irservorearpassenger.Write(7); Delay(500); For (Int I = 7; I <= 167; I++) { // Fills Up The Passenger Distance Massive With Data From Passenger Ir Sensor Irservorearpassenger.Write(I); Delay (10); Irpassengermassive[I] = Analogread(Irpassengersidepin); If (Maxvectorpassengerlength > Irpassengermassive[I]) { Maxvectorpassengerlength = Irpassengermassive[I]; Maxvectorpassengerangle = I; } } Irservorearpassenger.Write(88); Lcd.Clear(); // Clears Lcd Lcd.Setcursor(0, 0); // Takes Cursor To Position 1 Of Line 1 Lcd.Print("Front A="); Lcd.Print(Maxvectorfrontangle); Lcd.Setcursor(12, 0); Lcd.Print("L="); Lcd.Print(Maxvectorfrontlength); Lcd.Setcursor(0, 1); // Takes Cursor To Position 1 Of Line 2 Lcd.Print("Left A="); Lcd.Print(Maxvectordriverangle); Lcd.Setcursor(12, 1); Lcd.Print("L="); Lcd.Print(Maxvectordriverlength); Lcd.Setcursor(0, 2); // Takes Cursor To Position 1 Of Line 3 Lcd.Print("Right A="); Lcd.Print(Maxvectorpassengerangle); Lcd.Setcursor(12, 2); Lcd.Print("L="); Lcd.Print(Maxvectorpassengerlength); // Xxxxxxxxxxxxxx Now We Need To Choose The Maximum Vector By Length Out Of Three Int Maxvectorlength = Maxvectordriverlength; // Checks Which Vector Is Longer If (Maxvectorlength > Maxvectorfrontlength) { Maxvectorlength = Maxvectorfrontlength; } If (Maxvectorlength > Maxvectorpassengerlength) { Maxvectorlength = Maxvectorpassengerlength; } Int Maxvectorangle = Maxvectordriverangle - 180; // -180 ... +180 If (Maxvectorlength == Maxvectorfrontlength) { Maxvectorangle = Maxvectorfrontangle - 90; } If (Maxvectorlength == Maxvectorpassengerlength) { Maxvectorangle = Maxvectorpassengerangle; } // Xxxxxxxxxxxxx Now We Need To Turn The Car To The Angle And Go Length Of The Choosen Vector Int Timetoturn = Map(Maxvectorangle, -180, 180, -2200, 2200); Int Lengthtogo = Map(Maxvectorlength, 160, 30, 100, 1500); Lcd.Setcursor(0, 3); // Takes Cursor To Position 1 Of Line 3 Lcd.Print("Angle="); Lcd.Print(Maxvectorangle); Lcd.Setcursor(11, 3); Lcd.Print("Dist="); Lcd.Print(Lengthtogo); If (Timetoturn > 0) { Changespeedofwheels(-35, -35, 35, 35, 20, Timetoturn); Changespeedofwheels(-35, 0, 35, 0, 20, Timetoturn/3); Changespeedofwheels(0, 35, 0, 35, 20, Lengthtogo/6); Changespeedofwheels(35, 35, 35, 35, 20, Lengthtogo); Changespeedofwheels(35, 0, 35, 0, 20, Lengthtogo/6); } If (Timetoturn < 0) { Changespeedofwheels(35, 35, -35, -35, 20, -Timetoturn); Changespeedofwheels(35, 0, -35, 0, 20, -Timetoturn/3); Changespeedofwheels(0, 35, 0, 35, 20, Lengthtogo/6); Changespeedofwheels(35, 35, 35, 35, 20, Lengthtogo); Changespeedofwheels(35, 0, 35, 0, 20, Lengthtogo/6); } Delay(300); }

Statistics

Likes

360

Downloads

0

Category

Robotics