All articles tagged as:

attiny

Five Keys, One Pin - An Analog Keypad

While testing the analog routines in the ATtiny85 library I revisited an older project that I never got a chance to write about on the site. With my recent focus on all things related to the ATtiny I thought it would be a good topic to cover. A while ago I bought a copy of the Arduino Basic Connections book (which I highly recommend, even for those not using the Arduino). It's full of useful circuit fragments and notes including a simple keypad that uses a single analog input. You can find the related page on the official ABC Tumblr at this link. Essentially it uses a combination of switches a…

Read more »

Bootloaders and Bricked AVRs

The last project based around an ATtiny85 was pretty successful, I'm impressed with what you can squeeze out of the chips and I have a few more smaller projects that they would be perfect for as well. One of the more frustrating aspects was having to physically move the chip from the circuit to the programmer every time I wanted to update the firmware - by the fourth iteration I was wishing very hard for some sort of serial bootloader. The ATtiny doesn't have a UART on board but the functionality can be implemented in software (and, with the help of a little bit of hardware, can be done on a s…

Read more »

An ATtiny85 Based Safety Light

This project is a simple presence sensing night light for doors, stairs and other areas which could be dangerous or difficult to navigate in low lighting conditions. It is built around an ATtiny85 microcontroller and uses the head from a cheap LED torch as the lighting element. The ambient lighting is detected with a simple LDR and presence with a PIR motion sensor. Using a microcontroller is probably overkill for this project and the firmware may seem a bit large for what it does (around 1.5K). I wanted to use the project to experiment with some other features as well as making a useful utili…

Read more »

Conserving Memory on an AVR

Both the ATtiny and ATmega CPU's have a very limited amount of RAM (512 bytes for the ATtiny45/85 and 1K for the ATmega8/168) and it's easy to hit the limit without some careful programming. I've been working on a project based around an ATtiny85 that barely fits into the 512 bytes available. While analysing the code I came across a few common (and not so common) tricks to help reduce the amount of RAM being used by your program so I thought I'd take the opportunity to share them here. To determine how much memory you are using you can use the avr-size command (part of the avr-gcc suite) as fo…

Read more »