Introduction: Blockvader - May the Force Be With You

About: In my spare time, I fly RC airplanes and enjoy sharing my passion for learning how things work through my own instructional videos.

Over the years, I have seen many interesting 3D printed rover robot projects and I love how 3D printing technology has helped the robotic community to grown more diversity in design and material choices. I want to add a small contribution to the robotic community by publishing MrK_Blockvader on Instructable for the Maker Community.

MrK_Blockvader is a fun little robot with tiny buzzer, but don't let the blocky look fools you. He could be equipped with the color sensor, distance sensor, a radio module to communicate with other Blocky with alike capability, with a base or with a controller.

MrK_Blockvader will be part of a robot network where one can be assigned as the commander to a group of robots to archive the same objective.

Supplies

Step 1: 3D Printing

I use the CEL Robox 3D printer printed with carbon material for lightweight and durability. I will attach the STL files below. Please put on the comment if you have any questions regarding the 3D printing process and setting.

Step 2: Prepare the Arduino Nano

I have learned that perform prep work to all the electric components is key to a clean project.

This project includes wiring up the nRF24 breakout board, I have done this in a separate project calls NRF24 Wireless LED Box, this is where you can find the information on how to wire up the nRF24 breakout board to an Arduino.

Note: I use thicker 22AWG wire for powering the Nano and thin 26 AWG blue and black wires for all other signal purposes. I love these 26 AWG size wires, they are flexible but yet strong provide the best of both worlds.

  • Arduino Nano prep work:
  1. Solder the signal pin header to the Arduino Nano.
  2. Wet these pins with the solder will make the soldering much easier later.
  3. Solder a group of blue wire to the 5V to supply power to all the sensors and LEDs.
  4. Solder a group of black wire to the GND to provide ground to all the sensors and LEDs.
  • NRF 24 breakout board prep work:
  1. Solder 5 wires to the nRF24 breakout board for the signals.
  2. Solder 2 wires to the nRF24 breakout board for the power.
  3. Check the link to make sure how to wire the breakout board to an Arduino.
  4. Solder the signal 5 wires from the nRF24 to the Arduino Nana.
  • Buzzer prep work:
  1. Solder a black wire to one of the buzzer legs for ground.
  2. solder a blue wire to the other buzzer leg for signal control.
  • Photoresistor prep work:(diagram available)
  1. Solder a blue wire to one of the photoresistor leg for 5V.
  2. Solder a 10K resistor to the other leg of the photoresistor.
  3. Solder a blue wire between the 10K resistor and the photoresistor for the signal.
  4. Solder a black wire to the 10K resistor for ground.
  • LEDs prep work:
  1. Solder a blue wire from the positive right LED to the positive left LED.
  2. Solder a black wire from the negative right LED to the negative left LED.
  3. Solder a blue wire to the positive right LED for signal control.
  4. Solder a black wire to the negative right LED for ground.

Step 3: Prepare DC Motor, DC Motor Driver and Sensors.

The MrK_Blockvador has a couple of sensor options and the additional sensors do not affect the overall operational, however, the color sensor will not be able to install after the DC motor is glued in place.

  • DC motor prep work:
  1. Solder a black and a red wire to the DC motor.
  2. Wrap the end of the motor with lear tape.
  3. Fill the area with hot glue to seal the motor connectors.
  • DC motor driver prep work:
  1. Solder the 6 signal wires on the Motor Driver.
  2. Solder the signal wire to the correct pin on the Arduino Nano.
  3. Install the 12V wires to power the motor driver from the battery. Make sure you have the wires long enough to run it down under and out the back of the robot.
  4. Install the 5V wires to power the Arduino Nano from the motor driver.
  • Color Sensor prep work (optional):
  1. Solder the 2 wires for the signal.
  2. Solder the 2 wire for power.
  3. Solder the 1 wire to control the super bright LED.
  • Distance sensor prep work: (optional)
  1. Solder a blue wire for the signal.
  2. Solder another blue wire on the positive port for positive 3V.
  3. Solder a black wire for on the negative port for ground.

Step 4: Assemble

After all the prep work, now is the moment when things come together.

Note: I use hot glue for the DC motor and DC motor driver because hot glue can provide minor shock absorption and if you need to remove it, a little bit of rubbing alcohol will get the hot glue right off.

Assembling process:

  1. Hot glue the color sensor to the chassis and run the color sensor wire through the channel. (optional)
  2. Hot glue the DC motors to the chassis, make sure the DC motor sits flush with the chassis.
  3. Super glue Blocvader head to its chassis make sure all wires run through.
  4. Hot glue distance sensor. (optional)
  5. Hot glue LEDs for Blockvador eyes.
  6. Insert the DC motor wires to the DC motor driver all the way and screw-down firmly.
  7. Run the 12V power wires from the DC driver down under and out the back of the chassis for the on/off switch.
  8. Make sure all wires from all sensors are clear before glue down the DC motor driver.
  9. Upload test code and troubleshoot if there is any.

Step 5: Code

Basic Code:

The robot using its photoresistor and detecting the light level of the room and react if there a change of light level over time

The heart of the code:

void loop()
{
lightLevel = analogRead(Photo_Pin);
Serial.print("Light level: ");Serial.println(lightLevel);
Serial.print("Current light: ");Serial.println(Current_Light);
if (lightLevel >= 200){ Chill_mode();analogWrite(eyes_LED, 50);Serial.println("Chill mode");}
if (lightLevel < 180){ Active_mode();analogWrite(eyes_LED, 150);Serial.println("Active mode");}
}

The robot can be controlled using a controller and switching to partial autonomous mode using the controller.

The heart of the code:

void loop()
{
int debug = 0;

lightLevel = analogRead(Photo_Pin);
Dis = analogRead(Dis_Pin);

// Check whether there is data to be received
if (radio.available())
{
radio.read(&data, sizeof(Data_Package));

if ( data.C_mode == 0){Trim_Value = 10; Direct_drive();}
if ( data.C_mode == 1){Trim_Value = 0; Autonomous_mode();}
if ( data.C_mode == 2){Trim_Value = 0; Chill_mode();}

if(debug >= 1)
{
if (data.R_SJoy_State == 0){Serial.print("R_SJoy_State = HIGH; ");}
if (data.R_SJoy_State == 1){Serial.print("R_SJoy_State = LOW; ");}
if (data.S_Switch_State == 0){Serial.print("S_Switch_State = HIGH; ");}
if (data.S_Switch_State == 1){Serial.print("S_Switch_State = LOW; ");}
if (data.M_Switch_State == 0){Serial.println("M_Switch_State = HIGH");}
if (data.M_Switch_State == 1){Serial.println("M_Switch_State = LOW");}

Serial.print("\n");
Serial.print("Rover Mode: ");Serial.println(data.C_mode);
Serial.print("L_XJoy_Value= ");Serial.print(data.L_XJoy_Value);
Serial.print("; L_YJoy_Value= ");Serial.print(data.L_YJoy_Value);
Serial.print("; R_YJoy_Value= ");Serial.print(data.R_YJoy_Value);
Serial.print("; Throtle_Value= ");Serial.println(data.Throtle_Value);

delay(debug*10);
}
lastReceiveTime = millis(); // At this moment we have received the data
}
// Check whether we keep receving data, or we have a connection between the two modules
currentTime = millis();

if ( currentTime - lastReceiveTime > 1000 ) // If current time is more then 1 second since we have recived the last data,
{ //that means we have lost connection
resetData(); // If connection is lost, reset the data. It prevents unwanted behavior, for example if a drone has a throttle up and we lose connection, it can keep flying unless we reset the values
}

}

Step 6: What Next?

This project is the beginning of a larger project, where a network of these little guys works together to archive a common goal.

However, these robots would need to report their status to a communication station then this station would then combine all the reports from all the bots to then make a decision on what would be the next necessary action.

For that reason, the next phase of the project would be a controller to act as a communication station. This will help with developed the project further.

The controller itself is a robot, however, it is more passive than the Blockader. Therefore the controller desert its own instructable article, so tune in for a future project ;D

Arduino Contest 2020

Participated in the
Arduino Contest 2020