DIY Smartphone-Controlled Tiny Car With Live Camera Feed

13K26335

Intro: DIY Smartphone-Controlled Tiny Car With Live Camera Feed

Hey guys! After going through your awesome suggestions on my previous post, Tushar's idea caught my eye: "Can we make a tiny car with a camera that we can control from our phone and see the live feed?" Well, challenge accepted! In this step-by-step guide, I'll show you how to create your very own smartphone-controlled miniature car with a live camera feed.

STEP 1: Designing the Car Body

Using Tinkercad, design the chassis for your tiny car. This step is crucial for the project's aesthetics and functionality. Once designed, it's time to bring your creation into the physical realm through 3D printing. I'm using the Bambu Lab Carbon X1 3D printer for this task.

STL Files - Download

STEP 2: Assembling the Parts

With the 3D printing complete, assemble the components to construct your tiny car. Ensure everything fits snugly, and make any necessary adjustments during assembly.

STEP 3: Connections

Now, we have to make the connections by following this circuit diagram.

STEP 4: Attaching Typers

STEP 5: Uploading Code

Now that the project is almost complete, upload the necessary code to the microcontroller. Witness your creation in action as you connect it to your phone via the FPVCAR WiFi network. Access the live camera feed by typing a specific URL into your browser.


Download Codes - Link

STEP 6: Project Completion and Troubleshooting

The WiFi-controlled tiny car with a live feed camera is ready to roll. However, I encountered a slight issue with the front motor veering to the left. This hiccup is expected with these fragile motors, but using N20 motors would improve performance at the cost of increasing the project's size.

STEP 7: Conclusion

That wraps up our exciting journey in creating a DIY WiFi-controlled tiny car with a live feed camera. If you enjoyed this project, don't forget to give it a thumbs up. Share your thoughts or ideas in the comment box below, and stay tuned for more DIY adventures. Bye-bye!

STEP 8: Working Video and Tutorial


21 Comments

Hi guys, i'm close to the goal. everything work exept the order of the motors. I mean that when i type Forward, only the motors plugged on motor A works at half power. when i type Backward, all motors work at full power. when i type Left, motors plugged on motor B work at full power. and when i type Right, no motors work and i just have a whistling.

I have to confess that i let analogWrite cause when i used ledcWrite nothing happened, but i think that i have to declare a ledcSetup and a ledcAttachepin somewhere in the code?

i've connected two left motors in parralel. same for the two right motors. For the rest from the MX1508 to XIAO SEED ESP32S3, i've connected IN1 to D2, IN2 to D1, IN3 to D4 and IN4 to D3. I wonder that the problem come from that config.

Any help would be welcome.

thank you very much for answering didier44. meanwhile i solved the rest of the issue i still had, using analogic system. But your code is very interesting i will try it. Best regards.

The attached modified code works for me (on an XIAO ESP32S3 module).

Did you properly connect the motors? (both motors of one side must be wired in parallel and controlled by one driver channel)

Thank you all for the help - turns out loading the support files in the same folder as the skit and set the PSRAM on ——- and it works! Now as soon as the 3d gets here I can put it all together.

When I get it all assembled I shall post a picture.


Again thank you all!!

I am having a problem with the compile.
This gives me an error: void startCameraServer();

If I add {} then i get a clean compile and it uploads.
void startCameraServer(){};

But I get an error that the camera init failed or it works but there is no fpvcar on my phones wifi list.

hi saugusjim. First you have to put the file app_httpd.cpp in the same directory than your FPVCar.ino file, no need to add {}. Second to be able to see the fpvcar on you wifi, you will have to enable the PSRAM "OPI PSRAM" in tools options . see link: https://forum.edgeimpulse.com/t/camera-init-failed-with-error-0xffffffff/8902

and for te rest follow the advice of Spi_WvS

it works for me. i just have an issue with making motors work.

modest and cool. Unfortunately, I don't have a 3D printer
you can order online
lots of web companies do that for you
What software you are using to load the files?
Thanks in advance ...
worked for me with Arduino IDE Version 2.2.1
Nice post, too bad it is incomplete (missing wiring diagram..).
BTW, looks like (from the pics) that the battery connects directly to the motor driver. Fine, but then, where does the ESP32 board get its power from? If the battery delivers 7.2V, isn't some step-down voltage converter required?
This project seems cool but it is not clear what to do with the three code files - which one gets uploaded? And using what software? Also are any modifications to the code required before this will work? Thanks.
THANKS. It's a fun project and great for learning. I couldn't find the connection diagram. I see 4 motors and a single driver for 2 motors. thanks in advance
Your source-code was probably made for the ESP8266. The pin definition using Dxx for the motor driver is wrong on the ESP32. Also the use of analogWrite() on the ESP32 ist not advisable. Use ledcWrite instead in your WheelAct() function.
You should also mention, that you used the example CameraWebServer.ino as the base for your code. Unfortunately, you changed the index_handler() completely without deleting the (now useless and misguiding) camera_index.h

@erikhoffman: esp_camera.h ist part of the ESP32 libraries in Arduino. Just change the controller to ESP32 Dev Module or ESP32S3 Dev Module and the sketch should compile (after changing the D-pins to the correct pins!)

If you want to use the ESP32-CAM as an alternative, you only have pins 0, 1 (RxD), 3 (TxD), 2, 4 (Flash-LED!), 12, 13, 14, 15, 16 available. The camera on the ESP32-CAM (CAMERA_MODEL_AI_THINKER) also needs pin 0. So use pins 2, 12-16 for the motors and other signals. Pins 1 and 3 can be used when all serial.print-commands are omitted.

Wiring: the two left and right motors are connected in parallel. Each channel of the MX1508 motor driver now drives two motors. This driver uses IN1-IN2 for one channel, either use logic signals 0-0, 1-0, 0-1 or pwm signals 0-0, pwm-0, 0-pwn. (see the use of the WheelAct() function in the code)
If you want to use the l298 as an alternative, use logic-signals on the ina, inb pins and one pwm signal on the en-pin.
Can we operate this car from anyware in this world using internet
Very nice but there is no diagram in step 3 and also where is the library - #include "esp_camera.h"
Help needed
Thanks, Erik Hoffman
This Looks like a great project, just a a few questions, attach “typers” but what are they? They are not described in the parts list or 3D printed? Also a circuit diagram is mention but not shown. I am totally excited to build this, thank you for posting it!
Pretty cool, would be really aweesome if the wiring diagram was included...
nice job!! where can i find the wiring diagram?
More Comments