“Neurobot 3” – Arduino Educational Robotics Kit, Autonomous / RC Controlled 3D Printer Model

License:
File formats: skp,stl
Download type: zip
Size:13.1MB

The file '“Neurobot 3” – Arduino Educational Robotics Kit, Autonomous / RC Controlled 3D Printer Model' is (skp,stl) file type, size is 13.1MB.

Summary

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
[email protected]
(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);
}

Angle_1x1_135degrees.skp 1.2MB
Angle_1x1_135degrees.stl 34.1KB
Knob.skp 1.4MB
Knob.stl 30.4KB
LCD_holder.skp 2.2MB
LCD_holder_back_rev3.stl 72.5KB
LCD_holder_front.stl 7.5KB
Line_11.skp 1.4MB
Line_11.stl 106.5KB
Line_1_13_LEDs_90_deg.stl 26.3KB
Line_3_13_LEDs_front.stl 73.5KB
Line_5.skp 1.6MB
Line_5.stl 57.7KB
Line_7.skp 1.3MB
Line_7.stl 73.7KB
Plate_5x11.skp 7.8MB
Plate_5x11.stl 494.8KB
Plate_7x11.skp 7.1MB
Plate_7x11.stl 682.3KB
ProximitySensorEnclosure.skp 2.6MB
ProximitySensorEnclosure_Back_vertical.stl 72.8KB
ProximitySensorEnclosure_Front_vertical.stl 13.2KB
Servo_holder_rev2.skp 1.7MB
Servo_holder_rev2.stl 67.4KB
Servo_holder_vertical.skp 4.6MB
Servo_holder_vertical.stl 92.7KB
Spacer_26mm.skp 1.1MB
Spacer_26mm.stl 9.5KB
SwitchHolder.skp 1.7MB
SwitchHolder.stl 50.7KB
SwitchHolder_Line_7.skp 1.4MB
SwitchHolder_Line_7_rev2.stl 75.1KB
Wheel_rev4.skp 1.5MB
Wheel_rev4.stl 209.6KB