Build an ESP32CAM Robot Car
john B, Thank you....It seems to work (at least it compiles) when I do it with your suggestion from the link in the blue resources box. Thanks!!!! Not sure why my copy paste would cause that error, but I think I will just move on to the building of it and worry about the many more future errors I will surely run into. Thank you, I am so appreciative of the help everyone gives on this forum.
@troles, It's too easy to miss a bit when you copy and paste! Or add something by mistake!
I'm currently carefully adapting the code to use a different motor driver, and because I'm converting a cheap RC car (see my previous post with the pictures), that uses one motor for drive, and another for steering, so there will be much bad language flying about here soon 😀. But it's a good way to learn, as this is the first time I've used an ESP32!
I have just implemented this project om a DF Robot Devastator using a L298N motor controller, here in sunny South Africa.
Fantastic article and video! I am encouraged to get started again. I'm even reviewing the video on buck, boost and other power supplies, just because I need the education. Congratulations! 😀
OK, now for the nitty-gritty. My question is - oh, I have so many questions - but to start:
I've never purchased any 18650 cells before, only the AA, AAA, D, etc.
I went to batterystore and the nice tech said yeah, this would be OK for robot car, with the caveat:
(Always willing to do the research, I read all the notes on this particular topic).
Then still trying to answer my own question, I tried to reason it out by comparing with other little experiments for Arduino, Pi Zero, etc. I came to the conclusion that these batteries were good enough to at least give them a shot. If not for this project, then for some other.
Next, I'll put something together, then get out my multi-meter and try to remember how to measure current in operation.
So, what is the current draw of this project? Is it less than 6 amps?
It shouldn't be more than a few hundred milliamps, if you're using small motors like the ones Bill used, 130s, or N20 gear motors. I think the Wi-Fi is quite power hungry, but only relative to the small currents drawn by microcontrollers. I'll be using two 14500s, which are the AA sized equivalents of the 18650. I think the Chinese makers can be rather creative with quoting capacities of their batteries, so you may not get anywhere near the advertised capacity, but I think it should be plenty. I'm just hoping that my smaller ones will last a reasonable time.
Hopefully I'll be able to test this for real soon. I'm waiting for the last component I need to clear customs before I get back to building mine.
Thanks for that info. I will proceed as planned, and yes, I do intend to use more or less the same motors as Bill's example. I'm using the little car kit, and following the rest as closely as I can. I know some had already finished a robot within a week of the video coming out, but I'm much more a beginner. 😎
Also, I take your point on exuberant vendor claims. I watched a test series of 20+ 18650 batteries, and the Chinese ones had the worst actual-to-claimed performance ratio. The Japanese were good, and the Korean ones were good, and more cost effective. I couldn't find LG, so I picked Samsung.
Anyway, waiting for shipping, including customs; yes, I'm there too 🙂 I don't mind; I like ordering small boards, components from Aliexpress, though not batteries. The key thing for me is, if I can actually understand what it is I'm buying, based on the web page, then I buy it. Otherwise, order from Amazon, Adafruit or others.
No questions this time, just general comments. I sourced all the components best I could, so now I wait for shipping and customs. In the meantime, I decided to redo the ESP32-CAM experiment because I needed the reminder. Well that I did: I had rebuilt my machine, a Pi 4, in the meantime, so I needed to reinstall Arduino IDE anyway.
I picked CAMERA_MODEL_AI_THINKER
as the article suggested, since it is supposed to be the most common. Entered my ssid and WiFi password. Compiled the code. Yes, on a Pi 4 it did take a long time. This is longer than most Arduino sketches.
I also agree with what Bill said regarding voltages. I programmed it in 3.3 volts, then just tried running the code (sketch is CameraWebServer). It gave a message: Brownout detector was triggered.
So I switched the FTDI jumper to 5 volts, and moved the power connection to 5 volts on the ESP32-CAM board. Now it works. I assume this will be the same for programming and executing the robot sketch as well. With the serial monitor, I found the IP address. Running nmap on my network, that IP reported a MAC along with the label, LG Electronics. Good to know.
A further observation about just running the camera. It worked fitfully, at first. It would grab a frame, or I could press the 'Get Still' button and usually get a still of a frame. The serial monitor was similarly sluggish. I played around with resolution settings, and no luck. Even at tiniest sizes, it wasn't transmitting very much. I restarted a couple of times, and it works much better now. I picked QVGA (320 x 240) as a size that would give me at least 10 frames per second, but still allow reading text if I held it in front of the camera. This may be important in robot navigation.
As to why, I blame it all on WiFi. I intend to install the antenna on the actual bots. Right now, I'm working in the same room as the WiFi router, but I assume we'd all like to drive the things all over the house. So, I have to learn how to desolder, and put on the antenna. Upwards and onwards.