Page 1 of 1

Home Robot controlled with Rpi over Internet

Posted: Mon Apr 01, 2013 11:19 pm
by WakeUpNeo
Hello everyone,

I got my brand new Rpi Model B yesterday, installed Raspbian and necessary instructions successfully to be functional. I would like to do a robotics project as the title states. I've been searching this forum for accomplished projects similar to mine, and yet i don't have a clue about how it can be done exactly in the simplest way.

Here is my question ; i want a moving contrivance that has a wheels and servos on it, camera, sensors
(I have heat and ultrasonic ) integrated and i want to control all this system when i am outside the home via wi-fi module on pi. I want to move the vehicle with Up,Down keys on keyboard, see what's going on in my home with camera and heat, humidity :idea: :D .

So what do you suggest to do these instructions and what must i do step by step? If any completed projects exist, please paste their URL so i can draw inspiration ;)

Re: Home Robot controlled with Rpi over Internet

Posted: Tue Apr 09, 2013 1:29 am
by deefunkt
Hi there,

In order to control a motor (or two), you will need a H bridge circuit to save yourself from a burnt pi, since the pi on its own doesnt supply enough current to drive motors or servos, or much else, really. A H bridge looks like this: ... bridge.gif

Where A and B are inputs from your pi. This will let you control direction of the motor using 2 inputs. While you can build yourself one of these circuits, an easier option is to get an integrated circuit which performs a similar function, such as the L293D IC...doing a google search of it will get you a datasheet, which shows the internal circuit. This IC can control 2 motors, using 4 inputs from the Raspi, which is useful if you want a car-like robot with a drive axle powered by one motor, and steering by another motor

A good tutorial on how to interact with DC motors is on the Adafruit learning system: ... a-dc-motor

For servos, ... ervo-motor

You will soon find that you will run out of pins on the rpi's GPIO set, and you'll probably need to get an external expansion board.

To have a mobile robot, you will need a battery power supply (for initial prototypes, where the robot isnt going to move far, you can connect it to mains via an adapter and a long cord): ... 27d0708bc3

That one only supplies 1A max, and because its 2600mAh, doing the math, itl last about 2 hours at 1A, but thats in ideal conditions (assuming the seller's info is accurate). Since the Pi draws 700mA minimum, that leaves you 300mA to work with, which isnt really enough if you have things connected to your pi's USB ports....ANYWAY.

My reccommendation? Pull apart a toy RC car, and hi-jack its motors using the L293D chip. Chances are, you can use the car's power supply to power the IC.

Get this set up, so that your car can be programmed to move around on its own, have fun automating a 'robot' car first, then you can add in sensors which lets the car know where it is (ultrasonic sensor); you can then program in obstacle detection etc.

To access your raspi from your laptop or tablet, you can use SSH to tunnel in. ... -using-ssh

Hope I helped =)

Re: Home Robot controlled with Rpi over Internet

Posted: Tue Apr 09, 2013 10:13 pm
by WakeUpNeo
Thanks alot those you wrote down will be very helpfull especially the "mobilize" part at the bottom :)

Re: Home Robot controlled with Rpi over Internet

Posted: Wed Apr 10, 2013 6:13 pm
by WakeUpNeo
Hello again, as i mentioned before; i have heat sensor and i want it to work synchronously with my web page. I want to read the values with one second refresh timing on my web page. What changes i have to make with the python code that i use them to read values? Or are the addition codes should be on the .txt file which i use them for my simple website. How can i do that, which concept i should be looking for it? Thanks alot :)

Re: Home Robot controlled with Rpi over Internet

Posted: Fri Apr 12, 2013 1:22 pm
by deefunkt
Hi there,

So to confirm: you want to measure temperatures and update them on a webpage every 1 second?

You need to create an applet, maybe in java or something, because short of pressing refresh every 1 second, I'm not sure if HTML code provides a way of updating live information. I could be wrong; I'm no expert in HTML code.

As for the python script on the raspberry pi, you should be able to decrease the time interval between measurements relatively'll probably have a line where it says delay(--some number--) which you'll need to change to delay(1000) to mean 1000 milliseconds...but it'll depend on the code you're working with.