Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: ESP32 RC Cars (github.com/mattsroufe)
333 points by mattsroufe 10 days ago | hide | past | favorite | 63 comments
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.






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.


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!


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


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:

https://imgur.com/a/LJflZ80


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.

Can you recommend an exact model?

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


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


Very impressive!

I've never looked into RC builds before - how are they controlled? Do you connect the PS4 controller directly to the esp?


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.


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?

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

[0] https://www.expresslrs.org


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.


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?

The bigger advantage with analog is being able to use cheap repeaters to boost the signal back to home.

With digital, you can go from 30-50km with the proper equipment, noise free environment etc... It looks like the video for that has been taken down. But you can find the discussion here: https://greyarro.ws/t/digital-fpv-dji-vs-hdzero-vs-orqa-vs-w...

The "allowed regime" also differs based on where you live. Iirc 25 mW is the maximum permitted power in Europe. Have to double check. That gives you about 100-500 meter range in an open area.


A big advantage with digital video in the US is that some systems, like DJI’s, have FCC approval and can go up to 1 or 2W EIRP legally, so the allowed regime is bigger (there are basically no FCC approved analog video systems, so really you need an amateur radio license and to operate under amateur radio rules for analog video in the US).

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.


You mean like OpenHD? What other options do they have while still being able to use COTS hardware?

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.


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.

Right, but I don't see any reason why that must be the case. It's not a fundamental limitation.

To a great extent you trade statefulness (inter-frame compression, FEC, HARQ, sounding parameters, overhead) for efficiency, so improving link recoverability comes at a cost. There is an existing solution which makes this trade - HDZero. It works amazingly at close range in clean RF environments and has good analog-esque falloff characteristics, but in terms of absolute efficiency it is very bad and therefore does not have the same quality or range as other solutions. Certainly a better hybrid approach is possible but to your point, niche.

> but in terms of absolute efficiency it is very bad

Worse than analogue?



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.

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

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.

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.


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

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.

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

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..

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...

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.


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

What is the approximate price of the car components?

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)


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.


For example, you can get a kit around $32: https://a.aliexpress.com/_Eya0rSM

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.

What are the battery requirements for such feed combo (RC + FPV + servo)? From experience, how does this translate to play time?

I've never tried running for a really long time but when I was doing testing I would not recharged the batteries for days. I would say an easy 15 to 30 minute. But like I say, I'e never tested. Now I think I will. Thanks

I did something similar with Rust and the Steam Deck not long ago - https://github.com/jamesmcm/esp32_wifi_tank

This is amazing! Is there a way to make the car recharge at dock like robo vacuums?

This is exactly what im needing as well, I would like to make something like this and integrate it into home assistant but haven't had time yet

How was the chassis and steering mechanism built? Any plans to release that design?

I believe it's this kit: https://www.elecrow.com/4wd-smart-car-robot-chassis-for-ardu.... It's been around a while, I got one around the time covid started. It's decent quality, although IIRC the front wheels don't have bearings.

Tangential, I want to build a camera based fish feeder, is there any hardware that can shake fish food pellets and can I use my python knowledge directly?

I think you're looking for CircuitPython, which is available on a variety of small boards [0]. Based on my, admittedly, very limited experience, I would strongly consider the Feather line of products from Adafruit [1]; they're compatible with each other, most have CircuitPython support, and they mostly have STEMMA QT ports for simple connections to I2C-based peripherals.

[0] https://circuitpython.org/downloads [1] https://www.adafruit.com/category/943


I want to make this with my kid but I can’t find the actual hardware as seen. Are those printed parts? Also the wheels and foam. Where would I go about sourcing these parts?

Does anyone know if there is a car kit where you could just install an Android smartphone and have it be the camera + brain?

Don’t know of anything readymade, but hacking together a WebRTC video streamer and a WebSerial/WebUSB based control that would forward SBUS control signal to a USB OTG attached MCU seems easily doable.

Thanks for sharing. I always wanted to use ESP32 to revive old Geotrax trains. Maybe that’s the right project to start with.

Idea to make it more fun:run Yolo vision processing on the client computer to make it drive autonomously.

It would be quite nice to add a 4G module, allowing you to drive around the city (:

This is really cool.

It could be like Goldeneye, slappers only.

Just find a better way to slap than bumper cars.


FPV car racing incoming!

What is the latency?

It's live version of Micro Machines! Nice work

Cool project! Love it! :-)

We mounted a furby head in one of our robots at work and let it yell swear words at our management.

They (and we) love it.

That project was the source of many code snippets/patterns that have implemented in official products that earned a lot of money.


Now I know what I did wrong with the ESP32-CAM powered cars when I did a very similar project in 2020 - it's was all the antenna.

this. is. awesome.

Sweet, now I can build the RC car from Watch Dogs 2.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: