Tag Archives: ATtiny85 microcontroller

Video: Creating an ATtiny robot family

A Maker by the name of “shlonkin” has created a number of mini autonomous vehicles capable of perceiving the world with sensors and adjusting their behavior accordingly.

According to HackADay’s Brian Benchoff, all the ‘bots are powered by Atmel’s versatile ATtiny85 microcontroller (MCU).

In addition, the uber-mini ‘bots are equipped with a small battery, two motors, at least one phototransistor and an LED.

“One robot has left and right eyes pointing down, and can act as a line follower. Another has a group of LEDs around its body, allowing it to signal other bots in all directions,” Benchoff explained.

“The goal of the project is to create a whole series of these tiny robots capable of interacting with the environment and each other.”

Interested in learning more? You can check out the project’s official page on HackADay here.

This ultrasonic ruler is pocket-sized



A Maker known as “bergerab” has created an Atmel-based ultrasonic ruler powered by the popular ATtiny85 microcontroller (MCU).

According to the inventor, the recently posted Instructables prototype is accurate to +/- one centimeter.

“Using this pocket-sized ultrasonic ruler, you can simply point at any object, click a button, and the distance will be displayed on the 8 LED display,” bergerab explained in a meticulously detailed Instructables post.

“This ruler is the smallest (5cm by 7cm) and cheapest (about 5 USD) ultrasonic measuring device available today.”

Aside from Atmel’s versatile ATtiny85 microcontroller, key project components include:

  • 74hc595 shift register
  • 7805 voltage regulator
  • HC-SR04 ultrasonic range sensor
  • 330 Ohm resistors (8)
  • One tactile-switch button
  • One two-way slide switch
  • LEDs (8)
  • One indicator LED (with 2k resistor)
  • Perfboard (5cm by 7cm)
  • 9v battery (with connector)

On the software side, bergerab describes the sketch for the circuit as quite small and simple.

“Basically, all the code does is every 500 milliseconds, the distance between the HC-SR04 and an object infront of it is shifted out to the shift register via the data and clock pins attached to the ATtiny85,” he added.

“When the user presses the button on the device, they are actually activating the ‘latch’ on the 74hc595. This illuminates the need for attaching the latch pin to the attiny and attaching a button to the ATtiny85.”

Interested in learning more? You can check out the project’s official Instructables page here.

Building an ATtiny85 POV display



Persistence of vision (POV) is a phenomenon of the eye by which an afterimage is thought to persist for approximately one twenty-fifth of a second on the retina.

Image Credit: Wikipedia

Recently, a Maker by the name of Vishalapr created an inexpensive POV display using an Atmel ATtiny85 microcontroller (MCU) paired with a DC motor.

Aside from the Atmel-based ATtiny85 and DC motor, additional key components include:

  • 5 LEDs
  • 3V coin cell
  • Coin cell holder
  • USB header (a normal USB cord would do)
  • A case/enclosure to keep the motor in
  • A piece of wood or cardboard for the LED bar
  • IC holder
  • Protoboard
  • Jumper cables

Vishalapr kicks off the project by making a simple LED board out of cardboard/wood. He then connects the ATtiny85 MCU and the motor/power supply, placing the various components in an enclosure.

Next up? Installing support for the ATtiny series and programming the ATtiny85.

“So now that you have built a 5 LED POV Display, why not try something bigger? How about a 10 LED POV Display with an Arduino instead of an ATTiny85 (supports only 5 outputs),” Vishalapr added.

“We can also make this wall mountable by adding a small hole through which you can hang it on a nail firmly. Using some tricolor LEDs and more pins, we can give out a multicolored display.”

Interested in learning more? You can check out the project’s official page here.

ATtiny85 goes uber-mini with The Nanite



The Nanite is an uber-mini dev board built around Atmel’s ATtiny85 microcontroller (MCU). The board – which measures 0.4″ wide – boasts the same pin configuration as a DIP ATtiny85.

“[I wanted] to have my own ATtiny85 based development board based on a USB bootloader and optimized for the ubiquitous 170 point mini-breadboards. [The Nanite] sports a reset button, but lacks an integrated voltage converter as it is supposed to be powered by USB,” Nanite creator Tim explained in a recent blog post.

“Apart from the size considerations, the Nanite also uses a neat circuit trick to share a single pin with the LED and the reset button. The circuit of the board is shown below, the circuit attached to the reset pin, PB5, is to the right.”

Meaning, if PB5 is configured as the standard reset, the push button will simply act as a reset button, with the LED taking on the role of a pull up for the reset button. However, if reset is disabled and PB5 is configured as a normal I/O pin, the state of the button can be polled by simply reading from the port.

“The LED can be turned on by setting the output to ‘low’ and turned off by configuring the output into a high impedance state. It is not advised to set the output ‘high’, since in that case the pushbutton could short the output to ground,” said Tim.

“I use micronucleus in a configuration where it only starts when the button is pushed. This means that the user program is started without a delay after the device is powered up.”

Meanwhile, the functionality of the reset button is emulated via software, periodically polling the state of the button and activating the watch dog timer if it is pressed. If the watch dog times out, the device resets.

“Apart from the LED output, user interaction and soft-reset button, PB5 can also be used as a simple serial debug output – connected to the RX input of a serial to USB adapter. I use a simple software-UART implementation and a macro to redirect STDOUT to the serial output. This allows very convenient debugging with printf(),” he added.

Interested in learning more? You can check out Nanite’s official page here, while the Eagle design files and example code are available on Github here.

Video: Hacking a Valentine with the ATtiny85

The OpenElectronics crew has presented a project dubbed “HeartThrob” in honor of Valentine’s Day weekend.

“You [may] be inclined to think that this is the usual heart-shaped Valentine gadget,” OE’s Boris Landoni explained in a blog post detailing the project.

“In reality this is something much cooler as it’s capable to create beautiful and complex light games… Just shake HeartThrob and it will turn on and crate incredible light animations.”

HeartThrob is powered by Atmel’s versatile ATtiny85 microcontroller (MCU), as the OpenElectronics team required a compact controller that was easy to program and offered a precise balance between energy consumption and performance.

In terms of software, the HeartThrob can be modified according to the specific needs of a user, including duration, vibration detection and number of functions for those who want to add or remove lighting effects.

Interested in learning more? You can check out HeartThrob’s official project page here.

As we’ve previously discussed on Bits & PiecesAtmel’s ATtiny85 MCU is routinely tapped by both DIY Makers and professional engineers to power a wide range of projects. To be sure, quite a number of devices and platforms built around the ATtiny85 have surfaced in recent months, including the LED SMD firefly, astrophotography tracker, vibrating timepiece, ATtiny85 ISP!, and Cuboino (Digital Cuboro)

Building an Atmel-powered Trinket audio player

Adafruit’s Trinket platform – powered by Atmel’s versatile ATtiny85 microcontroller (MCU) – supports high-speed PWM mode. So with just a few extra components the Trinket can be used for projects requiring audio output.

“You could make an electronic greeting card with your own customized message or song, add a background soundtrack to a model train diorama, or create the world’s smartest whoopee cushion,” explained Adafruit’s Phillip Burgess. “[Nevertheless], it is a very simple circuit that just plays a short ‘raw’ audio loop.”

According to Burgess, there are two primary phases to the project. The first employs an Arduino to load sound data onto a flash memory chip, while the second, using Adafruit’s Trinket, plays it back.

“Loading” stage components include:

  • Atmel-powered Arduino Uno or similar board
  • Capacitor: one 0.1 μF
  • Resistors: 3 each 470 Ohm and 1K OhmAn LED (any color) and 220 Ohm resistor for a status indicator (optional)

“Playback” stage components include:

  • Adafruit Trinket 3.3V (NOT 5V!)
  • Capacitors: one 10 μF, 2 each 0.1 μF
  • Resistor: one 68 Ohm
  • 10K potentiometer
  • Headphone jack and headphones or portable amplified speaker OR
  • Audio amplifier board and 4 Ohm speaker (or 8 ohm)

On the software side, the project uses both Processing and the Arduino IDE, while sound files can be in WAV format, uncompressed (PCM), 8- or 16-bit resolution. In terms of playback, the ATtiny85 chip at the heart of Trinket is capable of producing a 250 KHz 8-bit PWM signal.

“A low pass filter circuit then smooths the ‘square’ PWM into a usable audio waveform. A very basic low pass filter can be made from just a capacitor and resistor. [However], first we need to know the filter’s cutoff frequency — frequencies below this pass through, while higher frequencies (like the PWM signal) are attenuated,” said Burgess.

“A rule of thumb with PWM audio is that the highest usable audio frequency (our cutoff frequency) is about 1/10 the PWM rate. The latter we’ve already established is 250 KHz, so a good cutoff would be 25 KHz.”

Interested in learning more about putting together an Atmel-powered Adafruit Trinket audio player? A full tutorial, written by Phillip Burgess is available here.