I always wanted to teach my son and girlfriend's daughter the lessons of keeping track of goals. Also, I was good in Trekking and I can see how much my son is interested in traveling and so I thought maybe combine the two into a game using Christmas as an excuse. Initially my plan was only to do the tracking game alone using custom PCB using NRF52832 chips which has been lying in my drawer for a long time, I mean like nearly more than 10 years. I actually even have Redbear Lab's NB-N2 Modules. The company is no longer functional but it I was wanting to find a good project to use it.
So one module be set as BLE beacon, and other as the tracker which gives out visual alert based on the RSSI value. I got inspiration of this game from my Garmin Instinct watch which helps me figure out where my phone is using a strength meter allowing me to trace it even if the sound alert emitted by phone is not audible.
So, I made two designs of PCB, one for my son in a bracelet format, and the other in an earpiece jewelry for my girlfriend's daughter. I thought it will double as a sweet personalized gift for my girlfriend also.
But then I found that the dimension of the MN-N2 Module even though was 10x18mm it still was large for use in a earring. So I had to take a leap of faith and then do it on the NRF52832-QFAA Chip with a chip antenna. It was a large leap for my skill, but I did make my own NRF24 Antenna and it had worked decently previously, So I referred to the reference designs and their support forums, which Nordic is famous for. And wound up making a PCB with three 4 parts. The Schematics will be attached below.
The idea was to cut the joining pieces of the pcb, trim away excess and join them by yellow silicon wires to let them dangle, Making it sway as individual pcs rather than one solid PCB
But, here the quote "No plan survives first contact with the enemy" worked perfectly, as my PCBWay shipment got stuck with FedEx due to customs reason. So had to improvise. So I searched my inventory and found some old custom PCB which I used as proof of concept idea of my Aura alert project which I made in early Nov 2024 and April 2025, so technically I am making gold out of junk. SO It had esp32 and LEDs. But I felt that this alone was not enough for this competition I also wanted to preserve the full experience of naughty and good list, finding gifts under the Christmas tree. So here is my final plan
Make a 3D Printed Spiral Christmas tree with LED lighting up the spiral. The BLE Tracker and Beacon will be encased in a Christmas tree design casing. I can use the addressable LED to use the spiral as a progress bar to keep track of good deeds. The BLE beacons will broadcasts signal every 10 secs. The BLE Trackers will listen to the beacons and based on the Distance taken from RSSI value breathe LED, the speed of which is faster if its closer to the beacon. For now I will control the progress of good deeds using buttons on the tree, but if time permits I will control it using BLE itself, Once the Progress bar is completed, the Star at the top of the Tree will light up and activate the tracker. Then, the person can go and figure out where I've hidden the gift. In effect, the key to the gift is kept under the tree.
I got less than a week so the first thing I did was design the concept on a paper and model it on SolidWorks. Get it 3D printed with a circular tube going in a spiral. But the spiral which I thought to be elegant turned to look like an popular brown emoji. That's when I realized my mechanical engineering brain over-rode the design sense. Why? Circular cross section is structurally more stable than the rectangular which gives better ribbon look. Later I found an spiral on Thingiverse too. https://www.thingiverse.com/thing:7216904/files. I still went ahead and redid the design myself, but then 3D printing effort cooked spaghetti and I did not have time to retry it. I decided to go ahead with the circular tube spiral. I wrapped the led strip around it, and attached a star on top of it.
The PCB which I am using for the tracker and the BLE beacon has ESP32, WS2812B, MCP73831 (Battery Charger), AP2112K (3.3V LDO) which I will be using. The OLED, Haptic motor driver and switches I will not be using. As I said this PCB was designed for another project, but I made a mistake in the power sharing circuitry and thus had to do patchwork to get the battery charging correct. Regardless you can recreate this using any Feather ESP32 board, use regular LED instead of the RGB LED.
Code for the BLE Beacon:#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEAdvertising.h>
#include "esp_sleep.h"
#include <Arduino.h>
#define SLEEP_TIME_SEC 15
#define ADV_TIME_MS 1500 // advertise for 1.5 seconds
void setup() {
Serial.begin(115200);
delay(200);
// Init BLE
BLEDevice::init("GiftBeacon2");
BLEAdvertising *advertising = BLEDevice::getAdvertising();
advertising->setScanResponse(false);
advertising->setMinPreferred(0x06);
advertising->setMaxPreferred(0x12);
// Start advertising
BLEDevice::startAdvertising();
Serial.println("Beacon advertising...");
delay(ADV_TIME_MS);
// Stop advertising
BLEDevice::stopAdvertising();
Serial.println("Going to sleep");
// Deep sleep
esp_sleep_enable_timer_wakeup(SLEEP_TIME_SEC * 1000000ULL);
esp_deep_sleep_start();
}
void loop() {
// never reached
}Code for Tracker#include <BLEDevice.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
#include <Adafruit_NeoPixel.h>
#include "esp_sleep.h"
#define TARGET_NAME "GiftBeacon2"
#define LED_PIN 26
#define LED_COUNT 3
#define SCAN_TIME_SEC 20
#define SLEEP_TIME_SEC 10
Adafruit_NeoPixel pixels(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
bool beaconFound = false;
int bestRSSI = -1000;
class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks {
void onResult(BLEAdvertisedDevice device) {
if (device.haveName() && device.getName() == TARGET_NAME) {
beaconFound = true;
if (device.getRSSI() > bestRSSI) {
bestRSSI = device.getRSSI();
}
}
}
};
// ---------- LED EFFECTS ----------
void blinkRedFast(int times) {
for (int i = 0; i < times; i++) {
pixels.fill(pixels.Color(255, 0, 0));
pixels.show();
delay(120);
pixels.clear();
pixels.show();
delay(120);
}
}
void breatheWhite(int delayMs) {
for (int b = 0; b <= 255; b += 6) {
pixels.fill(pixels.Color(b, b, b));
pixels.show();
delay(delayMs);
}
for (int b = 255; b >= 0; b -= 6) {
pixels.fill(pixels.Color(b, b, b));
pixels.show();
delay(delayMs);
}
}
// ---------- RSSI → 10 STEP MAPPING ----------
int rssiToStep(int rssi) {
if (rssi >= -49) return 10;
if (rssi >= -54) return 9;
if (rssi >= -59) return 8;
if (rssi >= -64) return 7;
if (rssi >= -69) return 6;
if (rssi >= -74) return 5;
if (rssi >= -79) return 4;
if (rssi >= -84) return 3;
if (rssi >= -89) return 2;
return 1;
}
int stepToDelay(int step) {
// Step 1 = slowest, Step 10 = fastest
return map(step, 1, 10, 30, 4);
}
// ---------- SETUP ----------
void setup() {
Serial.begin(115200);
delay(500);
pixels.begin();
pixels.clear();
pixels.show();
BLEDevice::init("");
BLEScan *scan = BLEDevice::getScan();
scan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
scan->setActiveScan(true);
Serial.println("Scanning for GiftBeacon2...");
scan->start(SCAN_TIME_SEC, false);
if (!beaconFound) {
Serial.println("Beacon NOT found");
blinkRedFast(3);
} else {
int step = rssiToStep(bestRSSI);
int delayMs = stepToDelay(step);
Serial.print("Beacon found | RSSI: ");
Serial.print(bestRSSI);
Serial.print(" | Step: ");
Serial.println(step);
for (int i = 0; i < 3; i++) {
breatheWhite(delayMs);
}
}
pixels.clear();
pixels.show();
Serial.println("Sleeping...");
esp_sleep_enable_timer_wakeup(SLEEP_TIME_SEC * 1000000ULL);
esp_deep_sleep_start();
}
void loop() {}The Beacon advertises for 1.5Sec and sleeps for 15 seconds. The tracker scans for 20 seconds and sleeps for 10 seconds. This way, battery can be conserved and also the searching time for gift can be deliberately slowed down for better experience by building some excitement.
The Demo of TrackingThe Spiral Christmas Tree ElectronicsFor the Controlling of Spiral tree, due to time constrains I used my PCB from my last project, and we got some wonderful effects.
and Here is the final Photo of the project.
Keys to the Gifts under the Christmas TreeAnd yeah, was listening "Good bad Ugly". I love the background music
The ConclusionI am super happy that I was able to get a very crude albeit working model of the project I had in mind and more importantly I was able to repurpose my old PCB for a new breath of life. I still don't like the spiral with circular cross section and will reprint proper one, after some careful placement of the supports. Maybe I can make it as a DNA also as a regular lamp. If anyone wants to share my 3D Printing frustration, take a look at video which I will post in a comment soon. I am not responsible if you punch your monitor.
Last Minute Update:I got the Fedex Parcel with my PCB delivered an three hours before deadline.
Why did I post this "Excuse"? Well it's not an excuse. It's about making others informed of a possible risk in their development process. I chose PCBWay because they had the best tolerances when making the PCB in white soldermask. That high tolerance is needed because of the small size and the QFN Parts. And I needed white solder-mask for best reflection. The light from LEDs hit the diffuser sheet and only some of them is transmitted through the diffuser the rest is bounced back into the PCB. Having any other color than white on PCB solder-mask will absorb some of the light before reflecting back into the diffuser. That's why you'll notice most of the high power LEDs having white soldermask. Plus PCBWay is quite affordable for the white solder-mask and in my past experiences FedeX almost delivered within a week of shipping. But this time customs was not that forgiving. Thankfully as every engineer should have, I had a plan B.
Will post a new project with the PCB assembled and Tested





_4YUDWziWQ8.png?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)





_Ujn5WoVOOu.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)


Comments