You are currently viewing External Brown-out Detection and Protection of Arduino using MC34060
External Brown-Out Detection and Protection

External Brown-out Detection and Protection of Arduino using MC34060

External Brown-out Detection of Arduino

When we talk about “external brown-out detection” on an Arduino, we’re referring to a feature that monitors the supply voltage of the Arduino microcontroller. If the voltage drops below a certain threshold, this feature can step in to prevent the microcontroller from malfunctioning.

To keep your Arduino operating smoothly, it’s important to maintain a stable voltage above a specific threshold that matches its operational speed. If the voltage dips too low, the Arduino might begin to execute commands incorrectly, leading to unexpected behavior and potential corruption of its internal memory and registers.

What is Brown-Out Detection (BOD)?

Brown-Out Detection (BOD) is a feature found in many microcontrollers, including the Atmega328 used in Arduino boards. Its primary function is to monitor the voltage level of the power supply to the microcontroller and ensure that the microcontroller operates within safe voltage levels.

How the Brown-Out Detection works?

It works by continuously monitoring the supply voltage (VCC) and comparing it to a predefined trigger level. If the VCC drops below this threshold, indicating insufficient voltage for reliable operation, the BOD circuit steps in. It triggers a reset to prevent unstable behavior and potential data corruption. This reset mechanism ensures that the microcontroller operates safely and maintains data integrity, thereby enhancing the overall reliability of the system.

Voltage Requirements and Stability for Arduino ATmega328P

Arduino boards with the ATmega328p are configured to use a 16MHz oscillator, which is essentially a ceramic resonator with a built-in load capacitance of 15pF. According to the datasheet, to operate at a speed of 16MHz, a voltage of 4.5V to 5.5V is required. If you are using an Arduino in an application where precise timing is critical, and the voltage drops below 4.5V, you may experience disruptions in your code.

 While it can still function at 4V for simple tasks like flipping a switch based on sensor input, voltages below 4V can cause the Arduino to behave abnormally. The CPU may start to execute instructions incorrectly, leading to unexpected activity on the internal data and control lines. This could result in the corruption of CPU registers, I/O registers, and data memories.

Power Considerations for Arduino Uno and ATmega328p

In the Arduino documentation, you’ll find that the recommended voltage for the Arduino Uno is between 7 and 12 volts. An important consideration is how you power your Arduino based on your project’s requirements. For portable projects, like those involving robotics or other gadgets that are not in fixed positions, batteries are often used as the power source. Over time, using batteries can lead to insufficient supply voltage, which requires the use of Brown-Out Detection (BOD) protection. Even if you are using Arduino in a setup where you can provide power from power supplies (whether unregulated, regulated linear power supplies, or switch-mode power supplies), it’s not guaranteed that you can completely avoid low voltage scenarios.

Brown-Out Detection Options for Arduino UNO

As I mentioned earlier, the BOD in the Arduino UNO is set to 2.7V, which I can’t figure out why it’s set to this value instead of 4.3V. To protect the Arduino from low voltage scenarios, we have two options. First, we can change the BOD to 4.3V by setting the extended fuse value to 0xFC (100) in the boards.txt file. After that, we need to burn the bootloader to the target device. Second, we can use external brown-out protection. This can be achieved by either making our own or using integrated circuits designed for this purpose.

Using the MC34064 for External Brown-Out Detection and Protection

In this article, I’ll be using an Integrated Circuit for external brown-out detection and protection. Specifically, I’ll be using an under voltage sensing circuit called the MC34064. The MC34064 is an integrated circuit designed for monitoring voltage levels in systems to prevent them from falling below a critical threshold. It keeps a continuous check on the voltage of a power supply line. When this voltage drops below a specified level, typically determined using an external resistor, the MC34064 identifies this as an under-voltage scenario. In response, it sends a reset signal. This signal can be used to reset microprocessors or other digital circuits within the system.

MC34064 - Under Voltage Sensing IC
MC34064 - Under Voltage Sensing IC

You can find all the details, such as how it works and how to use it, in the previous article.

Circuit Connection:

To use the MC34064 voltage supervisor IC with an Arduino, you need to connect it to the Arduino’s power supply and reset pin. This setup ensures that the Arduino will reset whenever the supply voltage falls below a specified threshold. Follow these steps to integrate the MC34064 with your Arduino:

Components Needed:
  • MC34064 voltage supervisor IC
  • Arduino board (e.g., Arduino Uno)
  • Resistors (47ohms and 1.5k ohms)
Arduino UNO External Brown-Out Detection with MC34064
Arduino UNO External Brown-Out Detection with MC34064

Verification and Testing

  • Power On: Under normal conditions, the MC34064 will monitor the voltage, keeping the reset pin high, and the Arduino will function normally.

  • Simulate Undervoltage: To test the MC34064, simulate a voltage drop below its threshold by either temporarily reducing the power supply voltage or using a variable power supply.

  • Observe Reset Behavior: When the supply voltage drops below the threshold:

    • The MC34064 will pull the reset line low.
    • The Arduino will enter a reset state, halting its operation.
    • Once the voltage is restored above the threshold, the reset line will go high, and the Arduino will restart.

Low Voltage Reset With or Without Additional Hysteresis

Without Additional Hysteresis:

The MC34064 can be used for brown-out detection and protection with just one pull-up resistor. When the supply voltage is above the 4.6V threshold, it keeps the reset pin high, allowing the Arduino to operate normally. If the voltage drops to 4.59V, below the threshold, the reset pin is pulled low, putting the Arduino into a halt state. Once the voltage climbs back up to 4.61V, the Arduino resumes normal operation. This provides a built-in hysteresis of 0.02V.

Arduino UNO External Brown-Out Detection - without Additional Hysteresis
Arduino UNO External Brown-Out Detection - without Additional Hysteresis
With Additional Hysteresis:

The table provides test data for different values of RH and RL, showing the corresponding hysteresis voltage (VH) and the change in lower threshold voltage (ΔVth).

Additional Hysteresis Test Data (Datasheet)
Additional Hysteresis Test Data (Datasheet)

If you use a resistor value of 47 ohms for RH and 1.5 kilohms for RL, you can then calculate both the upper threshold voltage and the change in the lower threshold voltage using the formulas provided.

Upper Threshold Voltage ≈ (4.6 × RH) / RL + 0.02
≈ (4.6 × 47) / 1500 + 0.02
≈ 216.2 / 1500 + 0.02
≈ 0.144 + 0.02
≈ 0.164 volts
Lower Threshold Voltage Change ≈ 340 × RH × 10^-6.
≈ 340 × 47 × 10^-6.
≈ 15.98 mV = 16mV or 0.016 volts

In MC34064, the comparator changes its state (from high to low or vice versa) when the input voltage crosses a specific level. The reference voltage is 1.2V. For the comparator to reset the Arduino the input voltage needs to surpass this reference voltage plus an upper threshold (VH). In this case, VH is 164 mV.

Hysteresis adds a buffer to prevent rapid switching caused by minor voltage changes or noise. It introduces two thresholds: an upper threshold and a lower threshold.

When the input voltage is higher than the upper threshold, the comparator output keeps the reset pin high, letting the Arduino run normally. 

Upper threshold = 4.6V + 0.164V = 4.764V

But when the voltage falls below the lower threshold, the comparator output pulls the reset pin low, causing the Arduino to stop.

Lower threshold = 4.6V − 0.016V = 4.584V

External Brown-Out Detection Using Two MC34064

Here in the schematic, I’ve shown an external Brown-Out Detection (BOD) and protection circuit for an Arduino Uno R3 using two MC34064 voltage supervisor ICs.

The system monitors the voltage supplied to the Arduino using the MC34064 voltage monitor to detect brown-out conditions. A blinking LED demonstrates the Arduino’s operation under both normal and abnormal conditions.

Brown-Out Detection and Protection using two IC's
Brown-Out Detection and Protection using two IC's

BOD Reset Circuit:

This circuit monitors the 5V system voltage of the Arduino. If it detects a drop below the set threshold, it pulls the reset line low, causing the Arduino to reset. This prevents the Arduino from operating under undervoltage conditions.

BOD Alert:

Similar to the reset circuit, this one monitors the Arduino’s input voltage. However, instead of resetting the Arduino, it triggers an external alert to notify of a brown-out condition before the Arduino resets.

Arduino Code:

Leave a Reply