LEDCore

LEDCore was a personal project that aims to create a very small, open source reactive LED platform.

I originally had a commercial product planned for this, but decided to shift my attention to Recyclablu. A lot of what I learned here actually served as a basis for future work for Recyclablu!

What I accomplished

Software - Microcontroller: I got FastLED is now interfacing with BLE, with serial debug! Next update intends to integrate a FastLED pattern with sound input (through a low pass filter).

Software - Phone App: Proof of concept on Thunkable functioning. Currently exploring transitioning to WebBLE.

Hardware: Stage 2 PCB Design underway (see “Hardware” below). Looking into using a local maker’s pick-and-place and reflow oven to better solder the tiny solder joints.

Goals

When I began working on hobby LED projects, I was unable to find a controller that fit all my needs. Commercial controllers are very limited in programmability, and hobbyist solutions such as the Pixelblaze or common development boards were simply too large to fit in the form factor I needed. As a result, I began working on my own platform with the following goals:

  • Extremely small footprint, capable of fitting in 15mm ID tubing

  • Parts must be affordable, build-able, and available to hobbyists

  • Drive an minimum of 160 commonly available individually addressable LED

  • Reaction to sound and motion

  • Operation in noisy frequency environments with no existing network infrastructure

  • Persistence of vision

  • Optimization for low power operation when possible

  • User-friendly interface

Hardware

My goals drove certain hardware specifications:

  • RAM - an individual addressable LED requires approximately 3 btyes of RAM. With 160 LED’s, 480 bytes will have to be dedicated just to addressing the LEDs - before even accounting for RAM used for other software functions.

  • BLE radio - BLE consumes little power compared to WiFi or Bluetooth classic, and allows for robust point to point communication when the 2.4Ghz range is heavily saturated.

  • Sensors - Inclusion of an 3-axis accelerometer for persistence of vision calculations, along with a MEMS microphone due to its small size.

After extensive research, currently, I have selected the ESP32-PICO SiP due to its low cost and availability. Future versions of the project may instead use the U-Blox NINA-W1 series.

The Hardware is being design in 3 iterations:

  1. Stage 1 - ESP32-PICO-KIT. This is too large for my intended use, but will allow me to quickly test improvements to my code.

  2. CURRENT: Stage 2 - Prototyping PCB. This will use the much smaller TTGO Micro-32 soldered to an accelerator, gyroscope, and MEMS microphone. The smaller form factor and relatively permanent connections will allow me to test implement the hardware in an environment that experiences movement and modified acoustics in an oversized tube.

  3. Stage 3 - Final PCB. This will finalize the connections in stage 2, and switch to soldering the ESP32-PICO-D4 directly onto the PCB. Extraneous connections will also be removed, only exposing power, hardware SPI pins for the LED strips, and 4 GPIO pins for future expansion.

Software

The software for LEDCore was forked from Jason Coon’s ESP32-Fastled-ble project, which itself is based of FastLED. The project originally only had very limited BLE functionality - the code received a bluetooth value and passed it to the power variable, with no regard to which BLE characteristic was changed. I was able to integrate the logic previously used for the esp32-fastled-webserver project with new code that properly links the modified characteristics to the appropriate variables.

You can see the current version of my code here:

https://github.com/natalietrinh102/esp32-fastled-ble

Lessons Learned

I started this project partially as a learning experience for myself - I felt the need to push what I knew about practical hardware design, along with a opportunity to better understand C++.

Hardware

  • Basic PCB design - concepts such as vias, trace width, trace routing, and ball soldering for SMD components were needed.

  • Use of level shifters (in order for a 3.3V ESP32 to reliably control 5V logic)

  • Use of a LDO regulator to order to properly power the ESP32 from a Li-ion battery. Although the ESP32 will tolerate 2.3-3.6V, a fully charged Li-ion battery will easily be at 4.2V. Therefore, a 3.3V regulator with a dropout under 0.3V is required.

Software

  • When coding around other people’s work and libraries, it is good practice to code your own “wrapper”. Sometimes, this may require type conversions.

  • C++ is sensitive to string termination - and how failure to do so can result in butter overflows!

  • Concepts of object-oriented programming. I had worked with simple C-strings, but it wasn’t until I encountered std:string objects and a typedef field that I had to understand objects better. I learned to grasp the basics of member functions.

Previous
Previous

Recyclablu: WHO Recognized Research

Next
Next

Northrop Grumman Autonomous Rescue Drone