ecobin · BLE sensor · 2026
Fill-level monitoring over BLE
Smart waste-bin sensor: an ultrasonic sensor measures the fill level and a TI CC26xx SoC transmits it over Bluetooth Low Energy to an Android app. PCB designed in Cadence OrCAD; ultra-low-power C firmware split between the ARM core and the Sensor Controller.
C · Kotlin · github.com/bobbisasha/prj13_board_firmware
static void scTaskAlertCallback(void) {
static uint8_t packet[4];
static uint8_t packetIndex = 0;
scifClearAlertIntSource();
uint32_t count = scifUartGetRxFifoCount();
while (count > 0) {
uint8_t b = (uint8_t)scifUartRxGetChar();
count--;
if (packetIndex == 0) {
if (b == 0xFF) {
packet[0] = b;
packetIndex++;
}
} else {
packet[packetIndex++] = b;
if (packetIndex == 4) {
if (((packet[0] + packet[1] + packet[2]) & 0xFF) == packet[3]) {
scSensorPayload[0] = packet[1];
scSensorPayload[1] = packet[2];
scSensorPayload[2] = 0;
scSensorPayload[3] = 0;
scSensorPayload[4] = 0;
Event_post(syncEvent, SBP_SC_ALERT_EVT);
}
packetIndex = 0;
}
}
}
scifAckAlertEvents();
scifOsalEnableTaskAlertInt();
}
Measurement cycle · not to scale
- ARM core sleeps while the sensor boots, then reads a full FIFO
- BLE disconnect: timer stopped and sensor powered off
Bin 1
Connected · live
- Distance
- 14 cm
- Depth
- 50 cm
In-app calculation
fullness% = (depth − distance) / depth × 100
BLE characteristic CHAR5 · notifications or polling · demo mode for the emulator