"Today's work (from Instructables) is a camera equipped with a camera and can be controlled by Wi-Fi. You can drive it through the Internet. This remote control car is particularly special because its" remote control "is a wireless router. Instead, we are familiar with the handle. Ok, the words are turned forward, follow me, familiar with the production steps.
Step 1: Set
This is a two-wheel drive remote control car
The front wheel is the steering wheel of the car
Two rear wheels and motors of the car are located in the back of the vehicle body
Step 2: Raw materials that need to be prepared
Compatible with OpenWRT routers, such as GL.Ineet 6416
Support USB Video Class camera, I am using Microsoft Lifecam HD-5000 with Auto Function
4 3.7 volts lithium-ion batteries (must buy a built-in protection circuit)
Compatible with Arduino system DIY smart car Chassis Kit 2 WD
L298N motor drive controller development board
Multi-function DIY DC pair DC converter
FTF DuPont Crossing Wire
MTF DuPont cross wire (20 cm)
The impedance is 47 ohms white LEDs.
Nuts and bolts.
Step 3: Schematic
As shown in the figure above, the wireless router acts as a central role that controls all parts. The webcam is connected to the wireless router by supporting the current media video, and the motor control panel is directly connected to the router through the General Enter Output Interface (GPIO), so that even if there is no remote control, we can control the car.
Step 4: Wireless router
In this project, I used the GL.Inet 6416A wireless router because it was very small (only 58 * 58 * 22 mm), and five interfaces on the fuselage were also very convenient.
If the storage space can pass, other routers that support OpenWRT can also be competent, you can find a list of routers that support the standard on the official website of OpenWRT.
The number of interfaces of most routers is slightly insufficient and cannot meet the needs of the control motor. You can use other pins similar to the LED PIN on the router, but you have to remove the LED interface module or manually control the LED.
Step 5: Webcam
I have a Microsoft HD-5000 camera on hand, which can record 720P video. However, the automatic focus of the camera is bored, this function is not significant, so it is simply turned off this feature. However, the camera still has to find a support for UVC.
Step 6: Motor control board
The motor is high than the current demand than the router. If you do not use the H bridge when you control the motor, it may cause damage to the router. I use the L298N motor drive control development board in the project to control the speed and direction of the two DC motors.
During the experiment, I found that there is a voltage drop of about 1.5 volts between the output voltages of the input voltage and L298.
Step 7: Multi-function DIY DC pairs DC converter (automatic boost boost)
This is a converter that can automatically buckstall, which has an output voltage amplitude, which allows the output voltage above or below the input voltage.
The advantage of the DC converter with the linear regulator is its conversion efficiency, which is more than 95%, so its energy consumption is much lower. To this end, I also made a simple experiment. I changed the output voltage of the module to 5 volts, and the input voltage was adjusted between 2 volts 24 volts, but regardless of the input voltage (unless the input is less than 2.6 volts). The output voltage is stable in 5 volts.
Step 8: Smart Car Chassis Kit
Chassis Kit is made of propylene material, with a size of 19.8 x 14.0 x 6.5 cm, which is much smarter than I think. The assembly process is not simple, I am scallting my brain to clear the location of each part, module, and equipment.
The kit contains two speed reduction motors, two plastic wheels, a battery holder that can accommodate 4 AA batteries, and there are two high-speed encoders, but we can't use them in this project.
According to the data on the GEARBEST.COM, the input voltage of the motor is 3 volts to 12 volts. The following is the other related information I found online.
It is recommended to work voltage of 6 to 8 volts.
When the voltage is 3V, its maximum torque can reach 800GF cm (about 78 Nm)
No air load speed up to 1:48
Load current is 70 mA (maximum 250 mA)
This is quite interesting, the two deceleration motors are very small, but the performance is strong, and even a plastic chair can be pushed.
Step 9: Battery and voltage problems
In the entire project, I used a 3.7 volt 18650 lithium-ion rechargeable battery in which two were connected in series, and the two pieces were used in parallel, so that the voltage increased to 7.4 volts. If the use or charging method is not properly, it may cause a battery explosion or fire, so I recommend everyone to buy a built-in protection circuit.
Since the input voltage of the motor can be variable, the remote control vehicle requires two different voltages, 5 volts support the wireless router, and other supplies to the motor.
Before assembled the remote control car, I order the Dual USB buck regulator module and DC pairs of DC converters (automatic boost bury). The former provides a stable 5 volt voltage through the USB line to the wireless router and the webcam, which will adjust the voltage to the size of the motor before the output.
During the test, I found that the input voltage of the motor cannot exceed 5 volts, otherwise the remote control speed will be too fast, or directly due to circuit protection.
Based on this test result, the Double USB buck pressure regulator module was discarded, and DC's DC converter was left by me, it could stabilize the output voltage at around 4.5 volts. In this way, the router and the camera voltage becomes 4.5 volts, and the two motors have only 3 volts input voltages.
Step 10: OpenWRT - Linux of the router
The GL.Inet wireless router is shipped with OpenWRT Barrier Braker software, which has a newly designed web interface where you can set it here. Please jump to http://192.168.8.1 and log in to your web account.
Also you can click on advanced options (or open http://192.168.8.1/cgi-bin/luci) to enter the traditional LUCI network interface for the router.
In the test I found that if you don't log in to the router, the video stream will not work properly, and I have to download the relevant file from the OpenWRT website and transfer it to the router.
If you haven't installed the firmware of OpenWRT on your router, please refer to the relevant tutorial and upgrade your firmware.
Step 11: Network connection
When installing the relevant software, the router needs a network connection, so you have to set the router first, the specific steps are here, you can set up the network for the router after learning. In addition, you can also create a new SSID for the router so that your various devices can connect to the Internet.
Step 12: Install additional software for routers
Under the default, OpenWRT includes some standard software, using them you can build wireless networks or add existing networks, but you need to install some additional software on the router. The following steps describe in detail the installation process of the software you need, if you don't have a camera or no video stream, this part can be skilled.
Use SSH to transfer the software to the router, then perform the following commands, and recommend the tool named PUTTY.
Before installing the software, you need to download packages in the current list from your local software library.
OPKG Update #Update List of Available Packages
For the camera, see the relevant tutorial.
Opkg install kmod-video-uvc #uvc Camera Driver
OPKG Install MJPG-streamer #stream Jpeg Files over an ip-based network
To turn on the video, edit the / etc / config / mjpg-streamer file, here I use the editing tool is WinSCP.
Config Mjpg-Streamer Core
Option enabled "1" "
Option device "/ dev / video0" "
Option resolution "" 640x480 ""
Option FPS "15" "
Option WWW "/ www / webcam" "
Option port "" 8080 ""
If you want to turn off or turn off the camera's auto focus, install UVCDynctrl.
OPKG Install UvcDynctrl
If you want to know the status of the camera, please install ISOF.
OPKG Install Lsof
To turn on a video, please restart the router.
/etc/init.d/mjpg-streamer enable
You can use the video feature after restart the router.
The following line command can temporarily turn off the autofocus function.
UVcDynctrl --set = 'focus, auto' 0
View the camera status through the LSOF command.
LSOF / DEV / VIDEO0
Step 13: Disable autofocus when starting
Save the following code to /etc/init.d/disableautofocus.
#! / bin / sh /etc/rc.common
START = 99
STOP = 15
START () {
UVcDynctrl --set = 'focus, auto' 0
}
STOP () {
Uvcdynctrl --set = 'focus, auto'
}
Set the file system permissions to 0755, you can also modify the permissions through WINSCP.
Chmod 0755 /etc/ininit.d/disableautofocus
You can turn off auto focus when needed.
/etc/init.d/disableautofocus start
Activate service self-start
/etc/init.d/disableautofocus enable
Step 14: Circuit diagram
Step 15: Source code
The core code of the project is written by Lua scripting language, and the web interface uses HTML and Java. The author has integrated all the files into a compressed package, please click here to download.
Lua is an explanatory language that modifications to scripts do not need to rebuild the entire project. Its code will be executed immediately after saving, so Lua is very convenient in upgrading and maintenance. If you are interested in Lua, you can read the following lua documents carefully.
/usr/lib/lua/gpio.lua
Control the reading and writing of various interfaces on the router.
/usr/lib/lua/2w_motor.lua
Work together with GPIO.lua, control two DC motors on the trolley.
/ WWW / CGI-BIN / Control
This program can be used as an interface between the browser and the router.
We mentioned that the writing of the web interface uses HTML and Java. If you want to develop your own interface, you can refer to the following documents.
/ www/car/index.html
The main program that loads an external JS & CSS file and implements an onClick event of the image.
/ www/car/pantilt.html
The main program can bring greater video resolution.
/ www/car/car.css
Control option layout, such as picture position, color, and font, etc.
/ www/car/car.js
This document contains some Java functions.
/ www / images
A folder filled with a picture on the web page.
/ www / codebase
This document contains a part of Java elements that developers can use it to make a slider.
Step 16: Software installation (1)
In fact, you don't need a hard installation software, just put them in the related folder of the router, in the project I use WINSCP to manage files and folders.
Winscp is a SFTP / FTP / WebDAV / SCP client under Windows, which you can use to transfer documents and management folders between computers and routers.
Seven: Software installation (2)
If you have WINSCP on your computer, you can decompress the downloaded document (2W_WIFI_CAR.ZIP) to your computer and transfer it to the corresponding folder on the router (shown in the figure above) .
Step 18: Software installation (3)
Documents named / www / cgi-bin / control require permission, modify its permissions to 0755 (RWXR-XR-X) (as shown above). As for the related steps of modifying permissions, you can refer to the relevant prompts for WINSCP.
Ninteenth step: pulse width modulation (PWM) - speed control
Gl.inet wireless routing uses an Atheros Ar9331 CPU, but it does not support pulse width in the hardware, and wants to implement this feature, only by installing related software.
After the kernel is upgraded to 3.14, many OpenWRT's software such as Barrier Breaker and Chaos Calmer no longer support the pulse width of the input and output interface. So you have to modify the firmware of OpenWRT in order to use the pulse wide-modified function.
I followed the tutorial to modify the firmware, but when I transferred the firmware to the router, it didn't touch the brick, and the router recovered more simple, it was really shocked me.
I went to my hand, GPIO-PWM-AR9331 is not short, I downloaded the first compiled version of the program and uploaded to my router, but the installation lack is always wrong, the displayed error message is as follows:
Installing KMOD-GPIO-PWM-AR9331 (3.10.49-1) to root ... Collected Errors:
* Satisfy_Dependencies_for: Cannot SATisfy The Following Deprondencies for KMOD-GPIO-PWM-AR9331: * KERNEL (= 3.10.49-1-69f3c9d824d79ff97e8c05f8219a41f3) *
* OPKG_INSTALL_CMD: Cannot Install Package KMOD-GPIO-PWM-AR9331.
Since then, I have repeatedly recompiled GPIO-PWM-AR9331 from the source code. This installation is successful, but it is completely unable to work.
So I found some software velocity width inverter tutorials from the Internet. After constantly testing, I finally succeeded, I hope not to have bugs during use.
But my worried still happened, the pulse width in the router was still abolished, I hope I can get this problem in the coming weeks. If you have any heights, I am listening.
20 steps: Try to control the vehicle
You can control the trolley with a web browser (don't use the evil IE, I recommend you to use Chrome) or Android app to control the car.
Open the browser and jump to http: // routerip / car / (typically http://192.168.8.1/car/) or http: //routerip/car/pantilt.html (such as: http: //192.168. 8.1 / car / pantilt.html).
Click the relevant button or use the keyboard to manipulate the school bus.
A key on the mad point keyboard can let the trolley run, loosen the button car will stop.
21 Step 21: Keyboard Shortcuts
Twenty-two steps: Wi-Fi remote control car is completed
My name is Wi-Fi remote control, I was born in Malaysia in October 2005. I can run it, I am strong and handsome, I am familiar with me, and you will fall in love with me.
Original link: https://www.eeboard.com/news/diy-wifi/
Search for the panel network, pay attention, daily update development board, intelligent hardware, open source hardware, activity and other information can make you master. Recommended attention!
[WeChat scanning picture can be paid directly] "
Our other product: