DIY Smartphone-Controlled Tiny Car With Live Camera Feed
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!
21 Comments
EricN45 3 months ago
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.
EricN45 3 months ago
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.
didier44 3 months ago
my code:
didier44 3 months ago
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)
saugusjim 3 months ago
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!!
saugusjim 4 months ago
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.
EricN45 3 months ago
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.
🤖 3 months ago
didier44 3 months ago
lots of web companies do that for you
Mauro-O-Matic 4 months ago
Thanks in advance ...
didier44 3 months ago
didier44 3 months ago
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?
attitudeandeffort 4 months ago
kikouzzr 4 months ago
Spi_WvS 4 months ago
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.
vishal.nikam1 4 months ago
erikhoffman 4 months ago
Help needed
Thanks, Erik Hoffman
MrChalmers 4 months ago
Randy_h 4 months ago
fredic91 4 months ago