raspberry pi robot

A simple web server based robot with camera and gripper

Its been 6 years since the i made the first version of this remote controlled robot.At the begining i used a raspbery pi 1 (the first version) and the first raspicam version1.
When rasberry pi A+ was released it was perfect for this project since it introduced lower power consumption and a smaller form factor.

Back then i`ve used a huge power bank for the raspberry pi and some aa NiMH batteries for the motors.The NiMH batteries are a nice way to power up toy motors and small servos , so in this remake i’ve decided to keep them since i never had an issue.

 

 

The previous version had some issues with the most irritating for me was its  computer  power bank battery life.It was just a mirracle if it worked for 7 hours
This ,of course , was not the only thing about the power bank (and im not taking the weight in consideration – it weighed 250gr)….

It had a special “feature” , lets say .. Every time you disconnected the charger from the power bank , it stopped working. This was a major problem since you could not use it to power the pi and charge it at the same time – basically you could charge it but it was not a good idea to disconnect when done without cutting the power to the raspberry pi.

I tried to hack the power bank , i failed .. Then i tried to set up a different procedure to power the pi while charging (using relays controlled by the GPIOs) , well.. it was a fuckin mess , Ehh whatever.. i just let it be.

So the years passed , 3d printers became cheaper , it was my turn to buy a cheap one (the best i could afford to tell you the truth..)

So after some tinkering (pun intented..) and some updates on the printing bed  i was ready to start the update i have been waiting for a long time.

 

 

I decided to keep the lower part of the robot the same, it was initialy a toy excavator so no need to make the whole thing over so i only had to design the upper body , the pan and tilt base for the camera and i always wanted it to have a arm and a gripper.I also would like a way to charge it while it works and since i always wanted to try wireless charging that was the chance to do it!

Fortunately when you are a complete noob and this is your first 3d design ever thinkiverse is your friend. After some days with tinkercad it was time to start searching for a pan and tilt mechanism.

It wasnt long since i`ve found this one
https://www.thingiverse.com/thing:708819

After printing it i then had to find some ideas for housing the raspicam.. Searching again in thingiverse i`ve stumpled upon this one which is pretty solid.
https://www.thingiverse.com/thing:1795957


Of course i needed some type of light in front of the camera so i decided to edit the bottom part of the housing i`ve downloaded from thingiverse and added some leds and some resistors in that box . I did my best to make it tidy and it looks like it will cut it.

 

 

Now it was time to start building the rest of the body..

 The most difficult thing was to decide the placement of the various parts and little boards. I had already tested the charging system , its just a tp4056 board for charging through usb , a small wireless charging module with its coal feeding the tp4056 and then a simple buck converter to power the pi. The whole thing is powered from a single 18650 cell 3350mAh .

This by its self is not able to give infinite battery life , so the wireless charger in a small dock will help maintain a charge when i need it to be online for some days.

Anyways , then it was time to decide the placement for the rasberry pi and the wifi board. The wifi board was from an old  broken laptop and since the space in there was kinda limited , i`ve just soldered it directly on the raspberry pi . Then the little board was hot glued on top of the usb connector

 

Things where moving faster now , it was time to decide the final details of the front body , i had to find a gripper.Again , thingiverse was the place to look.
This one was very tricky to decide. I knew where to place the arm and i knew how far it would reach , but i didnt want a huge arm hanging on top of the robot , or a sliding arm so i just took the a part of the pan and tilt mechanism , i reversed it so that the one servo was screwed on the front of the body .

After that things where kinda clearer. I`ve found a simple gripper and attached it on the reversed arm , extended a part and voila! It was just ok!

https://www.thingiverse.com/thing:2221019

This was all! Now the body was ready to the smallest detail , and it was time to put print , paint and put everything together.

This was simpler to say than done… First of all i was stupid enought to measure the hight of the board WITHOUT connecting the headers… This was a major bummer. Ok i just used an ancient floppy drive cable and moved the connectors to a small board.

Then the rasberry pi cable was not long enough…This was not a surprice and i`ve already purchaced a 30cm one ,,,, and it was kinda long.

I realy hate this cable.Its difficult to manage and its very sensitive also. After some time i managed to pack everithing and every cable inside the box  , closed and GLUED the lid (because i was such a noob that i wasnt able to design screw poles…) and thats it with the construction

After that its time for the software

Initially i`ve installed apache, setup php , installed wiring pi.
For video streaming i just used cvlc to stream to a specific port , so i can check though the net.

I`ve made a simple web page with php , where via ajax  fires up another php script that shell_execs a python script. To be able to do that you have to give to the “apache user” the right privileges to use the shell…. Yeap… I have to update the whole thing one day.

To tell you the truth i wont post any specific details..There are a thousand tutorials written from more able writers than me out there to accomplish  the above steps.

In the future i intent to use python for video streaming  and experiment with openCV …and probably do the whole thing over..

Anyway it was fun!