Three LEDs with a combined forward voltage of approximately 9V lit by a 1.5V battery with an inductor in series shown at 0.5x speed from Magic of Magnetism and Inductors by ElectroBOOM.

Microcontrollers vs Inductors

Inductors can generate high voltages which may exceed the desired levels in a circuit. The video above shows a single-cell battery connected to an inductor (top right) in series with three white LEDs. The white LEDs require over 9V to illuminate but a mere 1.5V battery is able to briefly illuminate them due to the inductor's effect.

In this case the red wire is being used to briefly short across the non-conducting LEDs to allow current to flow from the battery through the inductor. The inductor is storing energy in its magnetic field and this field products the momentary higher voltage as the red wire is removed from the circuit. This demonstration of voltage spikes suggests care is required when using inductors in circuits to keep voltage levels at normal levels to avoid damaging sensitive components.

TDK, a company founded on the invention of ferrite, offers an explanation of this below with a parallel version of the circuit lighting a 70V neon lamp from a 4.5V battery. This is from TDK's The Wonders of Electromagnetism: Power Inductors in Mobile Phones.

sensors_tdk-wonders-of-electromagnetism-self-inductance-diagrams-trimmed.png
Explanation of self induction and generating voltage spikes with an inductor in parallel. Copyright TDK Corporation.

GPIO Protection

The general-purpose input/output (GPIO) pins on microcontrollers typically have some limited protection built-in for adverse voltages often to deal with static electricity (ESD). The CLUE board uses an nRF52 series chip and this has two internal diodes on each GPIO pin. The partial schematic below shows an example of how these these two diodes are used for one pin.

sensors_clue-nrf52840-gpio-pad-protection-v1.png
Partial schematic showing one example of a reverse-biased diode pair inside the nRF52840 microcontroller protecting input and output against over/under voltage. The CLUE board's 1M resistor to facilitate touch input is also shown.

The schematic shows the CLUE board's 1 Megaohm resistor. There's one resistor per large pad used for the capacitive touch implementation. The schematic also shows an external resistor. This is another precaution that's typically used to limit output current but it will also reduce any current flowing through these very small, protective diodes in the microcontroller.

The metal detector circuit on the next page uses a resistor primarily to limit the current from the P1 output but it will also reduce any adverse currents from under or over voltages caused by the inductor.

The square wave (3.3V pk-pk, 84% duty cycle) can be seen with and without the inductor in the circuit here. The inductor does cause a small negative voltage which briefly "peaks" at -0.6V on the P1 pin/pad. The magnitude and brevity of this spike and the current protection from the external 1k resistor mean the microcontroller is not at risk.

Larger Coil Currents

If more current was being used through the coil then an external protection diode capable of handling this higher current would be a wise precaution. The CLUE's nRF52840 can only supply low currents, higher currents would need a separate power supply and switching with a transistor. This could aid isolation of the GPIO from the maleffects of the voltage spikes.

Diodes are commonly found across motors, relays and solonoids protecting against back EMF and are sometimes referred to as "flyback" diodes.

This guide was first published on May 13, 2020. It was last updated on Mar 28, 2024.

This page (Microcontrollers vs Inductors) was last updated on Mar 08, 2024.

Text editor powered by tinymce.