top | item 42498648

Build a Low-Cost Drone Using ESP32

443 points| m3at | 1 year ago |digikey.com

149 comments

order

the__alchemist|1 year ago

Note to anyone unafamiliar: There is a thriving "FPV" ecosystem of drones that can be DIYed. Example common setup, you can mix+match:

  - Small square PCB with the main flight control MCU (STM32), and some sensors
  - Smalls square PCB with motor drivers
  - Carbon fiber frame
  - Small PCB with a LoRa radio
  - Camera and video transmission system. (90s-security-cam style analog, or digital.
  - Brushless DC motors, props etc
Uses Betaflight, ArduPilot, iNav, or PX4 firmware. Or, you could write your own.

The PCB-frame in the article is neat and has obvious convenience advantages, but I speculate that it would not be stiff enough for desirable controllable characteristics under high accel situations.

hylaride|1 year ago

And a lot of it is all open source!

ESC software:

- https://github.com/am32-firmware

- https://github.com/mathiasvr/bluejay

Flight controller (you mentioned these):

- https://github.com/betaflight

- https://github.com/ArduPilot

- https://github.com/iNavFlight

Control link:

- https://github.com/ExpressLRS (also uses ESP32/ESP82 chips)

Radio Controllers:

- https://github.com/EdgeTX

5+ years ago the vast majority of this stuff was proprietary-only and getting into the hobby cost thousands of dollars. Now you could start at ~$500 (big price factor for FPV is the goggles, but cheap analog ones can be had for ~$100).

Kadin|1 year ago

This is all true, but just to set expectations: the open source ecosystem seems to be lagging the proprietary world pretty significantly, unless there's some corner where development is really chugging along that's not making it out to the rest of the hobbyist market.

Though there have been incremental improvements in flight control software, and video subsystems have moved (mostly) from analog to 2.4/5.8 GHz and digital, the overall architecture is pretty similar to what it was 5+ years ago. You have a hobby R/C transmitter and receiver driving PWM outputs (through the flight controller, typically an STM32) to hobby-type ESCs which control the motors. The ESCs are microcontroller-driven and can be reflashed, but painstakingly and annoyingly. Telemetry is typically separate from control, which is separate from video. Everything is very short-range and non-IP.

In comparison, a COTS quadcopter from DJI has a single backhaul from the airframe to the controller which does control, video, and and telemetry. And the video is impressively low-latency. (I'm pretty sure they use a WiFi-type chipset and just spew raw vendor frames, and the receiver picks up what it can, best effort. You could do this with an ESP32 in ESP-NOW mode, I suspect?) I've seen some efforts to reverse-engineer the DJI protocol but I'm not aware of a fully compatible implementation or equivalent in the OSS world.

And at the upper end of the commercial/proprietary space you have systems with out-of-the-box autonomy, multiple backhauls over IP -- so they can use LOS/BLOS radio, LTE, SATCOM, whatever you want -- integration with navigation beacon systems to reduce GPS dependence, hybrid motor/generators, redundant power systems, the whole shebang.

There's no real reason aside from developer interest that this situation exists, as far as I can see. The components are mostly all available. A Raspberry Pi running a decent RTOS would have orders of magnitude more processing capacity than an STM32 and could easily do the sort of multi-sensor fusion that the commercial systems do. LTE modems are cheap. A bigger hexacopter or fixed-wing could easily loft one of the small Starlink dishes, if someone wanted to. Stuff like "perching" (landing and recharging from solar panels) is entirely possible.

But from what I can tell, the cutting edge of open source drones is happening behind closed doors in Ukraine and Iran.

Happy to be corrected if there's new stuff that I'm not tracking, but the gap between the "art of the possible" and current practice seems large.

Lots of opportunity though, is the other way to view it.

hypercube33|1 year ago

What about those of us who really are awful at flying drones? I personally have tried fpv ones and just don't seem to have the skills for it - however I really enjoy my DJI mini. I never can seem to find information on open drones that fly the same way (maybe I just don't know what I'm looking at or for?)

dheera|1 year ago

Also

> All-in-one PCB: Doesn’t need any 3D printed parts or such

I actually am fine 3D printing and laser cutting stuff at home but I don't have the stuff to make a PCB and don't have the hand skills to do anything more than through-hole soldering.

helpfulContrib|1 year ago

> There is a thriving "FPV" ecosystem of drones that can be DIYed.

As someone who has for decades built flying things which could be drone'ified any day of the week, it is sort of also necessary to point out that even before drones became so widespread and commonplace, rcgroups.com has been the ecosystem in which to find oneself.

And indeed, the "model airplane/remote control flight" subject has been prosperous and flourishing as a hobby for decades too .. just feast yourself on the categories here:

https://www.rcgroups.com/forums/index.php

A very earnest exploration of the various sub-forums will reveal some extraordinary designs - some which, indeed, break the 'norm' for what a flying thing should look like, in respect to a more casual view. Magnus, aerostat, Fettler are pretty good search terms...

curiousgeorgio|1 year ago

Is this just someone reposting espressif's esp-drone (https://github.com/espressif/esp-drone) and passing it off as their own (and DigiKey posting it on their site)? They talk about making a custom PCB, but it looks pretty much the same.

The repository linked from the article (https://github.com/Circuit-Digest/ESP-Drone) has some issues claiming there's malware in it, and the commit history looks a little suspicious, but I could be wrong.

nick__m|1 year ago

Since those who filed the issue did not even stated which file is affected this is pure speculation but the virus issue really look like a false positive. The pre-built firmware checked into a repo could easily trigger an anti-virus.

The repo is mostly made of plain text files, the zip and the bin don't look required for anything so if your feeling paranoid delete them before building!

stavros|1 year ago

Wow, yeah, I thought Espressif just wrote the firmware, but this drone is really really similar to the one posted, PCB struts and all.

asadalt|1 year ago

damn you are right!

phoronixrly|1 year ago

What a great time for this article! The US is having a mass hysteria event and it turns out you can churn out DYI drones for the fat sum of $12-13 each? What a time to be alive!

Edit: Hmm, considering that people are taking stars for UFOs lately, maybe a cheap drone is an overkill and a 20-pack of Chinese sky lanterns would be more than enough to keep the average US neighbourhood in a state of constant fear / see how long it takes for you to get to the front page of /r/UFOs...

abracadaniel|1 year ago

Judging from the posts I’ve seen, others have already started. Someone had a drone with a lit Roman candle going the other day. Or it was FAA compliant aliens. One of the two.

gitaarik|1 year ago

The only way to cover up real sightings is with fake sighthings.

ActorNightly|1 year ago

The interesting/scary part is that its not that hard to weaponise these drones. You can make one drop a home made explosive pretty easily, fully autonomous. and then dump itself into a body of water. All for way less cost than a gun.

diggan|1 year ago

> The US is having a mass hysteria event

What is this in reference to? The Chinese weather-balloon drama was years ago, wasn't it?

ChuckMcM|1 year ago

Fun! I built a Crazyflie[1] back in the day which was bespoke 2.4GHz protocols (no ESP32 at the time) so this is a great upgrade to that. Also the use of a single low side MOSFET as the motor controller makes it simpler and cheaper at the expense of some moves that BLDC motors give you. All in all, at $10 - $15 that is a great deal and I'm wondering if one will show up in a Hackerbox[2] as that is exactly the kind of thing they do.

I have had a lot of fun playing with the CF microdrones, I'm definitely going to build one of these too.

[1] https://github.com/bitcraze/crazyflie-firmware

[2] https://hackerboxes.com/

mrtksn|1 year ago

Fun. I'm looking into turning my old iPhone into a drone as it has great hardware already to do higher level tasks and use ESP32 for the more real time stuff like actually driving the motors based on sensor input.

If you think about it, an old iPhone 6 comes with GPS, gyro, accelerometer, multiple cameras, pretty powerful processors, bluetooth + wifi + LTE, sound + light, ambient + proximity sensors. Get rid of the case, and you have a great mini computer that can be aware of its surroundings and communicate.

On more modern iPhones, you can even use advanced tech like ARKit to have great spatial understanding of your drone and environment and do autonomous drones. With an iPhone 15, you can even get spatial video. How amazing would that be?

I wish Apple provided a straightforward way to unlock(like remove restrictions on the OS level) old phones and use them for DIY projects.

Max-q|1 year ago

Do you really need the phone? The dual core 240MHz ESP32 seems to be able to do the job at lower weight and power consumption.

Maybe the old phone is better used as a controller?

talldayo|1 year ago

You would want to use quite literally anything except Apple-manufactured hardware for this purpose. Just don't even waste your life-minutes on that kind of thing.

szundi|1 year ago

Not a realtime os though

teruakohatu|1 year ago

This is amazing. Even the landing gear (struts?) is part of the PCB. I hope the author considers selling kits or outsourcing kits to SeedStudio. I live in a country where digikey order shipping is quite pricey.

The author estimates the BOM to be a little under US$13. At that price it would be fun to try create a swarm for DIY drone lights show.

[1] https://circuitdigest.com/microcontroller-projects/DIY-wifi-...

jdboyd|1 year ago

FWIW, making just 10 might drive that $13 price down quite a bit.

Although, it looks like 1 unit might be closer to $50 (at least for the suppliers I might use), but $150 for 10.

I think costs could be cut somewhat though. The USB->serial chip is nearly $6, but differently packaged it can be $4.40 for 1 or $3.99/ea for 10, and alternative chips that seem like they should be good enough can be cheaper still. The voltage regulator they chose is $1/ea for 500ma, while the one I would normally go to is $0.22/ea for 1000ma (dropping down to $0.13/ea for 10).

jauntywundrkind|1 year ago

Feels like a poor fit, given the limited number of cores available.

Would be awesome to see rp2350 or some such, where there are very low power io cores available that can do work whether the main core is on or not. Embedded really is one of the best places for many-core, but it's so so rare there are good offload architectures and puny Programmable IO systems.

Should out to folks like Silego/Dialog/Renesas with their GreenPAK; ultra tiny but interesting mixed signal little bits of programmable logic with a healthy dollop of peripherals!

crote|1 year ago

Calling the RP2350's PIO units "low power io cores" is quite an exaggeration. Although they are technically turing-complete with a lot of hacking, they are absolutely awful at any kind of compute. Heck, you probably don't even want to let it handle UART parity calculation!

If anything the ESP32's Ultra-Low-Power Coprocessor would be perfect for such applications - but realistically it isn't worth the effort. Compute power usage is going to be negligible compared to what is needed for wifi and rotors, and running multiple realtime tasks on a single core isn't exactly rocket science either.

timonoko|1 year ago

I played with €25 foldable wifi drone from Lidl until EU started requiring €30 fee annual for a camera drone.

I cannot think much practical use for drone without a camera. Fly-fishing might be one, but I need to program it so that it drops the line and returns home the moment it feels fish yanking.

wyan|1 year ago

EU doesn't require a €30 annual fee for a camera drone, though. Your country might. Mine surely doesn't.

eptcyka|1 year ago

How much lift can a 30€ drone produce? A 600 gram trout could easily drag the drone underwater unless it is ridiculously overpowered.

TrapLord_Rhodo|1 year ago

i did this with my drone. I just used a small sideways chip clip i glued to the bottom of my drone. Fly fast enough so when the line goes taunt, the line will slip out of the clip and drop.

frognumber|1 year ago

It's odd, considering this is digikey, that there isn't a "Buy now" button.

I'd totally do that if I got everything shipped to me, and knew I wasn't forgetting something.

wat10000|1 year ago

There’s a small link at the bottom to “Add all DigiKey Parts to Cart.”

But one of the parts is apparently already obsolete and unavailable, and two more have minimum quantities above what’s needed here, so it’s not great.

asadalt|1 year ago

this is amazing. on similar note, I have spent last few months trying to fit visual inertial odometry into esp32. Combining that with this would be insane (and so cheap!)

timschmidt|1 year ago

I've had similar thoughts and have been working on firmwares for the esp32. My contact info is in my profile. Hollar at me and lets compare notes.

joshmarinacci|1 year ago

What do you mean by this? Do you mean using an onboard camera for navigation and/or orientation? I’m very interested.

fitsumbelay|1 year ago

love everything here but I'm skeptical of real time control via wifi. for me there's always been a noticeable delay in video streaming and receiving control signal so I'm curious how this works?

mciancia|1 year ago

Well, given how well game streaming can work (local, not cloud), I think low latency for drones should be possible :)

m00x|1 year ago

There's no video feed on this drone

no_time|1 year ago

I wonder what differs in the hardware (other than obviously using the newer esp32) compared to the implementation in this vid: https://www.youtube.com/watch?v=3n76iMTHXuE

tldw: he experienced significant packet latency while the motors were spinning, making the drone uncontrollable.

AstroJetson|1 year ago

Is the custom circuit board something that mortals can get made? That seems to be the sticky point to me.

wiml|1 year ago

Yup. About fifteen years ago there was an explosion in small-run PCB services that cater to hobbyists (and cottage-scale professionals). If you don't need them overnight you can get good quality PCBs made at a very reasonable price.

ElectRabbit|1 year ago

99% of hobbyist PCBs are can be ordered from JLCPCB nowadays.

As long the PCBs have no components on them it's very cheap.

asadalt|1 year ago

just upload it to jlcpcb and get it delivered with components soldered.

asadalt|1 year ago

i wish this didn’t use mpu6050 imu, which is obsolete and unavailable it seems.

but i guess they used it due to existing code/drivers widely available for it and esp32.

Neywiny|1 year ago

Agreed. I'm in the market for an imu and thought "ah the MPU 6050, I've heard of this one a lot even recently" and it's obsolete. This is typical of consumer to adafruit/sparkfun/aliexpress levels where they have countless old stock of cheapy proto boards to buy from, but if you're designing a whole new thing from scratch, that's inexcusable.

amelius|1 year ago

With the power budget of a drone almost any board will do.

KennyBlanken|1 year ago

Does anyone know who at Digikey is responsible for their absurd adblock-blocking efforts?

It's so goddamn tiresome that I'm headed to a site already with a list of things to buy and it blocks me because I've installed an extension that will block them from showing me ads trying to sell me even more stuff.

iandanforth|1 year ago

Meta: This has to be one of the most aggressively blocked pages I've encountered as it refuses to render any content if you have an adblocker on (uBlock at least) and resists several forms of archiving.

macrocosmos|1 year ago

I'm able to access the site with uBlock Origin.

RamblingCTO|1 year ago

I also had the worst anti robot thing ever. I had to hold a button for what feels like 10s. Who does that?

moepstar|1 year ago

uBlock on, pihole on the net - not sure what it dislikes more.

I see a screen (light grey on white) which reads something along to "Press & hold" some button to confirm i'm human. Which does nothing, because of adblocking?

Well, f* you then - let me find something different to read :)

pjc50|1 year ago

Odd, it's just fine for me on firefox/ublock origin.

ElectRabbit|1 year ago

Even with uBlock and Cookie AutoDelete disabled it doesn't work.

OK. Then I'll order my stuff from Mouser in the future.

ok654321|1 year ago

[deleted]

Onawa|1 year ago

> Do you guys find this funny? Adding fuel to the fire?

If you can't beat them, join them it seems?

joshu|1 year ago

note: appears to use an outdated esp-idf. worth checking to see if esp-drone has been ported a newer esp-idf.