top | item 42901007

Show HN: ESP32 RC Cars

335 points| mattsroufe | 1 year ago |github.com

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.

63 comments

order

t0mek|1 year ago

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|1 year ago

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|1 year ago

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|1 year ago

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

mattsroufe|1 year ago

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|1 year ago

Can you recommend an exact model?

t0mas88|1 year ago

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|1 year ago

Very impressive!

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

Scene_Cast2|1 year ago

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|1 year ago

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

mattsroufe|1 year ago

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|1 year ago

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|1 year ago

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|1 year ago

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|1 year ago

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.

unsigner|1 year ago

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.

wslh|1 year ago

What is the approximate price of the car components?

mattsroufe|1 year ago

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|1 year ago

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.

dimatura|1 year ago

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.

zoomablemind|1 year ago

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

mattsroufe|1 year ago

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

rkwz|1 year ago

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

wayvey|1 year ago

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

Waterluvian|1 year ago

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?

aitchnyu|1 year ago

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?

jonlucc|1 year ago

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

lostmsu|1 year ago

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

05|1 year ago

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.

lnsru|1 year ago

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

wjan|1 year ago

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

jesprenj|1 year ago

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

hk1337|1 year ago

This is really cool.

It could be like Goldeneye, slappers only.

Just find a better way to slap than bumper cars.

Abimelex|1 year ago

FPV car racing incoming!

Jemm|1 year ago

What is the latency?

zapkyeskrill|1 year ago

It's live version of Micro Machines! Nice work

ElectRabbit|1 year ago

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.

alnwlsn|1 year ago

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.

NetOpWibby|1 year ago

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