An OLED Photo Frame Powered By The ATtiny85

Rolling your own digital picture frame that loads images from an SD card and displays them on an LCD with a modern microcontroller like the ESP32 is an afternoon project, even less if you pull in somebody else’s code. But what if you don’t have the latest and greatest hardware to work with?

Whether you look at it as a practical application or an interesting experiment in wringing more performance out of low-end hardware, [Assad Ebrahim]’s demonstration of displaying digital photographs on an OLED using the ATtiny85 is well worth a look. The whole thing can put put together on a scrap of perfboard with a handful of common components, and can cycle through the five images stored on the chip’s flash memory for up to 20 hours on a CR2032 coin cell.

As you might expect, the biggest challenge in this project is getting all the code and data to fit onto the ATtiny85. To that end [Assad] wrote his own minimal driver for the SSD1306 OLED display, as the traditional Adafruit code took up too much space. The driver is a pretty bare bones implementation, but it’s enough to initialize the screen and get it ready for incoming data. His code also handles emulating I2C over Atmel’s Universal Serial Interface (USI) at an acceptable clip, so long as you bump the chip up to 8 MHz.

For the images, [Assad] details the workflow he uses to take the high-resolution color files and turn them into an array of bytes for the display. Part of that it just scaling down and converting to 1-bit color, but there’s also a bit of custom Forth code in the mix that converts the resulting data into the format his code expects.

This isn’t the first time we’ve seen somebody use one of these common OLED displays in conjunction with the ATtiny85, and it’s interesting to see how their techniques compare. It’s not a combination we’d necessarily chose willingly, but sometimes you’ve got to work with whats available.

A Perfect Clock For Any Hacker’s Ohm

The vast majority of us are satisfied with a standard, base ten display for representing time. Fewer of us like to be a bit old-fashioned and use a dial with a couple of hands that indicate the time, modulo twelve. And an even smaller minority, with a true love for the esoteric, are a fan of binary readouts. Well, there’s a new time-telling game in town, and as far as we’re concerned it’s one of the best ones yet: resistor color codes.

The Ohm Clock is, as you may have guessed, a giant model of a resistor that uses its color bands to represent time.  Each of the four bands represents a digit in the standard HH:MM representation of time, and for anybody well-versed in resistor codes this is sure to be a breeze to read. The clock itself was designed by [John Bradnam]. It’s body is 3D printed, with RGB LEDs to brightly illuminate each segment. The whole thing is controlled by an old favorite – an ATtiny, supported by a Real Time Clock (RTC) chip for accurate timekeeping.

You can set the time in the traditional fashion using buttons, or — and here’s the brilliant part — you can use a resistor. Yup, that’s right. Connecting a 220 Ohm resistor across two terminals on the clock will set the time to 2:20. Genius.

When you come across an art as old as timekeeping, it’s easy to assume that everything’s already been done. We have sundials, hourglasses, analog clocks, digital watches, those cool clocks that use words instead of numbers, the list goes on. That’s why it’s so exciting to see a new (and fun!) idea like this one emerge.

An OSHW IR Remote Control Powered By The ATtiny13A

The new hotness in consumer electronics might be RF remotes based on protocols like Bluetooth Low Energy, but there’s still plenty of life left in the classic infrared remote. Especially with projects like TinyRemoteXL from [Stefan Wagner], which let you build and program an IR “clicker” of your own. Whether you want to spin up your own custom universal remote or create a beefed up version of the TV-B-Gone, this open source effort is a great place to start.

The original TinyRemote.

As you might have guessed from the name, this project is actually a larger version of the TinyRemote that [Stefan] put together previously. The documentation for that project goes a bit more into the nuts and bolts of talking IR, and is definitely worth a read if you’re into the low level stuff. For the original five button TinyRemote, the hardware consists of little more than a ATtiny13A microcontroller, a pair of IR LEDs, and the transistors to drive them.

But on the XL, things are a bit trickier as there are now twelve buttons for the ATtiny13A to read. Obviously there aren’t enough pins to read so many buttons directly, but with a combination of BAS16TW diode arrays and resistors, [Stefan] is able to detect what button was pressed using the chip’s interrupt pin and ADC. Certainly a handy trick to have in the back of your mind, and the open source nature of this project gives you a great chance to see how it’s implemented.

Between this project and the impressive development board [Djordje Mandic] released recently, it seems we’re looking at something of an infrared hacking revival. Earlier this year we even saw the commercial release of an IR-equipped ESP8266 board.

Spectrum Display Uses Tiny CPU And Many LEDs

You would think the hard part about creating a spectrum analyzer using a pint-sized ATTiny85 would be the software. But for [tuenhidiy], we suspect the hard part was fabricating an array of 320 LEDs that the little processor can drive. The design does work though, as you can see in the video below.

The key is to use a TPIC6B595N which is an 8-bit shift register made to drive non-logic outputs. With all outputs on, the driving FETs can supply 150 mA per channel and the device can handle 500 mA per channel peak. At room temperature, the part can go over 1W of total power dissipation, although that goes down with temperature, of course. If you need higher power, there’s a DW-variant of the part that can handle a few hundred milliwatts more.

Continue reading “Spectrum Display Uses Tiny CPU And Many LEDs”

Custom Firmware Teaches USB Relay Board New Tricks

If you’re looking for a quick and easy way to control a few devices from your computer, a cheap USB relay board might be the ideal solution. These are fairly simple gadgets, consisting of little more than a microcontroller and a handful of relays. But that doesn’t mean there isn’t room for improvement, and as [Michał Słomkowski] recently demonstrated, flashing these boards with a custom firmware allows the user to modify their default functionality.

In his case, [Michał] wanted to build a power strip that would cut the power to any devices plugged into it once his computer went to sleep. Unfortunately, he couldn’t just check to see if there was 5 V on the line as his motherboard kept the USB ports powered up all the time. But with some modifications to the relay board’s firmware, he reasoned he should be able to detect if there was any USB activity by watching for the start-of-frame packet that goes out every millisecond when the bus is active.

Wiring up the ATtiny45 for flashing.

Now [Michał] isn’t claiming to be the first person to come up with a custom firmware for one of these boards, in fact, he credits an existing open source firmware project as an inspiration for his work. But he did create an entirely new GPLv3 firmware for these ATtiny45 powered devices, which includes among other improvements the latest version of V-USB. As it so happens, V-USB includes start-of-frame packet detection out of the box, which made it much easier to implement his activity detection code.

With the new firmware flashed to the relay board’s chip, [Michał] put it in an enclosure and wired up the outlets. But there was still one missing piece of the puzzle. It seems that Linux won’t actually send out the start-of-frame packets unless its actively communicating with a USB device, as part of the so-called “selective suspend” power saving feature. Luckily there is support for disabling this feature for specific devices based on their Vendor/Product ID pair, so after a little udev fiddling, everything was working as expected.

We love custom firmware projects here at Hackaday. Not only do they keep proprietary software out of our devices, but they often unlock new and expanded capabilities which otherwise would be hidden behind artificial paywalls.

Adding MQTT To A Solar Powered PIR Light

The size and price of the ESP wifi modules have quickly made them into one of the preferred building blocks for IoT devices. Unfortunately they are not particularly well suited for very low power applications.  [LittlePetieWheat] wanted to add MQTT to a cheap PIR solar light, so he paired an ESP with an Attiny85 to hold it to a strict power budget.

Most of these lights contain some sort of no-name microcontroller that monitors the analog PIR sensor, and turns on the LEDs as required. [LittlePetieWheat] replaced the PIR sensor with one that gives a digital output for simpler interfacing. The Attiny serves as the low power brains of the project. Its tasks include reading the solar panel and battery voltages, and PIR output. When movement is detected by the sensor, it activates a clever little latching power circuit to power on the ESP01 just long enough to send a MQTT message. The LEDs are only turned on if there is no power coming from the solar panel. The solar power is stored in a 18650 battery.

The Attiny85 might not be a powerhouse, but it is perfect for simple, low power applications like this. We’ve also seen it pushed to its limits by running tiny machine learning models, or receiving software updates over I2C. Continue reading “Adding MQTT To A Solar Powered PIR Light”

Teaching A USBasp Programmer To Speak TPI

Last Fall [Kevin] wanted to program some newer TPI-only AVRs using an old USBasp he had kicking around his lab. Finding an “odd famine of information” and “forums filled with incorrect information and schematics”, he decided to set the record straight and document things correctly. He sleuthed out the details and succeeded in reprogramming the USBasp, although he did end up buying a second one in the process.

Designers who use AVR microcontrollers have no shortage of programming interfaces — we count at least five different methods: ISP/SPI, JTAG, TPI, PDI, and UPDI. We’re not sure whether this is variety is good or bad, but it is what it is. [Kevin] discovers that for the particular family of Attiny devices he is using, the ATtiny20, TPI is the only option available.

While he normally builds his designs around ARM Cortex-M chips, [Kevin] needed some glue logic and decided to go with an ATtiny20 despite its unique programming requirements. He observes that the price of the ATtiny20, $0.53 last Fall, was cheaper than the equivalent logic gates he needed. This particular chip is also quite small — only 3 mm square (a 20-pin VQFN). We would prefer not to use different MCUs and tool chains on a single board, but sometimes the convenience and economics steer the design in that direction.

If you’re not familiar with the USBasp, our own [Mike Szczys] covered the breaking story over ten years ago. And if you have a lot of free time on your hands, ditch all these nicely packaged solutions and program your chips using an old USB Hub and a 74HCT00 NAND gate as described in this bizarre hack by Teensy developer [Paul Stoffregen].