Portable Arduino Bot

by Khang Nguyen in Circuits > Arduino

7044 Views, 4 Favorites, 0 Comments

Portable Arduino Bot

7E9CB6D6-49C6-45F9-B722-3B46753D2212.jpeg
8EB3B98E-420F-4222-9B17-8F3133BBB919.jpeg
48032B09-F4A1-47C0-B56A-D107972501A5.jpeg
Portable Arduino Bot Assembly Video

Over the years, I have built many robotic projects and most of it run by an Arduino so let me explain a little bit about this amazing technology. Arduino is a microcontroller board, has up to 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs or more, this allows Arduino to read the input from sensors in the real world in real time and react accordingly by controlling a servo motor or DC motor.

During the programming phase of the project, sometimes I want to test out a new algorism during lunch break or I have some free time to mess around with the data but I do not want to carry the current project around due to its size or its stage of completion. There are many files on Thingiverse for Arduino cases, however, I don't want to wire an LED or a switch mess when I do some coding so that I can test the new code to see how it would work in the real world.

With that goal in mind, I have designed this Portable Arduino Bot. This robot is small, compact, durable and fully equid with LEDs, switch, buzzer, etc. you can also equip the bot with the sensor that would work with your project. I also want to encourage kids to program and what is a better way to do so by infusing the project with the Star War themes.

I will do my best so that if you have done Arduino project can just follow through with picture. I will also do my best to explain what I have done in words for those want to learn something about Arduino.

Supplies

1 Arduino Nano - link

1 600 mAh Venom Battery - link

1 Circuit Specialists Microswitch - link

1 Circuit Specialists On/Off switch - link

1 10K Ohm resistor - link

3 Adafruit LED - link

6 2x4 hex screw - link

3D Printing

A8359F61-66C2-4C4A-908C-212845AEFB2D.jpeg
586A316E-E4E1-4C07-929E-6CDFC49ED034.jpeg

All the STL files for this project will be included below, I will also share the setup and the type of material that I used in this project. The usage of different material may not gain the same result shown in the picture.

The Bot housing and the Bot's legs should be printed with support, however, since the support would only be internal this will keep the Bot look better when it has done.

I use CEL Robox 3D printer to print all parts for this project. All parts are printed with 30% fill, I use CEL PETG HD Glass Designer Gray, CEL PETG HD Glass Transparent Red.

Microswitch

6E075725-3A18-44BC-AB4D-094DD05E633A.jpeg
558480B8-3DB1-4229-BC8A-20FF5F5267BB.jpeg
520DD557-0439-4BFF-A52A-2F73C044CC16.jpeg
8D1A5906-557E-4B86-BEA8-4E8653593438.jpeg
D9C87647-03D6-43F0-96FC-AA78A9EBB860.jpeg

Microswitches have been around, however, it got its spotlight recently. Now we can find these microswitches in a 3D printer, robotic projects, vacuum robot, etc. One might argue that you don't need a switch for such a small project, however, I bet the different. A switch can be used for many purposes, it could be used as a representation for a sensor to test out, or a AI trainer ;D. I will talk about this AI trainer later.

At first, when I read about microswitches, I thought it would operate just like a normal on/off switch, I was wrong the microswitch require a little bit of work and not just a straight up plug and play. If you are new with all of these, do not worry I was new too if I can do it you can do it :).

From my own experience then the confusing part is that the switch has 3 legs, we only use 2, but at the end, we will have 3 wires come out from the switch. However, after many trial and error, I think I got it down and I will make sure it as straight forward as it can be. If you want to know more on how Microswitch work, I found this website to be trusted http://www.me.umn.edu/courses/me2011/arduino/technotes/microswitch/

The switch has 3 pins: C, N0, NC. We only use C and N0.

1. C for the ground wire

2. Read note before continuing: N0 will have 1 wire come out from it not 2. I have made this mistake many times and ended up with a bad signal. There is the main wire and a side wire, if you solder these 2 wire at N0, there will be a big chance that your signal will be unreadable or unstable.

3. The main wire will connect N0 to a 10K resistor, then after the 10K resistor will be the power source for the switch.

4. The side wire will be connected to the main wire which between the 10K resistor and N0. This is where we will collect our signal so that why it is important to keep the data line clean.

5. Glue the microswitch in place and make sure give it time to dry completely.

Legs LED

6095BBAD-F07B-4321-89C9-25D1D8A6C0A1.jpeg
C68B703A-794B-4FBF-A5D7-8BD37CC7A19A.jpeg
9A54ACA1-D7BE-4D5C-8AFC-3F09D532A111.jpeg
C18CFDBB-862C-4517-A4AA-895A23BDE559.jpeg

This is the true power of 3D printing. The legs have an internal chamber for the wire and the LED. One of the challenges in the design is that the legs are movable. 3D printing technology provides me with a neat solution where I have an internal chamber for the wire to run through.

I use Adafruit LED Sequins for its compact where the resistor is included on the board for maximum space efficiency. All we have to do is soldering a power and ground wire to the board. Heat wrapping the LED is optional however if you plane to have this project close to a running water source then heat wrapping is highly recommended.

1. Insert the LED into the leg

2. Glue the LED down, make sure the LED facing up for maximum illumination.

3. Insert Leg panel into each leg, this part is best to be printed with material that transparent where light can travel easily.

Installing the Leg

92377E80-36A2-49AD-BAD0-B331E910E70D.jpeg
C5530610-E92A-4A15-8CF1-506FBFF5423D.jpeg
8307D04A-2DE6-4B70-8829-D0134A6FA6CE.jpeg
FB57CABC-15D1-427B-AF07-2F23D0C9F84D.jpeg

I got these 5mm aluminum tubes from a local hobby shop. You can also 3D printed these peg or wood peg would work just fine.

1. Run the wires from each leg to the right section where it is going to house the Arduino Nano.

2. Make sure the legs move freely

On/off Switch

C16B6311-2962-4984-9B2D-A43966CB00C9.jpeg
8F02E8B4-06C7-41FF-9AEB-909E5D734F28.jpeg
43620518-63A2-4D44-92BD-F910A0E7DF5C.jpeg
E13D8EA9-0538-4299-9B60-61E469242490.jpeg

The on/off switch is a lot simpler than the microswitch. This type of switch act like a water gate we just have to connect the switch to the circuit series with the battery. The switch will then glue to the flip door.

Make sure you give it enough wire so that the flip door can be opened and close.

Please watch the assemble video for better understanding how to put the bot together.

Coding and Testing

0D64FE51-0C92-40DC-95B7-A40FEA3FBF9B.jpeg
5228E0B3-9687-44E2-B73E-524AD866E9B8.jpeg
41006EB7-38C5-468F-8DF7-9DE774C54F46.jpeg
02CF36EF-D98A-4237-B7DE-67EE4CC267FB.jpeg
D2A83868-0BAF-4B57-9A52-8CF19608D58D.jpeg

I would recommend uploading the PA_Calibration code on to the bot to test out the legs LED. This will make sure that we assign the correct pin number for the correct LED.

int ChestLED = 3 ;
int LLegLED  = 2 ;
int RLegLED  = 4 ;

int LED_INDEX[3]={3,2,4}; // Chest LED, Left Leg LED, Right Leg LED

The calibration code will blink the legs LED and chest LED, to test to make sure the pins are not switched, you can change HIGH to LOW to turn off the LED to double check.

void loop()
{
 digitalWrite(LED_INDEX[1], HIGH); //LOW
 digitalWrite(LED_INDEX[2], HIGH); //LOW
}

After calibration and double check, we can close the top and install the chest to the front, line up all the screws and connect the front and the back together with the 6 2mm hex screws.

The PAB_Basic code provides some more operate functions like: Blink Chest LED, Excited mode, Disco mode. You can try these modes out by uncommon one and common other. To have the bot do a different thing at a different time will require a bit more coding.

void loop()
{ 
XChestBlink(); 
//XExcited();
//XDisco();
}

The PAB_Randoaccordinglym code provides a random value where if you of the value assigned to an action the bot will react accordingly. By assign, a task with more value makes it more likely to happen.

int Randomness = random(1,600);
 if(Randomness == 150 ){XExcited();}
 if(Randomness == 250 ){XChestBlink();}
 if(Randomness == 350 ){XDisco();}
 if(Randomness == 450 ){XDisco();}
 if(Randomness == 550 ){XDisco();}

The randomness might be silly, however, it is a great representation for a random change in the environment like the sun got covered by cloud or moister change in the environment, etc. This is a key way to make this bot a testing platform for many science projects.

Finish Putting It Together, What Next?

8F1BE9F1-B98F-45FC-8591-42C21240295F.jpeg
210CC75B-BF73-42EC-BCE7-246308EB63FE.jpeg
60A6CD2D-75F5-47E2-9575-98F3E318507C.jpeg
62551EEA-DAE4-41BC-B79F-714232CA1A5F.jpeg
Portable Arduino Bot V1

The Bot can be used as it is as a portable testing platform, bring it with you as a piece of your sci-fi custom.
However, you can also install more sensors to fit your project. For example, one of my other PAB I install a buzzer with a 10K Ohm potentiometer. I was able to have the bot generate a random sound pattern, use the microswitch as input to train the bot to make a better sound pattern or sometime the Bot will sing the Star War themes song.

You can also go wireless, Circuit Specialist carries the ESP 32 Wifi & Bluetooth - link. This board requires extra knowledge on how to upload code on to the board, however, this board have built-in wi-fi and Bluetooth module and has the same dimension with the Arduino Nano so you don't need to much modify with the bot housing.