Close
0%
0%

Klara, a solar LCD creature

Solar-powered creature that reacts to energy with animations on a 7-segment LCD. It can also blink!

Similar projects worth following
283 views
0 followers
~ This is an ongiong project. Check back for updates in the project log! ~

Klara is a solar-powered creature with a simple, unlit 7-segment LCD display and an ATTiny85 microcontroller. It stores her energy in a pair of 1F supercapacitors so she can stay awake for a few more hours after sundown.

When the sun shines and her reserves are full, she plays lively animations on her LCD display. As her energy declines, the animations slow down and freeze into still images, until they disappear altogether.

Klara uses her banal clock/thermometer LCD as a minimalist artistic canvas. She's this little creature that can sense the sun's energy and the temperature of the air that surrounds her. What tales will she tell us?

The name comes from Ishiguro's novel, Klara and the Sun. The concept itself was inspired by Mohit Bhoite's solar-powered circuit sculptures, and by Joey Castillo's crazy LCD work on his sensor watch.

Why the world needs a solar LCD creature

Designing Klara has been a balancing act, trying to reconcile my desire to repurpose everyday parts with the practical limitations of technology and struggling supply chains :)

Unsealing the inside. So much of technology around us, especially consumer electronics, is pretending to be something virtual that seals its inside in a shiny white enclosure. But technology, with all its messy and often chaotic detail, can be beautiful. Let's turn electronics into an aesthetic object. Let's put the circuitry itself on display!

Repurposing parts. The 4-digit LCD is one of the most banal objects around us. Let's give it a new purpose that's not just about showing the current time or temperature! It has 32 independent segments -- that should be enough to put on an entertaining show. Similarly, a mass-produced temperature sensor used in cars can find new meaning in an indoor solar sculpture.

Solar autonomy. A little machine that has no moving parts that wear out can, in theory, work indefinitely, as long as it receives sunlight. That makes it a little like a biological being, forever absorbing sunshine to defy entropy.

Capricious reactions. A thermometer reacts to changing temperature, but it's still a pretty dumb thing. In contrast, a programmed creature can go beyond sensing its environment and also react to it in interesting ways. Animations slow down and freeze as its energy declines. Every morning when it wakes up it can choose a different, unpredictable set of shapes and animations to show that day.

Minimalism. A solar circuit needs to conserve power, which by itself makes it an excercise in minimalism. How much can we squeeze out of a tiny computer with only 128 bytes of RAM? What is the most interesting show the creature can put on using its simple LCD display?

Transparency. Consumer products are not only physically sealed to hide their internals; they also disguise the details of their inner state. This creature reports its parameters directly. It doesn't say its power is at X percent; it shows its actual voltage level, and reports the temperature it has measured. And it doesn't only showcase its circuitry. All its designs, schematics and code is public, so anyone can build it or derive a different creature from it.

Sources of inspiration

Technical design

This section is work in progress; it will be updated as I make progress with the build. Do check out the project logs for incremental updates!

There will be details here about:

  • Klara's circuitry
  • Software
  • PCB design
  • The laser-cut sculpture frame
  • Final assembly

  • 1 × ATTiny85 microcontroller
  • 1 × 4-digit, 7-segment LCD display with HT1621 controller
  • 1 × Solar cell 5V 70x30mm
  • 1 × Zener diode
  • 1 × Supercapacitor

View all 12 components

  • Reverse engineering my new LCD

    Gabor06/25/2022 at 14:51 0 comments

    OK, “reverse engineering” is a bit of an exaggeration here, but that was essentially the vibe when I first hooked up my mystery LCD component to an Arduino Nano.

    I’m not big on either Fritzing or Eagle, so I made a sketch of the wiring for you in Excalidraw :) The only thing that might need some explanation here is the 330Ω resistor between GND and the Nano board’s 3.3V output. I’m powering the board over USB, which is 5V. The 3.3V output comes from the on-board voltage regulator, but with no load I’m getting a higher voltage. The LCD component doesn’t like that: the off segments are turning black at a normal viewing angle. So I just did the easiest hack I could think of and added the resistor to create some load on the 3.3V VCC pin. This helps just enough, so I’m leaving it at this.

    A bit of googling lead me to Valerio Nappi’s ht1621-7-seg library, so I went and wrote up a sketch that counted rapidly from 0 to 9999, took a deep breath, and uploaded it to the Nano. Here’s what happened:

    That is actually... splendid news! The board can clearly talk to the LCD component, information is getting transmitted, and the display’s segments get turned on and off in response.

    All that’s left is to figure out which bit in the library’s buffer corresponds to which segment on my display, because apparently this component is wired very differently from what Valerio was working with.

    The magic in the library essentially boils down to this code snippet:

    void HT1621::wrData(uint8_t data, uint8_t cnt)
    {
     uint8_t i;
     for (i = 0; i < cnt; i++)
     {
       digitalWrite(PIN_WR, LOW);
       delayMicroseconds(4);
       digitalWrite(PIN_DATA, (data & 0x80) ? HIGH : LOW);
       digitalWrite(PIN_WR, HIGH);
       delayMicroseconds(4);
       data <<= 1;
     }
    }
    

    The loop transfers cnt number of bits from data, starting with the highest-order bit and moving right. This technique of controlling the levels on the communication pins straight from code is called bit-banging, and it’s a straightforward implementation of the wire protocol described in the HT1621 datasheet:


    The 4 μs delay on the clock signal is at the lower end of what HT1621 accepts for writing, but hey, who wants to waste time saying nothing?

    As I was experimenting I altered and reduced Valerio’s code in various ways:

    • The original library has a 6-byte buffer, and always transmits all of it when updating the display. For some related display drivers that can control more segments this makes sense. But with my 32-segment LCD, only 4 bytes are ever used, so I reduced the buffer and don’t transmit the always-zero 16 bits during updates.
    • The original class stores the index of the 3 pins it uses in memory, which makes sense in a general-purpose library. I switched to defines for this, eliminating another 3 bytes from my program’s memory footprint. This matters in the ATTiny85, where I only have 128 bytes! I’ll want to use them for cool animations and other funky behavior in the creature.
    • I removed all functionality related to encoding digits and characters and moved that to a separate class. I consider that a different, higher layer; my HT1621 class only deals with controlling the display’s segments based on the bit values in a 4-byte buffer.
    • I rewrote the command codes in binary notation, as that mirrors the specification in the datasheet more transparently than hex values. And I totally kept the Chinese comments, which must date back to anxzhu’s original library that Valerio forked :)
    #define BIAS    0b01010010 // 1/3 duty 4 commons
    #define SYSDIS  0b00000000 // 关振系统荡器和LCD偏压发生器 ~ disable sys oscillator and LCD bias
    #define SYSEN   0b00000010 // 打开系统振荡器 ~ enable system oscillator
    #define LCDOFF  0b00000100 // 关LCD偏压 ~ disable LCD bias generator
    #define LCDON   0b00000110 // 打开LCD偏压 ~ enable LCD bias generator
    #define XTAL    0b00101000 // 外部接时钟 ~...
    Read more »

  • Low-power LCD is... hard!

    Gabor06/12/2022 at 11:42 0 comments

    Simple, 7-segment monochrome LCDs have been on every cheap calculator and digital wrist watch for decades, so you'd think they are the easiest component to find for a low-power electronics project... But they are not! In reality, this has probably been the part of where I spent the most time looking for a solution.

    There is no shortage of easy-to-use display modules for microntrollers if you're looking for an OLED display or even a 7-segment LED display. These are fun, but they are definitely not low-power.

    Then there is an abundance of bare-bones LCD displays without a driver. These are parts with lots and lots of connectors, looking a little something like this:

    They are cheap, readily available - and a real pain to use. It's not just the sheer number of wires, though that's an issue as well. The problem with an LCD is that you cannot just send power to the right pins and hope for things to work out. You need to actively send alternatig signals to prevent irreversible chemical changes inside. People have done it before and written about it, and it makes for a really interesting read too: Driving an LCD display directly with ATtiny. But I'm not ready to bikeshed this from scratch.

    And I don't need to, either: there are ready-made components to drive an LCD. After a great deal of searching I zoomed in on the HT1621, which seems to be the most widely used one for small displays with up to 32 segments. I could get one of these and hook it up with a bare-bones LCD display, except... The HT1621 has a lot of pins, and it comes in an extremely tiny form factor. Just to get started I would need to get a custom PCB manufactured, and I'm pretty convinced I wouldn't even be able to solder parts this small. I need a breakout board.

    Which is where things get really, really difficult. It's exactly these breakout boards that seem to barely exist. Mohit Bhoite has apparently found one for his latest satellite, but it's unclear where it comes from. Maybe it's this part from Hexpert systems? There's something inside me that rebels against spending 12 bucks on what's supposed to be a super simple mass-produced component. [UPDATE: Mohit just tweeted about this, and it's exactly as I thought: his satellite uses the part from Hexpert.]

    And so I turned to Aliexpress, where I eventually struck gold. The link will most likely be gone soon, so here's a screenshot of my bounty:

    44€ might sound like a lot, but it's for a bag of 10, and I think when I placed my order it was more like 30€. Anyway, these postings come and go all the time and the price of the exact same product varies a lot, so it's worth searching around!

    I placed my order, crossed my fingers, and waited... And true enough, in about four weeks I had a padded envelope in my mailbox with a literal bag of 10 of these things.


    NOW the fun can start! But that will be a separate update.

    Useful links:

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates