Wireless vibration node for predictive maintenance
Battery-powered accelerometer node that computes RMS and FFT bands on-device and reports over MQTT.
Embedded Engineer · Hardware & Firmware
I design sensor front-ends and write the firmware behind them. This is where I keep articles, project logs and a running lab journal, written the way I'd want a datasheet to read.
A 5 Hz sensor signal buried in white noise and 180 Hz mains-harmonic hum, cleaned by a 2nd-order Butterworth biquad, the same five-multiply filter that runs in firmware.
An accelerometer on a motor turning at 1500 rpm. The time waveform looks like noise; the spectrum separates every fault by frequency.
A 6205 bearing with a growing outer-race spall. Trending its vibration and fitting a curve gives the remaining useful life (RUL), set against the catalogue L10 rating.
A Li-ion cell under pulsed load. Coulomb counting integrates a slightly biased current sensor and drifts. The extended Kalman filter also uses the terminal voltage and stays on the true SOC.
IMU + temperature sensor → nRF71 MCU → Sub-GHz radio (868 MHz) → gateway → MQTT broker → dashboard. The node reports the 3-axis vibration RMS, temperature, RSSI and battery.
A first-order-plus-dead-time process following set-point steps up and down, a ramp and a hold, then rejecting a 30 % load disturbance.
A low-pass filter in front of a 12-bit ADC sampling at 1 kSPS. Anything above Nyquist (500 Hz) folds back into the band, so the filter must suppress it below 1 LSB.
A constant input sampled 16,384 times. The output codes form a bell curve. Its width, not the datasheet bit count, sets the real resolution.
The MCU sends 'A' (0x41) as an 8N1 frame once the peer asserts CTS, then raises RTS and receives the reply 'K'.
USART1->BRR = SystemCoreClock / 115200; // 8N1 at 115200 baud
USART1->CR3 |= USART_CR3_RTSE | USART_CR3_CTSE; // hardware flow control
USART1->CR1 |= USART_CR1_TE | USART_CR1_RE | USART_CR1_UE;
while (!(USART1->ISR & USART_ISR_TXE)) {} // waits while CTS is not asserted
USART1->TDR = 'A'; // start, 1000 0010, stop
while (!(USART1->ISR & USART_ISR_RXNE)) {} // wait for the reply
char ack = USART1->RDR; // 'K'A standard frame, ID 0x123 with two data bytes, drawn bit by bit: the real CRC-15, the inserted stuff bits and the differential CAN_H / CAN_L levels.
CAN_TxHeaderTypeDef h = { .StdId = 0x123, .IDE = CAN_ID_STD,
.RTR = CAN_RTR_DATA, .DLC = 2 };
uint8_t data[2] = { 0xDE, 0xAD }; uint32_t mbox;
HAL_CAN_Start(&hcan1); // 500 kbit/s, sample point 87.5 %
HAL_CAN_AddTxMessage(&hcan1, &h, data, &mbox); // CRC + stuffing done in hardware
// Linux SocketCAN: ip link set can0 up type can bitrate 500000 sample-point 0.875
// cansend can0 123#DEAD · candump can0CircuiTikZ schematics, WaveDrom timing and register maps, live CircuitJS simulations, KiCad viewers, JSXGraph plots and Cytoscape networks — all from plain Markdown.
Everything this blog can render — LaTeX maths, Mermaid flowcharts, draw.io figures, Obsidian callouts, layouts, task lists and tables, and syntax-highlighted C, C++ and Python.
Burden resistor sizing, protection, filtering and scaling — a loop receiver that survives wiring mistakes in the field.
How an A/B image layout, a tiny boot-state record and a watchdog give you firmware updates that can't brick a device.
TVS clamped it, but the ADC reading drifted 0.3 % afterwards. Suspect the series resistor.
500 random power cuts during update. Zero bricks, two rollbacks — exactly as designed.
Battery-powered accelerometer node that computes RMS and FFT bands on-device and reports over MQTT.
Ratiometric 3-wire RTD measurement with lead-wire compensation and a loop-powered output stage.
From an ADC reading to calibrated, filtered engineering units on a Cortex-M MCU — with real hardware in every lesson.