Introduction: Wireless FPV RasPi Car

In this instructable, you will learn how to build an RC vehicle that is controlled over WiFi through an Apache website interface and includes an FPV video stream with the use of Motion. This will be done through the use of a Raspberry Pi which will control the server and networking portion of the project. An Arduino Nano will control the I/O functions and is responsible for driving motors with help from an L298N motor controller. Enjoy!

Step 1: Gather Materials

Things you need:

RC car chassis

Pi touchscreen display

Raspberry Pi 3 B+

USB Webcam

2 X 12V Battery

7805 Voltage regulator

Hot glue/Hot glue gun

20-26 AWG wire w/ make + female connectors assorted

An intermediate understanding of the Raspberry Pi

A free weekend

Step 2: Installing Motion on Raspbian

Open Terminal and Type the Following Commands:

To Update the Pi-

sudo apt-get upgrade

sudo apt-get update

To Install Motion -

Installation - sudo apt-get install motion

To Configure Settings -

Configuration - sudo nano /etc/motion/motion.conf

To Start/Stop the Porgram -

Start Motion - sudo service motion start

Stop Motion - sudo service motion stop

For more in-depth instructions on getting Motion to work please reference this instructable:

https://www.instructables.com/id/How-to-Make-Raspberry-Pi-Webcam-Server-and-Stream-/

Step 3: Arduino Setup

Copy and Paste the following code onto the Arduino Nano:

This code is designed to receive high/low values on it's DI/O pins from the RasPi and output to the L298N motor controller. We used an Arduino instead of using the Pi's I/O because the Pi does not do a very good job at controlling motors due to its low output current. Unlike the Fritzing, we ended up switching to an L298N motor controller because of its higher output current.

RasPi I/O:

Input from RasPi to Arduino

FWD - 25

BCK - 24

LFT - 23

RGT - 22

Arduino I/O:

Output from RasPi to Arduino

FWD - 11

BCK - 4

LFT - 5

RGT - 2

Output from Arduino to L298N motor controller

FWD - 7

BCK - 8

LFT - 9

RGT - 10

Step 4: Webserver Setup

Follow the following instructable for setting up the Apache webserver:

https://www.instructables.com/id/Simple-and-intuit...

Instead of using their web 2.0 files, replace everything inside with the files we made.

The uploaded HTML folder must be replaced with the HTML folder on the Pi. It contains all the required PHP scripts that pull the GPIO on the RasPi high/low depending on which arrow on the website is pressed. It also contains all the img files for the pressed and unpressed arrows.

LCD-show is required for making the touchscreen compatible with the RasPi.

rPiSwitch.sh is required to switch between the touchscreen and an external monitor display

To install and configure motion please follow the following Instructable :

https://pimylifeup.com/raspberry-pi-webcam-server/

Then use the command ifconfig to find the IP address in order to establish a webcam connection

Step 5: La Fin

And that's it!

To connect to the Pi simply connect the Pi to power and once booted run ifconfig. This will tell you the current IP address of the Pi which you will need to type into the URL of any browser on the network to access the Apache server. We added a touchscreen to the Pi to make it more intuitive to use and I would recommend the same. To access the video feed you must type the IP into the browser but instead finish with a colon then the port # you set in the Motion config file mentioned earlier in the Instructable. I believe default is 8081. If everything is set up properly it should function but if not don't worry just shoot me a comment and I'l get back to you when I can.

Have fun and happy making.