Show HN: ESP32 RC Cars
65 comments
·February 1, 2025t0mek
12 years ago, when we already had Arduino but no ESP32 yet, I built this thing:
https://newton-net-pl.translate.goog/2012/01/robot/?_x_tr_sl...
It was made of an old HTC Magic phone, acting as camera+wifi transmitter, connected to Arduino via its serial port and level shifter, to control the servo and a RGB LED. I had a lot of fan with that, even if the connection wasn't really to stable.
Thanks for sharing, maybe it's time to revive the project with the next generation of the microcontroller.
mattsroufe
Thanks everyone for the feedback on the project. I hope to keep it going and would love to see some PRs.
Just one last thing, if you like the project, the coolest thing you can do for me is let anyone you know looking for a remote developer to hit me up. I am a Ruby-on-Rails developer at heart but would also consider robotics gigs. Thanks!
123pie123
before you get a ESP32 CAM (I love em) consider one with an external antenna
it may be wise to read this https://www.reddit.com/r/esp32/comments/r7kqtt/esp32cam_supe...
I got fairly bad frame rate until I tried some of the advise
eurekin
In my case it went from a patchy 1mbps to a stable 20mbps right away, according to my router's admin page - right after resoldering the resistor and connecting the antenna.
Resoldering the 0 ohm resistor was like an adventure, but somehow managed to connect the correct pins. The end result looks like following:
mattsroufe
Yes, from my experience with this project the external antenna is a must. I've update the README with a link to the one I used.
Lord_Zero
Can you recommend an exact model?
123pie123
I'm afriad not, I bought a load of esp32 cams with out the external antenna - hit a problem with the frame rate and fixed it from the advice from the link
for my other projects I did use a ESP32 with an external antenna, but they did not have a camera port
These things are so cheap just buy one and see (unless time is an issue)
edit: the OP did add this link to one https://www.aliexpress.com/item/1005001468076374.html - note this does not have a usb connector - you can get them separately
t0mas88
Cool! I've made an ESP32 powered RC tank on tracks, controlled with a PlayStation 4 controller over Bluetooth.
The basic software is very easy to start with, about 20 lines of C using a library for the Bluetooth controller. From there I've added features for easier control. Using two sticks for two tracks works at low speed, but the thing goes close to 20 km/h (I've used two drone motors for it) so then you need a different control method. I ended up with rpm limited direct track control using the "triggers" on the dual shock controller. And more intuitive left stick up/down for throttle, right stick left/right for steering for high speed operation. So now it drives like a normal RC car.
Video of the same 3d print model I used as a basis in action, you can see the speed best from 00:50 onwards: https://www.youtube.com/watch?v=3Mv_tDY89Zw
eurekin
Very impressive!
I've never looked into RC builds before - how are they controlled? Do you connect the PS4 controller directly to the esp?
t0mas88
Yes, the ESP32 has Bluetooth support and there is an open source library to read the inputs from a PS4 controller. So I just wrote a small program to connect to the controller and send the right commands to the motors.
I think "traditional" RC people use a separate receiver module that links to their remote instead of doing this in software.
null
Scene_Cast2
The big issue with FPV, and the reason it stayed on analog tech for so long is because of latency. How is the latency for this project?
emidoots
FPV today is largely using ExpressLRS[0], an open protocol for running FPV quads' control links (also using esp32 usually)
Video for FPV quads on the other hand is divided: some use analog (mostly because when you lose signal, it's a gradual loss rather than complete loss + a reconnection process), while others use 802.11-based communication which is actually quite competitive. Walksnail Goggles for example use 802.11 for their video links, although not super open/documented people do dig into how it works (see Chris Rosser's work.) Latency is good enough with such setups for fast-paced competitive quad racing, at least
the__alchemist
I will add for those who haven't tried these, as it usually doesn't come across in verbal comparisons:
Digital FPV (like DJI's system) looks vastly better than analog. I think the best comparison is: Digital looks like a modern movie, youtube video etc, and analog looks like CCTV footage from the 80s.
I will also clarify on ELRS: It uses ESP32, but it is a thin wrapper around Semtech LoRa (~915Mhz and 2.4Ghz) SX128x and SX126x chips, which are doing the heavy lifting.
mkesper
I heard people flying analog also use quite a bit more transmitter power than allowed for non-regulated devices to keep things manageable. Do you have any reference what's possible with digital when staying in the allowed regime?
dji4321234
Walksnail is not 802.11 based. If anything it is loosely 802.16 based. Likewise DJI OcuSync is more like LTE than anything else.
802.11 is not a good fit for FPV video and trying to use it has held non-proprietary-Chinese video systems back quite a lot.
Evidlo
You mean like OpenHD? What other options do they have while still being able to use COTS hardware?
IshKebab
I think graceless degradation isn't an inherent property of digital radio. You definitely could have some kind of digital modulation that takes advantage of FEC etc. but gracefully degrades.
I'm sure it exists, there probably just not much market for it.
bri3d
Almost all existing digital FPV systems gracefully degrade as much as they possibly can, both by using FEC and walking down a large number of available MCS as link quality gets worse (and reducing bitrate to match). But when they do eventually fail, re-sync is a much harder problem for them than it is for analog.
mattsroufe
Hi, thanks for checking out the project. I don't really have anything to gauge by like experience with FPV drones but latency hasn't been an issue on my wireless network even with all the other household devices connected. I think the frame rate is mostly limited by how quickly the esp32 can capture images. In my python script I measure FPS and was receiving about 50 fps from the esp32s. I recently bought a travel router that I want to try it with outside the house.
conductr
My guess is latency won’t be an issue for you’re using it over LAN and the device is traveling lower speeds. If you wanted the controller inputs to travel over the internet to your router and/or going high speed where reaction time and maneuvering were more of a concern then latency would become an issue
conductr
Nice work! I’ve been thinking of taking on a similar project and would be curious what’s your experience like with latency? Can you view the video feed and control remotely? My main reservation is the presumption that it would be too laggy for obstacle avoidance at most speeds.
jtwaleson
So cool! I bought the same kit last year and recently bought a esp32 game controller with a tiny display: https://github.com/01studio-lab/pyController
When I have some time I'll try to combine them so I can control the car and see the camera feed on the display.
idunnoman1222
A good 2.5 inch RC car is 30 bucks on AliExpress now, A standalone 5.8 GHz analog camera is 25 bucks. Just for those that may be more interested in the outcome than just a fun project to do
05
A standalone (you mean AIO) camera with a builtin VTX is generally even shittier than regular analog, and you still need analog goggles for it. For anyone who doesn’t need prescription glasses or wears contacts, DJI O4 ‘lite’ with the N3 goggles is a much better idea.
idunnoman1222
You don’t need goggles you can just get a receiver for your TV… or any screen.. also Qualify shittier do you mean the range of the antenna? A 2 1/2 inch car it does not go outside, so not relevant. If you mean the camera well buyer beware i guess the ones I got were fine. Also, I thought we were comparing this to a cheap ESP 32 build and not some top-of-the-line digital thing the SP 32 build is gonna have a terrible lag. You’re not actually gonna be able to race your friend with it… my setup is cheap and has low latency. no one is gonna buy top-of-the-line DJI crap to race a 2 inch car around their basement
05
Top of the line would be Goggles 3, N3 is the budget line and it costs less than analog goggles. Maybe with cars it's different, but nobody flies with a screen - the immersion just isn't there..
amenghra
This is a fun read if you want to automate the RC car. It's from a couple years ago, there might be easier/better way to achieve similar results today: https://hackaday.com/2021/10/25/fast-indoor-robot-watches-ce...
unsigner
Thanks for sharing this - this will be an inspiration.
Everybody knows about FPV quadrocopters used on the battlefield, but there is an increasing focus on terrestrial vehicles. They look nothing like the Boston Dynamics robodogs crossed with Terminators from the mvoies, but are extremely useful in lower-profile "boring" jobs, like laying landmines, exploding landmines, and carrying small amount of supplies to soldiers sheltering somewhere on the frontline.
aleksiy123
Pretty awesome. I was thinking about trying to create some kind of automatic toy for my cat that would avoid obstacles. Maybe this could be the base instead of the one I picked up https://www.aliexpress.com/item/1005007634018076.html
wslh
What is the approximate price of the car components?
mattsroufe
Hi, I update the README with the components:
Hi, thanks for the feedback. I have updated the README with the materials I used:
I bought everything for this kit from aliexpress:
Car chassis: https://www.aliexpress.com/item/32830665408.html Electronic speed control: https://www.aliexpress.com/item/1005007716682815.html Battery holder: https://www.aliexpress.com/item/1005006283625827.html 2 18650 3.6v cells or 7.4v battery pack (I have used both, cells are more flexible for other projects) ESP32-CAM: https://www.aliexpress.com/item/1005001468076374.html (Very important to get one with external antenna and and I used the 170 degree fisheye camera) Bluetooth Gamepad (I used a PS4 controller)
numpad0
If you really need to cheap out on it, you can remove the wireless chip from an existing RC car and take over the H bridge inputs, or even just tap into the antenna input pin and inject serialized commands.
Most low-end 27MHz toy RC sets use clones of a well known chipset called RealTek TX2/RX2, and there are Arduino libraries for it. It only takes binary on/off commands for forward/back/left/right/"turbo" at 1Hz or so, which is fun enough for most purposes.
tga
For example, you can get a kit around $32: https://a.aliexpress.com/_Eya0rSM
dimatura
I put a link above for this kit which is about $50. However, I believe you would also need an ESC for the motor, a suitable one would probably be less than $20.
This is a projected I started that blends both the fun of playing a split screen multiplayer driving game and controlling real rc cars.
The cars can also be controlled via bluetooth gamepads and is meant to be easily hackable.