Detecting Water Before It’s Too Late

[mcu_nerd] is like any engineer, which is why his problem of an occasionally leaky water heater sure looks like a research project with no end in sight. Sure there’s probably a commercial product out there that can be had for half the cost and a few clicks of the mouse, but what’s the point in actually solving the problem?

His log starts with research into detecting low battery voltages. Then it was a quick exploration in designing low-power circuits. When the Flexible PCB contest came along, he realized that there was a chance to design a better electrode, and he ended up winning one of the vouchers; which is where he’s at now.

It’s definitely a work in progress, and if anything it’s just a quick five minute read and an opportunity to commiserate with another wayward soul. We do like his clever use of a tealite candle tin as both the second electrode and case for his water detection circuit. There are also some KiCad files and code.

Fixing A Cheap UPS HAT For Your Raspberry Pi With A Tiny Daemon

An uninterruptible power supply (UPS) isn’t something solely to have hooked up to your desktop PC. Your Raspberry Pi SBC might also benefit from it. Yet the available options aren’t too great, or are too expensive. This leads folk including [Joachim Baumann] to modify cheerfully cheap Chinese UPS HAT boards such as the Geekworm UPS HAT to fix its myriad of issues and missing features.

Inspired by a number of other hacks on this board which fixed things like needing to push a button on the UPS to boot the Raspberry Pi, [Joachim] set out to make a similar ATtiny-based solution that would address all issues, above all the fact that this Geekworm UPS does not detect when the connected SBC has turned off and will happily run the lithium battery pack dry. Finding a blog post by Simon who had reverse-engineered the board previously was immensely helpful. Continue reading “Fixing A Cheap UPS HAT For Your Raspberry Pi With A Tiny Daemon”

Tiny Two-Digit Thermometer Has Long Battery Life

Like most of his work, this tiny two-digit thermometer shows that [David Johnson-Davies] has a knack for projects that make efficient use of hardware. No pin is left unused between the DS18B20 temperature sensor, the surface mount seven-segment LED displays, and the ATtiny84 driving it all. With the temperature flashing every 24 seconds and the unit spending the rest of the time in a deep sleep, a good CR2032 coin cell should power the device for nearly a year. The board itself measures only about an inch square.

You may think that a display that flashes only once every 24 seconds might be difficult to actually read in practice, and you’d be right. [David] found that it was indeed impractical to watch the display, waiting an unknown amount of time to read some briefly-flashed surprise numbers. To solve this problem, the decimal points flash shortly before the temperature appears. This countdown alerts the viewer to an incoming display, at the cost of a virtually negligible increase to the current consumption.

[David]’s project write-up explains how everything functions. He also steps through the different parts of the source code to explain how everything works, including the low power mode. The GitHub repository holds all the source files, and the board can also be ordered direct from OSH Park via their handy shared projects feature.

Low power consumption adds complexity to projects, but the payoffs can easily be worth the time spent implementing them. We covered a detailed look into low power WiFi microcontrollers that is still relevant, and projects like this weather station demonstrate practical low power design work.

DIY Button Matrix Lights Up And Speaks I2C

[David Johnson-Davies] always wanted an illuminated button matrix for projects, but cost was never very friendly. That all changed when he discovered a cheap source of illuminated pushbuttons on Aliexpress, leading to this DIY 4×4 illuminated button matrix design which communicates over I2C. The button states can be read independently of setting the light pattern, and an optional interrupt signal gets pulled low whenever there is a change detected. Not bad for one PCB plus about $10-worth in components!

The device uses every single pin on an ATtiny88, and because each button gets its own pin the keypresses can be detected with pin-change interrupts. The state reporting of buttons over I2C is unambiguous, even when multiple buttons are pressed simultaneously. A simple protocol provides all the needed functionality, and all connections are brought to the board’s edge to allow for easily tiling multiple panels.

The GitHub repository contains the code and PCB files and [David] helpfully shared the board files to OSH Park and PCBWay for easy ordering. In addition, he provides two demos (Tacoyaki and Tacoyaki+) which are games related to the classic Lights Out to show off the matrix.

ATtiny Gets A Tiny Software UART

Modern microcontroller platforms spoil us with their performance and expansive spec sheets. These days it’s not uncommon to be developing for a cheap micro that has a clock rate well in excess of 100MHz, with all manner of peripherals baked in. DACs, WiFi, you name it – it’s in there, with a bunch of libraries to boot. It wasn’t always this way, and sometimes you would even find yourself lacking hardware serial support. In these cases, the bitbanged software UART is your friend, and [MarcelMG] decided to document just how it’s done.

The amateur programmer’s first recourse may be to use delays to properly time the output data stream. This has the drawback of wasting processor cycles and doesn’t let the microcontroller do much else useful. Instead, [Marcel] discusses the proper way to do things, through the use of interrupt service routines and hardware timers.

[Marcel]’s implementation is for the ATtiny24A, though it should be easily portable to other AVR8 processors. Taking up just 2 bytes of RAM and 276 bytes of program space, it’s compact – which is key on resource-limited 8-bit devices. The code is available on Github if you fancy trying it out yourself.

It’s a technique that is more than familiar to the old hands, but useful to those new to the art. It can be particularly useful if you need to get data out of a legacy platform with limited options. As times change, it’s important to pass on the techniques of yesteryear to the new generation. Of course, if things are really tight, you can even do a half-duplex UART on a single pin.


Get Twelve Charlieplexed PWM Outputs From An ATtiny85

Most of us are aware that charlieplexing can drive a large number of LEDs from a relatively small number of I/O pins, but [David Johnson-Davies] demonstrates adding another dimension to that method to create individually controlled PWM outputs as well. His ATtiny85 has twelve LEDs, each with individually-set brightness levels, and uses only four of the five I/O pins on the device.

Each LED can be assigned a brightness between 0 (fully off) and 63 (fully on). The PWM is done by using one of the timers in the ATtiny85 to generate a periodic interrupt, and the ISR for the interrupt takes care of setting the necessary ratios of on and off times for each charlieplexed output. The result? Twelve flicker-free LEDs with individually addressable brightness levels, using an 8-pin microcontroller and just a few passive components on a tiny breadboard. There’s even one I/O pin left on the ATtiny85, for accepting commands or reading a sensor.

[David] really wrings a lot out of the ATtiny series of microcontrollers with his compact projects, like his Tiny Function Generator (which recently got an update.) He also demonstrated that while charlieplexing is usually used with LEDs, charlieplexing can be used with switches just as easily.

Ultra Tiny PC Plays Snake

[Steve Martin] used to do a comedy act about “Let’s get small!” You have to wonder if [Paul Klinger] is a fan of that routine, as he recently completed a very small 3D printed PC that plays snake. Ok, it isn’t really a PC and it isn’t terribly practical, but it is really well executed and would make a great desk conversation piece. You can see the thing in all its diminutive glory in the video below.

The 3D printer turned out a tiny PC case, a monitor, and a joystick. The PC contains an ATtiny1614, an RGB LED, and some fiber optic to look like case lighting. The monitor is really a little OLED screen. A 5-way switch turns into the joystick.

Continue reading “Ultra Tiny PC Plays Snake”