• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Flying Laser Tag

What FT plane would be best to carry the prototype (150g?)


  • Total voters
    13
  • Poll closed .

Duck

Active member
#41
If you buy an ESP32 that is on a board like the NodeMCU, they have a low dropout regulator onboard that can handle 5v (I think up to 7-8v but not 12). This is how they run off the USB power supply, and they have a Vin pin that is tied to the same trace.

I usually drive all my outputs active low which lets you drop in any micro regardless of voltage. It's also pretty easy to handle input voltage differences a couple of ways:
- voltage dividers
- zener clamping (most robust)
- large input resistors, 1M+ and just using the internal clamping diodes - not many devices are actually intolerant of voltage alone, it's current that does the destroying

Porting is a bigger problem. An ESP device is more like a tiny computer than traditional Arduino microcontrollers.

The thing about the ESP series is that when you run Arduino code on them it's actually running on their internal RTOS as a process - this can mess up timings when you are trying to bit bang things such as IR and it switches threads. ESPs will switch threads any time you call delay() which really messed me up when I first started using them - in fact, to have the built-in wireless libraries work properly on an ESP8266 you have to regularly call delay() in your main loop so that it has some time to work. I would guess this is the reason that the PWM/IR libraries don't support it.

Once you get used to it you start using the multithreaded RTOS all the time for handling things that used to require counting millis() or using interrupts. For example a 1 second slow PWM output for a heater can just run in its own thread, reading a global and sleeping with delay() between state changes. So easy!

ESP32 has its own hardware support for IR communications, though I've never looked into it. It probably just handles some standard protocols or is a UART in disguise.

There is a way to lock a process to a specific core at realtime priority, xTaskCreatePinnedToCore. This is where the ESP32 shines over the ESP8266, because you can set one core to run a single thread in realtime doing your bit bangs while the other stuff gets scheduled on the second core. You can pass values back and forth through global variables. So you never have to worry about finding time in your loops for running serial I/O, wireless or other slow logic. I suspect this would be the way to get the IR protocol to work on these units.
I know I could make it work but the idea was to keep it as simple as possible. I definitely have it on my list for my next project but working out of the box is critical. Especially if I want people to be able to reproduce what I did. Even the 5v issue, I know I can fix it. But adding parts to the build increases the PCB complexity, the complexity of the parts list and the number of things that can go wrong.
 

evranch

Well-known member
#42
I agree, if you have a board available that runs everything out of the box then that makes it a lot easier both to prototype and share. After all, you want to make sure this works in the air rather than spend a bunch of time porting code!

I just have become a big fan of the ESP micros, in fact I'm even using them for industrial projects now due to the combination of power, ease of use and cost. So I like to let people know what they are capable of so you can consider them for your own projects. The wireless link, the RTOS and the large amounts of flash/RAM really put them a step above everything else in their price range. Also being able to flash them wirelessly, and debug over TCP rather than a physical cable are killer features.
 

Duck

Active member
#43
Driveway test of the new Bronco landing gear was a roaring success. I am going to do one test flight without the laser tag gear and then go for it. I am building, fitting and mounting components in the meantime. The big nose will contain the lens. The IR receiver dome & Arduino will sit on a flattened section attached where the rear motor pod usually goes and I think I am going to put the FPV camera right under the apex of the V-tail. The last one I am not 100% certain on as it means I basically have to provide another battery just for FPV. I already have a separate battery for the Arudino as this one doesn't run off 3S.