Wifi Camera Remote Control Car
by ColbyStudent in Circuits > Arduino
276 Views, 3 Favorites, 0 Comments
Wifi Camera Remote Control Car
The Wifi Camera Remote Control Car is designed to visual access in situations where human presence is either dangerous or difficult. This car allows a user to have remote access through wifi with a camera that connects to a phone app and motor control through keyboard clicks on a remote computer connected to wifi. This car could be useful in combat situations as well as campus tours during pandemics. This car can provide access when humans can't.
Supplies
- Plywood board
- Drill
- Zip ties
- Velcro
- Wifi Security Camera http://www.escam.cn/product/83-en.html
- 2 Motor Drivers https://www.amazon.com/SparkFun-Motor-Driver-TB6612FNG-Headers/dp/B07PV1S8HX/ref=asc_df_B07PV1S8HX/?tag=hyprod-20&linkCode=df0&hvadid=475752358038&hvpos=&hvnetw=g&hvrand=13561644510060006422&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9002848&hvtargid=pla-1189726705623&psc=1
- 4 dc motors https://www.adafruit.com/product/3777?gclid=CjwKCAiAh_GNBhAHEiwAjOh3ZCB5g9if8wssW8xHD0HaXZihspiqLff2lh1m-fFrsipLgKc4VYzMKBoC_AQQAvD_BwE
- 4 wheels https://www.adafruit.com/product/3766
- Two usb battery packs https://www.amazon.com/Miady-15000mAh-Portable-Charging-Compatible/dp/B083VYW2TM/ref=sr_1_14?crid=106LI4S41M7F6&keywords=usb+battery+pack&qid=1639792708&sprefix=usb+ba%2Caps%2C122&sr=8-14
- Adruino Nano 33 IoT https://store-usa.arduino.cc/products/arduino-nano-33-iot-with-headers?gclid=CjwKCAiAh_GNBhAHEiwAjOh3ZJJFcGgYu7YfnltUEogIWq4eTQhI1q6uCGa6lFr7nYQbyPSbBFa5mBoC3TEQAvD_BwE
- 6V battery source
- Micro usb cable
- Wire
- Soldering Iron
- 2 Prototyping boards
Software/Code
Software
- Arduino 1.8.5 - https://www.arduino.cc/en/software
- Python 3.7.4 - https://www.python.org/downloads/
Libraries needed for install:
For the first two libraries: (Sketch> Include Libraries > Manage Libraries)
-WIFINina library
-SAMD library
- For the Sparkfun library: (Sketch> Include Library > Add .Zip Library)
-Download from Repo:
-https://github.com/sparkfun/SparkFun_TB6612FNG_Arduino_Library/blob/master/src/SparkFun_TB6612.h
- Update Arduino Nano 33 Iot firmware: ( tools-> WIFI101/firmware updater)
Code
UDP_Server.py
UDP_client.py
last_project.ino
Circuit Diagram
Camera, Wheels and Board
- Board and Motors: The motors are mounted to a piece of plywood using zip ties. You need to drill two holes in each of the four corners of the board. Thread the zip ties through these holes and wrap them around the motors before tightening the zip ties. Once the motors are securely mounted attach the wheels by popping them onto the axels.
- Camera: To set up the camera follow the instructions in the box and download the CamHi app off the app store. Once you’re in the app connect the camera to the same wifi network that your device is connected to. This should be easy if you are on a home wifi network with a simple passcode. To attach the camera to the board you need to drill a hole through the board in the front middle or wherever you want your camera to be centered. Through this hole you can thread the included screw from the camera and screw it into the bottom of the camera into the tripod style mount.
Soldering
Soldering Arduino Nano Every
Following the techniques in this video and the circuit diagram from step 1:
- Solder the nano iot and one of the motor drivers to one of the prototyping boards
- Then solder the second motor driver to the second prototyping board.
Setup Code to Connect to Wifi
- Set up a hotspot or wifi network without multi-step or username/ password protection.
- Connect the computer to that network.
- Using the UDP_Server.py file, set up a server using a port number that will be shared between all the clients.
- Run the UDP_client.py file in order to connect the client to the udp server created in the previous step.
- Using the last_project.ino connect WIFI hotspot by putting the server name into the ssid[] variable and the password into the pass[] variable. Change the port number to the same port number as the two python files
Upload Program to Board
- Connect the board to a computer using a micro usb cable
- Open the program using arduino
- Click Tools->Port and select the USB option
- Then go to Tools->Board and select nano 33 iot
- Finally click the upload button on the program.
Operating Instructions
- Open two terminals on the computer and navigate to the directory where the files are stored.
-In one terminal run the script “python3 UDP_server.py” and in another terminal run “python3 UDP_client.py”
- In the terminal window with the client you can control the car using the WASD commands to move and the P key to break.
Improvements:
- Lighter chassis
- Faster wifi chip
- More voltage for motors
- More powerful motors
- Motor driver that drives four or more motors