Photo of a smartphone with the ATTiny85 inserted into it, with a screen unlock pattern being drawn on the screen

ATtiny85 Automates Your Smartphone

It might not seem too impressive these days, but when microcontrollers with hardware USB support were more expensive and rare, the VUSB library was often used to create USB devices with an ATtiny85. It became so popular that the ATtiny85 even got packaged into USB dongle formfactors, like the DigiSpark boards. Well, you might not know this, but your Android smartphones can also work with USB mice and touchscreens in lieu of the built-in touchscreen display. [ErfanSn] combined these two ideas, creating a library to automate smartphone touchscreen events and keyboard input with an ATtiny85 — open for all of us to use, and with examples to spare.

The library is called DigiCombo, and it comes with plenty of examples for any screen touch event emulation that you might want. For instance, check out the README — it has video examples for Instagram page scrolling, unlock screen brute-forcing with random coordinates, playing the Stack rhythm game, and pinch zoom — all the building blocks for your smartphone touch emulation needs are covered pretty well! Of course, all of these have example code corresponding to them, that you can download and base your own ideas on. What’s more, the library is available in current Arduino IDE under the DigiCombo name. So if you need to, say, make a quick autoclicker for your phone, the library is a few steps away!

If your smartphone project was stalled because you needed to emulate touchscreen input, this library is your chance to get it done! We appreciate projects that let us get more from smartphones — there’s a lot of those laying around, they’re pretty functional and self-sufficient devices, so it makes sense that some projects of ours could do with a phone instead of a Raspberry Pi. Some manufacturers let us get a bit more of our phones, but this hasn’t really caught on, which means we have to make do with help of libraries like these. Or, perhaps, you rely on your phone day-to-day, and you’d like to add a touchpad to its back?

Blinky Business Card Plays Snake And Connect Four

There’s no better way to introduce yourself than handing over a blinky PCB business card and challenging the recipient to a game of Connect Four. And if [Dennis Kaandorp] turns up early for a meeting, he can keep himself busy playing the ever popular game of Snake on his PCB business card.

The tabs are 19 mm long and 4 mm wide.
The tabs are 19 mm long and 4 mm wide.

Quite wisely, [Dennis] kept his design simple, and avoided the temptation of feature creep. His requirements were to create a minimalist, credit card sized design, with his contact details printed on the silk legend, and some blinky LED’s.

The tallest component on such a design is usually the battery holder, and he could not find one that was low-profile and cheap. Drawing inspiration from The Art of Blinky Business Cards, he used the 0.8 mm thin PCB itself as the battery holder by means of flexible arms.

Connect-Four is a two player game similar to tic-tac-toe, but played on a grid seven columns across and six rows high. This meant using 42 dual-colour LED’s, which would require a large number of GPIO pins on the micro-controller. Using a clever combination of matrix and charlieplexing techniques, he was able to reduce the GPIO count down to 13 pins, while still managing to keep the track layout simple.

It also took him some extra effort to locate dual colour, red / green LED’s with a sufficiently low forward voltage drop that could work off the reduced output resulting from the use of charlieplexing. At the heart of the business card is an ATtiny1616 micro-controller that offers enough GPIO pins for the LED matrix as well as the four push button switches.

His first batch of prototypes have given him a good insight on the pricing and revealed several deficiencies that he can improve upon the next time around. [Dennis] has shared KiCad schematic and PCB layout files for anyone looking to get inspired to design their own PCB business cards.

Continue reading “Blinky Business Card Plays Snake And Connect Four”

Swap The Clock Chip On The Mac SE/30 With An ATTiny85

As [Phil Greenland] explains in the first part of his excellent write-up, the lithium battery used to keep the real-time clock (RTC) going on the Macintosh SE/30 has a nasty habit of exploding and leaking its corrosive innards all over the board. Looking to both repair the damage on a system that’s already had a battery popped and avoid the issue altogether on pristine boards, he started researching how he could replace the battery with something a bit more modern.

Damage from a ruptured RTC battery.

It turns out, the ATtiny85 is pin-compatible with the Mac’s original RTC chip, and indeed, [Andrew Makousky] had already written some code that would allow the microcontroller to emulate it. This is actually a bit more complex than you might realize, as the original RTC chip was doing double-duty: it also held 256 bytes of parameter random access memory (PRAM), which is where the machine stored assorted bits of info like which drive to boot from and the mouse cursor speed.

But after getting the mod installed, the computer refused to start. It turns out the project targeted earlier machines like the Macintosh Plus and SE, and not his higher-performance SE/30. Thanks to community resources like this KiCad recreation of the SE/30’s motherboard, contemporary technical documents, and his trusty logic analyzer, [Phil] was able to figure out that the timing was off — the code was simply struggling to respond to the faster machine. Continue reading “Swap The Clock Chip On The Mac SE/30 With An ATTiny85”

Dead Washer Lives Again With ATTiny

We aren’t saying that appliances are a scam, but we have noticed that when your appliances fail, there’s a good chance it will be some part you can no longer get from the appliance maker. Or in some cases, it’s a garden-variety part that should cost $2, but has been marked up to $40. When [Balakrishnan] had a failure of the timer control board for a Whirlpool washing machine, it was time to reverse engineer the board and replace it with a small microcontroller.

Of course, this kind of hack is one of those that won’t help you unless you need exactly that timer board. However, the process is generally applicable. Luckily, the motherboard chip was documented and the timer control board used a simple ATmega88, so it was easy to see that the devices were communicating via I2C.

Reading the I2C  bus is easy with a logic analyzer, and this revealed the faulty device’s I2C address. The board that failed was only for display, so a simple program that does nothing other than accept I2C data put the washer in working order. Once it was working with an Arduino, an ATTiny45 did the work with a lot less space and cost.

If you don’t want to reverse engineer the washing machine, you could just replace all the controls. That even works if the old washer wasn’t electronic to start.

Using I²C Sensors With Any Linux Via USB And IIO

Hooking up I2C sensors is something which is generally associated with microcontrollers and SBCs, yet it’s very easy to use such I2C sensors from basically any system that runs Linux. After all, I2C (that is, SMBus) is one of the interfaces that is highly likely to be used on your PC’s mainboard as well as peripherals. This means that running our own devices like the well-known BME280 temperature, pressure and humidity sensor, or Si1145 light sensor should be a piece of cake.

In a blog post from a few years ago, [Peter Molnar] explains in detail how to wire up a physical adapter to add a USB-connected I2C interface to a system. At its core is the ATtiny85 AVR-based MCU, which provides a built-in USB interface, running the I2C-Tiny-USB firmware.

The essential part here is that the MCU shows up to the Linux kernel as an i2c device, requiring the i2c-dev driver to be loaded. After this the I2C device that is connected to the adapter MCU’s I2C bus can be used via the Linux module’s API calls, either directly or via existing drivers. [Peter] found that the BMP280 driver came with Debian Sid, for example.

Showing a new generation ATTiny on an SMD breakout plugged into a breadboard, being programmed

Come Learn About New ATtiny Generations

As the chip shortage hit, a lot of the familiar ATtiny chips have become unavailable and overpriced, and it mostly stayed the same since then. If you ever searched for “ATtiny” on your favourite electronics component retailer website, however, you’d notice that there’s quite a few ATtiny chips in stock most of the time – just that they’re from a much newer generation than we commonly see, with incompatible pinouts, slightly different architecture and longer model numbers like 412 and 3227. [David Johnson-Davies] from [technoblogy] is here to clarify things, and provide a summary of what the new ATtiny generations have to offer.

In 2019, he posted about 0- and 1-series ATtiny chips, comparing them to the ATtiny series we knew, decyphering the part numbering scheme for us, and providing a comparison table. Now, he’s returned to tell us about the 2- series ATtiny chips, merging the comparison tables together so that you can quickly evaluate available parts by their ROM/RAM size and the SMD package used. He also describes which peripherals are available on which series, as well as nuances in peripheral operation between the three generations. In the end, he reminds us of a simple way to program all these new parts – as it stands, you only need a USB-UART adapter and a 4.7K resistor.

Over the last decades, we’ve seen plenty of inspiring ATtiny projects – squeezing out everything we could out of 5 GPIOs, or slightly more for larger-package ATtiny chips. [David] has been setting an example for us, bringing projects like this function generator, this continuity tester, or an IR receiver with an OLED screen for diagnostics – all with an ATtiny85. It’s not the just pin count that’s a constraint, but the RAM and flash amounts as well – nevertheless, people have fit machine learning and an entire graphics stack into these chips before. If you’re stuck at home unable to do anything, like many of us were during lockdowns, you can always breadboard an ATtiny and see just how much you can get done with it.

$1 POV Display Goes Round And Round

You don’t need much to do a persistence of vision display. A few LEDs and a processor is all it really takes. [B45i] made a simple PC board with five LEDs and an ATtiny CPU. There’s a battery and it connects to a fan to spin around.

While the project is pretty simple, we liked two aspects of it. First, he provides very detailed explanations about how to use an Arduino to program the Tiny using the Arduino IDE.

Continue reading “$1 POV Display Goes Round And Round”