A Wifi controlled robot with camera
This page describes the construction of the WiFi RoboCam, a LEGO robot that uses a wireless camera and is controlled with a computer and an Arduino over wifi. The idea started as a hobby project, but was later used for the course Hardware Engineering of my ICT study.
The robot has the following functionalities:
- Controllable via internet from a browser
- Precision control with adjustable motor speeds
- A tiltable wireless camera
- Suspended bumper to protect against collisions
- A rotating light to announce it’s presence
- Large operating range through added antenna’s
RoboCam in action
Electrical wiring diagram
The IP camera and Arduino both work on 12 volt. They are powered by 12 AA 1,5 volt batteries, providing 18 volts. This voltage is lowered to 12 volts by a L7812CV voltage regulator. That way there will still be 12 volts for the camera, even when the batteries are running empty (thus supplying less then 1,5 volt each.
This diagram shows how each part communicates with the other parts.
This happens when the users clicks a button:
- The selected speed for both motors is send through a socket connection to the WiFly shield.
- The WiFly shield sends this command to the Arduino through a UART (serial) connection.
- The Arduino then translates the speeds to an Infra Red signal which is send to the PF IR Receiver
- The IR Receiver then makes the motors turn.
The idea for the design is illustrated by these 3D renders
Figuring out how software should work took about two weeks. The construction of the robot was done in one week. These photo’s show how.
The control panel is a html page with a MJPEG video stream and a Processing (Java) applet for controlling the robot. Each button on the applet indicates a direction for travel. Using the sliders allows the user to finetune the speed used for each direction. The arrows are to be held down, the robot will stop when the button is released. The smaller triangles are for movement in steps and cannot be held down. The buttons in the lower corners are for tilting the camera.
The source codes can be downloaded here:
These pages have proven to be useful:
Nice! How far can you drive before the robot loses connection? Or runs out of batteries, whichever comes first..
The operating range depends on the strength of the WiFi signal. Walls and other WiFi networks will decrease the range. During tests at my university it was able to drive about 25 meters from my router. (My university has a strong WiFi network causing interference.) The maximum range for WiFi 802.11g is 140 meters outdoors, although I haven’t tested it. The 12 batteries for the electronics last for about an hour, the lego battery box lasts longer.
I´m trying to do something similar to your project, and I´m having problems with my camera…
Could you please upload all files (including html server) or send them by email?
Sorry, this is a bit late, but I have added the webpage and applet to the source code now.
I encounter an error when compiling the applet with processing. It seems that the GUI uses a few png that wasn’t included such as controlpanelup.png. I just started doing the programming using your configuration and manage to get wifly and arduino up and running but only having problem with the GUI part.
Hope to hear from you soon regarding the issue mention above. Really appreciate you help and the guide above is very comprehensive!
I have added the images to the source codes. Good luck with your project!