Circuit Protection in Microcontrollers

The right approach to circuit protection can drastically improve the reliability of a product or design. Unfortunately, not all circuit protection comes in the form of hardware like fuses and transient voltage suppression. Some forms of circuit protection can come from software, and this can create confusion. In this article, we will explore how microcontrollers can play a role in circuit protection.

Basic Microcontroller Protection

When designing circuit protection circuits for microcontrollers, it is imperative that the basics are taken care of first. This means that any digital pins which connect to conductors and are exposed to the outside world (such as connectors) are properly protected with zener diodes and current limiting resistors. Analog inputs are also required to have zener diode and current limiting measures if they too connect to external conductors.

Microcontroller designs are also sensitive to noisy power rails due to their CMOS nature (noisy power lines can cause logic gates to incorrectly operate). As such, it is important that the correct type of decoupling capacitors is used. Bulk capacitors (such as polarized) are useful for handling sudden power demands from peripherals and high-power devices. Small, non-polarized capacitors, on the other hand, are useful for reducing switching noise on power rails.

It is often required that small, non-polarized capacitors with low equivalent series resistance (ESR) values are placed at each pair of power pins of a microcontroller. For example, the PIC18F45K22 has two pairs of input power (VDD and VSS) and each pair should have a low value ceramic capacitor (such as 10nF) directly connected to them.

관련 상품 참조

PIC18F45K22-I/PT

Microchip Technology Microcontrollers - MCUs 보기

Types of Circuit Protection

So far, the protection methods described above are often passive and deal with surges only. What about other forms of circuit protection?

While voltage and current surges can damage a microcontroller, unreliable power supplies and power interruptions can arguably cause more damage (just not in the physical sense). Circuits in general are rarely damaged when operating at reduced voltages, but circuits that involve digital logic can behave unexpectedly.

From an outsider’s perspective, a microcontroller-based circuit running at a reduced voltage may still be able to drive displays and run firmware (therefore appearing to work), but data from external sources, such as I2C devices, can be unreliable as they won’t be operating at their correct voltage levels. This can lead to a false sense of reliability. If the circuit is controlling safety equipment, there is a serious risk to injury if only half of the circuit is working.

So, how can circuits be defended from reduced power levels?

Brown-Out Detection in Microcontrollers

While over voltage and current is often mitigated against with the use of external, discrete components (such as fuses and diodes), power reduction (known as brown-outs) can be trickier to defend against.

One method is to design dedicated circuitry that can run on small voltage levels and actively monitor the power rails. The problem with this approach is that it can increase the price of the design as well as the complexity of the final PCB. However, there is often one source in abundance that would most likely mitigate cost for a designer.  That being the microcontroller itself. It is not uncommon for microcontroller-based designs to have spare peripherals, pins, memory, and processing time. This means that designers do not need to include additional components into their design to perform active circuit health monitoring. Some microcontrollers (such as the Microchip Technology’s PIC18F45K22) include brown-out peripherals, which can cause resets and set flags to indicate to the firmware that a brown-out was detected.

So, how would basic circuit monitoring system be implemented with a microcontroller?

Microcontroller Input Voltage

The basic layout for microcontroller-based circuit protection is shown below and only requires two pieces of hardware; a spare analogue input and an internal bandgap reference. The analogue input is needed to measure the external VDD voltage while the bandgap reference provides a reference. The importance of the bandgap reference cannot be understated due to how ADCs typically work. An ADC will produce a binary output whose value is proportional to the input voltage to the ADC and the ADCs two references. If the ADCs reference is the power rails then the ADC reading of the VDD power rail will always be the maximum value. The use of a bandgap reference provides a voltage reference for the ADC that is independent of the power supply voltage and therefore allows the microcontroller to measure the power supply voltage. Bandgap references are also useful as they are temperature independent, meaning they can provide accurate voltage readings for the entire temperature range.

Brown-Out Detection Circuit

The simple flowchart example above shows how a microcontroller can be used to actively monitor its power supply voltage. This is particularly useful in situations where the power supply is enough to run the microcontroller but not external hardware. Unfortunately,, this example will not protect the microcontroller against brown-outs. In brown-out  scenarios either a dedicated brown-out detection circuit is required (which would rely on a bandgap reference) or a microcontroller that has its own brown-out detection system. For many designers, the use of an additional external circuit is often too expensive with regards to product cost, component count, and PCB real estate. Therefore, the use of a microcontroller with a built-in, brown-out detection peripheral is preferable.

The PIC18F45K22 is an example of a MCU that includes varying voltage trip points. Once a brown-out is detected the MCU is reset and a special CPU flag is set to inform the user that a brown-out reset occurred. Since the MCU performs a reset, it is imperative that a special handler is first executed, which checks the CPU flags (including the brown-out flag). If the flag is set, then specific actions can be taken such as shutting down external peripherals and presenting warning lights.

Conclusion

Microcontrollers make up the core of many products and their wide range of capabilities make them able to perform many different tasks. Due to their I/O nature, they are also able to perform circuit health monitoring and can use spare analogue channels to read different points on a circuit.

Microcontrollers also offer the ability to perform very complex procedures during circuit failure and can help strengthen your next design.

newsletter 1

최신 뉴스

Sorry, your filter selection returned no results.

개인정보 보호정책이 업데이트되었습니다. 잠시 시간을 내어 변경사항을 검토하시기 바랍니다. 동의를 클릭하면 Arrow Electronics 개인정보 보호정책 및 이용 조건에 동의하는 것입니다.

당사의 웹사이트에서는 사용자의 경험 향상과 사이트 개선을 위해 사용자의 기기에 쿠키를 저장합니다. 당사에서 사용하는 쿠키 및 쿠키 비활성화 방법에 대해 자세히 알아보십시오. 쿠키와 추적 기술은 마케팅 목적으로 사용될 수 있습니다. '동의'를 클릭하면 기기에 쿠키를 배치하고 추적 기술을 사용하는 데 동의하는 것입니다. 쿠키 및 추적 기술을 해제하는 방법에 대한 자세한 내용과 지침을 알아보려면 아래의 '자세히 알아보기'를 클릭하십시오. 쿠키 및 추적 기술 수락은 사용자의 자발적 선택이지만, 웹사이트가 제대로 작동하지 않을 수 있으며 사용자와 관련이 적은 광고가 표시될 수 있습니다. Arrow는 사용자의 개인정보를 존중합니다. 여기에서 당사의 개인정보 보호정책을 읽을 수 있습니다.