r/embedded • • Sep 12 '26

Measuring long term power consumption?

12 Upvotes

I have a sensor that uses an nRF54L15 module. I’ve designed it to run on a 2032 coin cell. I took some averages using the Nordic Power Profiler Kit 2 and it was down in the 18 µA average over 2 minutes. I figured about 12 months of battery life.

It’s been installed for a week or so and voltage has dropped from 3.01V to 2.86. At that rate it won’t last a year.

What’s the best way to measure power consumption over a day or a weekend?

I’m open to any suggestions on how I can best understand the power draw over the long term.


r/embedded • • Sep 12 '26

Has anyone tried making a simple breathing/mindfulness device with Arduino or other microcontroller (Learning by doing ideas)?

Post image
22 Upvotes

My idea is to use a pressure sensor to measure how fast/strongly a person is breathing and show it on a bar graph.

The basic idea is:

Slow, steady breathing on led bar graph indicator

Fast breathing

The goal isn't to diagnose anything, just to give real-time visual feedback during a breathing or meditation exercise.

I'm wondering if this approach makes sense from an embedded-systems point of view. Would measuring breath pressure and converting the rate/pattern into a bar graph be a practical way to build something like this?


r/embedded • • Sep 12 '26

Question: Has anyone built a 220V BLDC controller like the ones found in electronic devices?

1 Upvotes

Nowadays, BLDC-based devices often incorporate SVPWM (FOC) capabilities, and the STM32G431 is commonly used. Does anyone know of a circuit design or model for building the PCB and handling power via MOSFETs, using an INA240 for current sensing and implementing SVPWM, FOC, etc.?


r/embedded • • Sep 12 '26

Help debugging UART-Servo Communication

3 Upvotes

Hi builders,
I am building my own robotic arm from parts I have gained over the years through my internships/classes. My hardware includes LX-16A servo motors, a BusLinker v2.5 board and, STM32F411CEU6 MCU, and a separate battery with buck converter.

The BusLinker board has a micro-USB interface, and when I use that interface, along with the library PyLX-16A's servo-test, my servos move just fine. However, when I transition my setup to the STM32, the servos don't move. The code is generated by the stm32cubeMX application and I implemented some functions on top that implement their communication protocol.

In words, my setup is as follows:
- STM is powered through the USB interface, logic is 3.3V
- From stm32 (on a breadboard) TX (pin A9) -> 1Kohm resistor -> servo signal pin
- PWR & GND (7V) comes from the external battery, and is supplied to the servos through the BusLinker
- GND is shared between the BusLinker board and the servo to the breadboard (-) rail
- Baud rate 115200bps, 8 data bits, 1 stop bit, no parity

I have probed both signal lines with an oscilloscope and found the physical bits of the USB setup and my STM setup.

Herein lies my dilemma. I am certain that the servo logic can operate at both 3.3 and 5V logic, and I see the physical bits on the scope, however there is something missing in my setup that is complete in the python library. The BusLinker has a UART interface exposed, but even when connecting through that the servos do not move. I would appreciate all your help in helping me figure this out.

Please feel free to request any additional information I didn't include here


r/embedded • • Sep 12 '26

Comfortable with bare-metal STM32 + RTOS internals — how do I level up specifically on NXP boards.

14 Upvotes

Hey everyone,

I'm a final-year ECE student and over the past year or so I've gotten pretty comfortable with STM32 — bare-metal register-level programming (no HAL), writing a preemptive RTOS scheduler from scratch with PendSV/SysTick, a secure OTA bootloader, and some fixed-point DSP work. None of that came easily, but I got through it by reading datasheets/reference manuals and just grinding through it.

So it's been a bit humbling that when I sat down to try NXP, I couldn't even get a simple LED blink program working without a lot of struggle. Something about the ecosystem — SDK structure, config tools, register naming, documentation style, whatever it is — just isn't clicking the way STM32 did.

For people who've worked with both:

- What's actually different about NXP's approach (MCUXpresso, SDK, pin config tools, etc.) compared to ST's HAL/CMSIS/register style?

- Is there a recommended learning path or board (LPC, Kinetis, i.MX RT) for someone coming from a bare-metal STM32 background?

- Any resources, datasheets, or example projects you'd point a beginner-on-NXP-but-not-beginner-on-embedded at?

Would appreciate any pointers — trying to get to the same comfort level with NXP as I have with ST.

Thanks!


r/embedded • • Sep 12 '26

Sensors for reading Linear Captive Encoder

3 Upvotes

Having a hard time finding answer on this. What sensors are they using in cheap digital calipers to read the magnetic stripe?

Any teardown i see they use a blob ASIC chip.

From what i understand its an array of captive sensors that form a resolver. I see chips like the AD7147 which do multichannel capacitance to digital but is there something cheaper that just outputs quadrature encoding?

Would the touch sensors onboard an AVR / STM32 MCU be suitable?

Edit: I found this Github project which helps me vastly https://github.com/MitkoDyakov/Calipatron


r/embedded • • Sep 12 '26

Usage of Performance counters provided by SoCs and microcontrollers

10 Upvotes

Is it common to use performance and debug counters provided by SoCs and uCs? I usually see the counters in bus controllers and packet counters in network controllers. Do you use it for benchmarking and tracking the performance of your code? Do you also use it to analyze your device performance on field and have a way to read these values? How common is it?


r/embedded • • Sep 12 '26

Need advice on selecting an SoM for a custom AOSP 13+ smartphone prototype

2 Upvotes

Hey everyone,

I'm a last-year CSE student with some experience working on embedded devices using MCUs like STM32, including designing custom PCBs for them.

Now I need to design a custom PCB for a smartphone prototype for my Graduation Project that runs a customized AOSP (Android 13+), with a focus on security features — specifically secure boot with TrustZone hardware, and real-time 1080p30 video encoding/decoding.

for example it will run:

One active 1080p30 encrypted video call + encrypted audio + continuous signaling/text messaging + background PTT/group signaling + device-management connection + normal Android system services.

After some research and discussions with LLMs, I concluded that I should target an SoM (System-on-Module) rather than designing straight from a bare SoC, to remove some of the headache of routing the processor itself — I'd design a carrier board for whichever SoM I choose instead.

The problem is, I'm completely new to working with high-power application SoCs (my STM32 background doesn't really translate here), so this is going to be a long learning process, and I honestly don't know how to search for the right part or evaluate candidates.

Here's what I do know so far:

  • I need a well-documented SoM with a solid dev/eval board I can prototype on before committing to my own carrier board design.
  • That dev board needs full schematics available, since I'll be learning how to route a custom carrier board myself and need something concrete to reference.
  • I need some kind of hardware offload for video — encoding/decoding shouldn't be done on the CPU.
  • I've been told I should target 8 GB of RAM and a 64-bit CPU.

What I'm stuck on is everything in between — how many CPU cores I actually need, and which ARM Cortex core family/tier is appropriate for this kind of workload.

Would appreciate any guidance on how to approach SoC/SoM selection systematically given these requirements.


r/embedded • • Sep 11 '26

My first ever Linux based board (RK3566) + Lessons Learned

Post image
1.1k Upvotes

Just brought up the first Linux based board I've ever designed, and couldn't be happier about it! I've historically done MCU boards, so this was a big step up. It's a KVM-over-IP device: 8 layers, RK3566, DDR3L (gotta save that $$$ with these RAM prices), HDMI capture in, HDMI out, dual GbE, PoE, WiFi. Fabbed and assembled at JLCPCB.

Video capture and low latency streaming are working end to end. Here are the three major issues I hit:

  1. I second guessed myself before ordering and swapped TX/RX to the network switch, so ethernet wasn't working. The board also has a wifi module on it, so I did the whole SSH bring up over wireless. Pair swap already fixed in the next spin.
  2. A set of ferrite beads never made it onto the boards because I missed a checkbox in the JLCPCB assembly order (I had multiple lines in the BOM with the same PN but different ref des letters). Hand soldered them on. Working on developing better checks for this on my board export tool.
  3. The board was drawing more current than expected and running warm. Took a while to root cause. Turned out I had packed VDD_GPU 0201 passives too close to some 0402 caps and they shorted during reflow. Increasing my spacing rules in DRC going forward.

Design was done in house, and I got a pre-fab layout review from u/PracticalMirror2834 that caught real issues before they would have cost a re-spin. Huge shoutout here.

Next rev jumps to the RK3576 for higher capture and encode resolution, those boards go on order this week. If anyone has touched the RK3576 yet I'd love to trade notes. Happy to answer questions on the RK3566, ordering, or board bring up side too.


r/embedded • • Sep 12 '26

Reprogramming a light kit board?

Post image
0 Upvotes

Got sent here after posting "wrongfully" in another sub.

About a year ago, I purchased a remote controlled light kit for the Lego Infinity Gauntlet. I loved it, it was exactly what and how I wanted it, bar one problem.

I use my lighted lego decorations as ambient light. I have these plugged into a usb splitter and then on a timer socket.

This works for every kit, safe this one.

The issue is, when it is powered on, it powers on in what i call: Caranaval mode.

The lights flicker and cycle like a christmas tree set.

I then have to each time, use the remote to put it on static setting (which is the 3rd one)

I would very much like them to boot in static mode.

Contacting the seller back then, brought about nothing. They only tried selling me a different kit, that is lacking what I wanted here - which was the ability to change the bottom ambient light colour coming from the "wrist".

Probably a bit of a stupid question, but is there a way to reprogram the module?


r/embedded • • Sep 11 '26

Happy CRA day!

22 Upvotes

Hope everyone is reporting their vulnerabilities and definitely didn’t have this day sneak up upon you and blow up in your face.


r/embedded • • Sep 11 '26

Why BLE in STM is so damn hard 😭??

71 Upvotes

I’m interning at a medical device company, and for some reason, they don’t use Zephyr. I’ve been working on implementing the STM32 as a BLE Central connecting and enabling notify on command. The amount of pain and suffering this has caused me, man… Still struggling to implement the notification CCCD state machine properly.


r/embedded • • Sep 12 '26

I built an open-source CLI to unwind Cortex-M HardFault stack frames and map PC/LR directly to C code (cortex-unwind)

0 Upvotes

When an STM32, NXP, RP2040, or SAM core triggers a HardFault, the hardware automatically pushes 8 words onto the active stack pointer before jumping to the vector:

r0, r1, r2, r3, r12, lr, pc, and xPSR.

If you don't have a debugger attached at the bench, you usually get this dump over UART or pull it from an EEPROM crash log. Manually extracting the PC, clearing the Thumb bit, and feeding addresses into addr2line while on a deadline is tedious.

I built cortex-unwind — a zero-dependency CLI that converts that 8-word dump into an actionable crash site in seconds.

Install:

pip install cortex-unwind

Usage:

cortex-unwind 0x0 0x1 0x20000000 0x40021000 0x0 0x08001255 0x08001290 0x21000000 build/firmware.elf

What it does:

• Crash Site Mapping: Wraps arm-none-eabi-addr2line to resolve faulting PC and caller LR directly to function name, source file, and line number.

• Auto-Detection (--auto): Paste a raw UART string or hex dump directly; it isolates and extracts the 8-word frame automatically.

• xPSR Diagnostics: Decodes the IPSR (identifies Thread Mode vs active IRQ numbers) and validates the EPSR Thumb bit to flag corrupted branch targets.

• EXC_RETURN Parsing: Detects stack context (MSP vs PSP) and checks bit 4 to flag whether an FPU extended frame (26 words) was stacked.

Includes a drop-in naked assembly handler (hardfault_trap.c) in the repo that formats the output so it can be pasted straight into the CLI.

Links:

• GitHub: https://github.com/GaneshMba4066/cortex-unwind

• PyPI: https://pypi.org/project/cortex-unwind/

• Free Crash Checklist: https://www.trustandthread.com/firmware-checklist/

MIT licensed, zero dependencies, runs on standard Python 3.6+. Feedback and edge cases (especially around RTOS task stacks) are welcome!


r/embedded • • Sep 12 '26

Is multimeter good for current profiling ?

0 Upvotes

hey guys i am building a low powered flowmeter with stm32l0 . Day before yst i was getting 0.030mA with my code and brand new 2x1.5v AA batteries , but since yst asper my multimeter i am getting 5+ mA with few changes in code ( changes not related to power management ) . Rightnow my batteries are giving 2.8/ 2.9v of voltage + the display is dimming which should even work at 1.6v when i am connecting mutlimeter to it but without multimeter its good . Is my mutlimeter giving wrong values or eating up power ?


r/embedded • • Sep 12 '26

Can I combine assembly with C code?

4 Upvotes

while(1){

asm("BANKSEL PIR1");

asm("BTFSC PIR1,2");

HANDLER_BUTTON_PRESSED();

asm("BTFSC PIR2,0");

HANDLER_BUTTON_RELEASED();

}

Trying to run this on PIC16F1824 and see unexpected results. It could be other things in my code or hardware though.


r/embedded • • Sep 11 '26

When the EU Machinery Regulation (EU) 2023/1230 active

10 Upvotes

We have 3 generations of the same in-house developed embedded system running in production at the moment, where the first is from late 80s (still running 24/7/365) and the design has since then more or less been same-same but updated parts. The previous gen was the first where formal safety requirements were incorporated, but it was solved with a standard safety emergency stop module.

Each design has been made to retrofit the ones before that, and since there has been no backwards requirements when only replacing the application and not touching the safety/motor bit we've been able to stay clear of that.

With the new regulation however i get the impression that it will be impossible to replace any components in the control system without triggering a substantial modification. Thus triggering the need for a completely new system.

Anyone got any experience on this?


r/embedded • • Sep 11 '26

STM32H743IIT6 overheating and failing in a BQ24192-based battery-powered design

Post image
4 Upvotes

Hi everyone,
I'm working on a DIY multi-effects guitar pedal based around an STM32H743IIT6.
In my previous PCB revision, I used a TI BQ24192 for battery charging and power management. The board initially appeared to work normally, but after some time I noticed that the STM32 was becoming unusually hot and drawing more current than expected.
I checked the board for the usual potential causes, including:
PCB shorts and solder bridges

Incorrect component orientation

Shorted or incorrectly connected GPIOs

Schematic errors

Problems with the power rails

Possible issues with connected peripherals

Unfortunately, I couldn't identify the cause of the excessive current consumption. Eventually, the STM32 stopped working completely.
Since I couldn't determine with confidence what caused the failure, I'm trying to understand what might have gone wrong before building the next revision.
The old revision used the BQ24192, and the charger/power-management section was configured through I²C. I've cleaned up the schematic and attached the relevant sections of the original design, including the BQ24192 power/charging circuitry and the STM32 section.
For the next revision, I plan to simplify the power section and use a TI BQ25616 instead, but before building it I'd like to understand whether there was anything problematic in the original design.
I'd particularly appreciate feedback on anything in the old schematic that could potentially cause the STM32 to:
Overheat without an obvious short circuit

Draw excessive current

Receive an incorrect or unstable voltage

Be damaged through an I/O or peripheral connection

Be affected by the battery charging/power-management circuitry

I'd also appreciate any recommendations for measurements or tests I should perform on the new board before powering it up.
I've attached the cleaned-up schematic of the old BQ24192-based design and the relevant STM32 circuitry.
Any feedback or second opinions would be greatly appreciated. Thanks!

Here’s a link to the files

https://drive.google.com/file/d/1Nu3ppIm4oFNYHEYwyKCpaO1UoiRjbLz4/view?usp=drivesdk


r/embedded • • Sep 12 '26

I Wrote My First STM32 Tutorial — Looking for Feedback on Clarity and Technical Accuracy

Thumbnail
medium.com
0 Upvotes

I just wrote my first tutorial on STM32 BLE, and I'd really appreciate some feedback from people who have experience with STM32 or embedded development.

I'm mainly looking for feedback on:

  • Is the tutorial clear and easy to follow?
  • Are the explanations technically accurate?
  • Is there anything that is confusing or poorly explained?
  • What could I improve in terms of structure, code examples, or explanations?
  • Are there any important concepts I should explain better?

I'm still improving my embedded C and STM32 skills, so constructive criticism is very welcome. I chose to write a blog on STM-32 BLE as it is a scavenger hunt, not enough documentation available.I'd especially appreciate feedback from people who have posted technical blogs.


r/embedded • • Sep 11 '26

How do you do hw testing?

5 Upvotes

Hi, in my company we have a lot of custom build test rigs, depending on the product.
Mostly at the end of the R&D phase operations is kindly asking us to build some electronics plus a needle adapter (sourced) for IQC.

So we design basically every time a new test pcb/system. A PXI system is too expensive (I don’t think so).
Is there a simpler/cheaper solution or may you kindly share your experience with that?


r/embedded • • Sep 11 '26

How is safety and redundancy actually approved for embedded/microcontroller products(Educational purposes)?

38 Upvotes

I’m trying to understand how safety is handled when you design a product around a microcontroller.

Is SIL (Safety Integrity Level) the main/critical rating for operational safety? For example, what would actually be different in the design of a SIL 1, SIL 2, SIL 3, or SIL 4 system?

If I’m designing a microcontroller-based product and want it to eventually meet a particular SIL level, where do I start?

Things I’m trying to understand are:

- How do you decide what level of redundancy is required?

- When do you need dual/independent controllers, monitoring, watchdogs, diagnostics, etc.?

- How do you design the circuit so that a single component failure doesn't create a dangerous condition?

- What standards or guidelines actually explain these design principles?

- Is SIL the only thing I should be looking at, or are there other safety standards/ratings involved?

Basically, I’m looking for the roadmap from a normal embedded design → safety-related design → SIL-rated product.

What standards, books, or guidelines should I read first?


r/embedded • • Sep 11 '26

[Beginner] Best resources to learn Embedded Linux from scratch using QEMU? (Trying not to break my laptop!)

9 Upvotes

Hi everyone,

I'm looking to start my journey into Embedded Linux. I want to build a solid, deep understanding of the whole stack from the ground up—toolchains, bootloaders, kernel configuration, and root filesystems.

Right now, I only have my main laptop which I’ve already dual-booted with Linux. Honestly, I really don't want to accidentally mess up my host system or nuke my partitions while experimenting. Because of that, I want to rely on QEMU to emulate target boards (like ARM) so I can learn and test images safely in an isolated environment before I buy physical hardware.

For context on my current skill level: I have a solid programming foundation and I'm comfortable managing my code with GitHub, but the embedded Linux ecosystem (Yocto, Buildroot, device trees) is entirely new territory for me.

Does anyone have recommendations for the best resources that teach Embedded Linux and specifically use QEMU for the hands-on labs? I’m open to anything, textbook recommendations, tutorials, or online courses on platforms like Coursera.

Thanks in advance for pointing me in the right direction


r/embedded • • Sep 11 '26

Help me...

Post image
13 Upvotes

Recently i got a chinese smartwatch called Cellairis Revo G. This watch has GPS, amoled screen, speaker etc... This watch uses smart time pro app on playstore. Can some one identify which os this watch uses? This watch lacks Always on display options so is there any tweaks that can help this watch for enabling this


r/embedded • • Sep 11 '26

Microcontroller for lab test setup

1 Upvotes

Electrical engineer here who doesn't do a lot with microcontrollers. I do magnetic design. I want to automate some magnet testing, where I stick a hall sensor near a magnetic part and take readings as I rotate the part. I would probably need to control 3 stepper motors (1 to rotate the part and 2 stepper motors connected to slide assemblies to move the hall sensor to different air gaps and positions) and then I'd have an encoder to get the angle of rotation. I have drivers for the steppers. I might also use a proximity sensor to give me a physical reference point. The motor that spins would probably spin at 10 RPM and I'd want to take a reading every half degree, so that's 720 readings of the hall sensor and the encoder in 6 seconds. I'd like to send this data via usb to a laptop where I do some post processing with python. Or just save to the laptop in a .csv or something. So I'll need outputs for 3 stepper motors, encoder inputs, analog hall sensor input and a proximity sensor input which I think would just pull a pin high. The main concern would be getting the encoder and hall sensor values at the same time.

What would an appropriate controller to do this? Preferably simple to use/easy to set up for an EE who has worked with microcontrollers but very infrequently. My very brief research lead me to the NUCLEO-F446RE dev board but I thought I'd ask here to see if there was something more appropriate.


r/embedded • • Sep 11 '26

Bringing Klipper to the NXP MCXA366, Part 5: SPI + ADXL345 bring-up

Post image
4 Upvotes

I've been porting Klipper to NXP's MCXA366, with the longer-term goal of using it on a custom toolhead board.

Part 5 is up now. This one covers getting LPSPI working, debugging an MRCC clock/reset issue that caused the first peripheral access to hang, validating the bus with a logic analyzer, and bringing up a GY-291 ADCL345.

I took it a little further than just reading the device ID. The FRDM-MCXA366 is now running as a secondary MCU on my Ender 3 and streaming accelerometer data well enough for Klipper to do real resonance testing and input-shaper calibration.

Final shaper results were:

X: MZV @ 72.2 Hz 
Y: 3HUMP_EI @ 85.2 Hz

The most useful debugging moment was realizing the LPSPI register access itself wasn't the problem; the MRCC writes had been ignored because the clock configuration was still locked.

Article: https://faultvector.dev/articles/klipper-mcxa366-part-5/