This article mainly describes the use of Raspberry Pi and L298N to make a simple remote control car, the remote control is implemented using a simple WEB.
Ready to work
Raspberry Pi, (this article uses Raspberry PI 2 B, ie 2B)
List of SD cards available and unavailable on 8G and above TF card Raspberry Pi
Four-wheel drive car bottom (including motor, Note: The car chassis in this article is wearing a high-torque DC motor)
Mother to mother, male to female, male to male (not available) DuPont line
L298N dual HD bridge motor driver board
Wireless network card (preferably support AP)
Rechargeable battery pack (more than 7V, Ni-MH or 18650 rechargeable battery)
System installation nothing to say, the system burned to SD can be, I use Raspbian, this product is based on Debian, configuration command habits almost the same as ubuntu/debian, connect the Internet cable into the system configuration.
Put in the source of the Chinese University of Science and Technology, and then apt-get update once;
Set a password for the root user;
There are two options for configuring a wireless network card. Edit /etc/network/interface. There are quite a lot of online tutorials:
Automatically connect to the router, there is a wireless router at home, and the car is covered by WIFI;
The Raspberry Pi built a WIFI hotspot, the signal is better, you can open it in the community, by the way, hook up the sister, oh oh, no, it should be naughty children. The only thing that needs attention is the NIC chip.
There is no difficulty in assembling, the kraft paper on the acrylic board is so mad, the horse egg, it took a while to tear it off (âŠ™_âŠ™)b;
The motor was quite pitted, and the bare wire was bare-metal. It didn't happen to have a soldering iron in the hand. I was forced at that time. Well, there are extra male DuPont lines in the hands, unplug one of the joints, burn it with a lighter (the magical skills learned when you were young), and unplug a part to tighten the copper wire. Finally, the copper wire passes through the small hole in the motor interface and is tightened. Hey, no tape, and finally use the transparent glue to make up, tie tight. Repeat 4 times.
+5V~+35V, if you need to take power inside the board, the power supply range is Vs: +7V~+35V
OUT1 and OUT2 are motor A outputs; OUT3 and OUT4 are motor B outputs
ENA and ENA are the enable terminals of the A and B motors respectively. At the beginning, the upper and lower pins of ENA and ENB are connected by jumper caps, and they can be connected by unplugging. IN1-IN4 is the IO control input.
After understanding L298N, the connection is much more convenient.
OUT1 OUT2 Connect the front and rear two motors (parallel) on the left side of the car. Before the motor is connected, the DuPont line male plugs directly into the interface (simply shy) and tightens the screws. Similarly, OUT3 OUT4 connects the front and rear two motors of the car. ;
The anode and cathode of the cheap Ni-MH battery pack are connected to 12V and GND respectively. The connector of the battery pack is JST female, which is better to connect;
5V and GND are connected to the 5V and GND on the Raspberry Pi for power supply.
ENA, ENB, and IN1-IN4 are connected to the Raspberry Pi I/O port.
After picking up, it is like this:
The camera is a camera for the front-end machine for several years. The resolution is 470x640, not 480x640. Under the mjpg-streamer, the picture is spent. After the picture is normal, the picture is like a slide. What the hell! The camera is connected to the wrdr3800 router equipped with openwrt. There is no friend on the wrdr3800 router. It is not possible to adjust it on the Raspberry Pi. Itâ€™s not a good idea. Give up, give up, no camera can be used as a remote control car. Here is the demo show:
Car remote control
Finally came to the programming part, for the sake of simplicity, using Python's RPI.GPIO module to operate I / O, but I found that the function is very few, did not find the speed of the API, the document is here, the code is as follows, the wheel parameters of the I /O mouth depends.
Finally, using the Flask module to implement the Web, this requires the Flask module to be installed in the Raspberry. At the time of installation, the Raspberry Pi python environment is incomplete. The code is for reference only.
This cordless tire inflator in-built 2000ma lithium ion battery. It's small, ergonomic, and runs from 0-150 PSI. It also has different nozzles.This tire inflator is lightweight, extremely portable, and requires little storage space. The battery charge lasts long enough to inflate several tires in one sitting.
Air Pump For Car Tires,Car Tire Inflator,Portable Tire Inflator,Car Tyre Inflator
SHENZHEN SMARTNEWO TECHNOLOGY CO,. LTD , https://www.newopump.com