Reducing Sleep Current in ATTiny Digispark

by btidey in Circuits > Microcontrollers

2331 Views, 5 Favorites, 0 Comments

Reducing Sleep Current in ATTiny Digispark

rawUSBATTiny.jpg

The ATTiny85 is a nice cheap micro-controller useful for standalone applications with a small amount of I/O and not needing connectivity like wifi.

A convenient way of using these is with the Digispark type modules as they incorporate a very convenient way of uploading sketches from an Arduino IDE using the USB bootloader.

When using these modules in battery powered applications one often wants to reduce power consumption by using the sleep capabilities of the ATTiny85. The processor itself has low sleep current which can be further reduced by turning off functional pieces of the micro-controller.

On these boards, however, there is a extra current drain which impacts on the utility of sleep.

This instructable shows how to modify the boards so that current draw during sleep is primarily that of the micro-controller itself.

Before the modifications the current drawn with the micro controller in sleep was 7.3mA. After the modifications it was 24 microAmp; a reduction of 300 times. This allows many months of operation on modest batteries.

Current Drains

There are 3 pieces on the board which contribute to the extra current draw in sleep.

  1. The power on LED draws about 3mA
  2. The on-board regulator draws about 3mA even if not supplied with input power. This is due to the internal feedback resistors in its output circuitry.
  3. The bias current supplied to one of the USB data lines. This is necessary to get the USB to be recognised as a valid device. This draws about 1mA (5V- 3,6V through 1.5K resistor)

The first 2 are easy to deal with. The third needs a bit of thought as it is desirable to retain the USB upload facility even after the modifications are done.

  1. The power on LED can just be removed to eliminate its draw. The utility it proviced is pretty minimal in most applications.
  2. The on-board regulator can be removed to eliminates its draw. This is only needed when powering externally from higher voltage supplies. Battery applications can feed power directly into the 5V input.
  3. The 5V feed to the 1.2K USB bias resistor is from the internal 5V line. This is either the 5V from the external 5V Vin point or from the 5V USB power passed through a schottky diode. By deriving it from the 5V USB line instead then it only draws current when plugged into a USB for uploading. When power is supplied from the 5V in connector then the schottky diode then prevents the bias current from being drawn.

Tools and Modifications

stdUSBATTiny.jpg
stdUSBATTinyMod.jpg
microUSBATTiny.jpg
microUSBATTinyMod.jpg

Tools needed

  • Fine point soldering iron
  • Hot air rework tool (desirable)
  • Some fine guage solderable enamel wire.

Modifications

The pictures show the before and after of the two types of board commonly used. The first is the original design featuring a USB A male plug integrated into the board. The second type shows a board which is functionally and electrically identical except it has a micro USB socket instead of the type A plug. It also uses a smaller voltage regulator.

The before pictures highlight in red 3 areas of modification.; power LED, bias resistor, USB 5V feed.

To perform the modifications use the hot air tool to remove components. This can be done with a soldering iron but is considerably more difficult. I use a narrow jet on the hot air tool and try to shield other components to ensure I only melt and remove the appropriate component.

  1. Remove the on board regulator chip.
  2. Remove the on board power LED.
  3. Remove the 1.2k bias resistor. Try to retain this component for re-use. If it gets damaged then just use another substitute. The value is not supercritical. I have used a 2.2K successfully.

Now put the bias resistor back on but rotated so it is only connected to the USB bias chain and not the internal 5V supply. Tin one end of the enameled wire and solder to the free end of the bias resistor. Tin and connect the other end of the wire to the USB 5V supply. For the USB A plug board this can be conveniently picked up by scraping back a bit of the coating on the track as highlighted. It could also be picked up on the schottky diode in the corner of the board but that is a little messier. For the micro USB board the USB can be picked up on the schottky diode very near the micro USB connector. A fine point iron is needed here and care taken.