Beginner: Simulating Brownout for ATtiny Measurement with New Oscilloscope

Hey,

I recently acquired a new oscilloscope and I'm eager to conduct some tests. I'm particularly interested in simulating a brownout condition to observe its impact on an ATtiny microcontroller. My goal is to use the oscilloscope to visualize the brownout, perhaps around 1.8V. Can anyone provide suggestions on methods or setups to effectively simulate a rapid voltage drop akin to a brownout in a controlled manner? Because simply reducing the voltage on my lab power supply is not what I'm searching :slight_smile:

Thanks in advance for your assistance!

You know that the way to get a Attiny to trigger it's brownout detection is to "reduce the voltage to below the brownout level".

Your question sounds to me that you are asking for a recipe for "baking applepie", but you don't want to use apples.

Digital Scope ?

  • A digital scope stores pre-trigger data.
  • When the Brown-Out is reached, trigger the scope.
    Scroll back in time on your scope.
1 Like

Do you mean the ripple on/off of the MCU when it's close to the minimum voltage? You can produce it with a small battery (or a small supercapacitor) and the MCU activating a relative high load when it boots. Take into account that maybe the MCU won't enjoy it a lot.

But the brownout prevention functionality of some MCU is there just to prevent it, at a some degree, and sometimes can be deactivated.

1 Like

I think I understand.

You could take a second microcontroller, output a PWM signal and run it through an R/C filter. Then use that filtered "DAC" signal as the input for an opamp buffer, and feed the ATtiny from this opamp buffer. Most opamps will easily supply 10mA or so, which should be enough to run a bare ATtiny (don't drive anything current-hungry with the ATtiny).

This way, you can programmatically simulate a variety of voltage fluctuations, at least within the boundaries that the PWM resolution and R/C filter frequency will allow.

Edit: something like this:


Set R7/C1 to obtain the desired filtering. You can add another R/C pole if you want to smooth things out further. R8 is a bleeding resistor to discharge C1 which will improve the transient response when 'dialing down' the voltage using PWM.
U1 is any general purpose opamp, preferably with a fairly beefy output, and rail-to-rail capability.

Edit2: if you need more output current than the opamp can supply, you can use the opamp as the input to a series pass regulator using a power transistor of your choice.

1 Like

Thank you very much for your input! That is exactly what I was searching for. I'll try this circuit on the weekend and will report my results. Thanks!

ps.: I appreciate your detailed information and explanation! Thanks!

You're welcome, I hope it meets your requirements.

A few notes on the R/C filter: this is a compromise between filtering out all ripple and responsivity. You could calculate things, but I prefer to just simulate it to see how it 'feels' and then decide how to proceed. If you need to test very fast transients, this approach won't be very effective and I'd look in other directions. However, the benefit of this 'programmatic' approach is that you can fire pretty complex fluctuation patterns on your test setup and see how it responds.

  • Suggest you buy these to have on hand for future applications.
    TL331 SOT23-5
    and
    LMV321 SOT23-5

https://gr.mouser.com/datasheet/2/389/lmv321-1849557.pdf

FYI

example:

2 Likes

What's wrong with manually reducing your lab PSU?
You also can attach a big capacitor to Vcc and then detach power.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.