Heroineclock II

Giant clock from a PIC18F6585, 135 cheap LEDs, foam core posterboard, hot glue, lots of hot glue

Similar projects worth following
Originally a clock that grew into a wall of measurements. Visible without contact lenses from all areas of the apartment.

It was a long & hard process between 1 month of commutes, but Heroineclock I was finally shut down after 13 years of blinking & replaced by a much better Heroineclock II, factoring in much more experience. 

All the Chinese options which appeared in the last 13 years were studied & found to be too expensive. The largest Chinese digits were 12" tall & $50. EL wire would cost a fortune. Projectors were too dim & small. Superbright red LEDs had dropped from 22c to 15c & become much brighter.

With the new experience, power consumption dropped from over 20W for Heroineclock I to 7W, yet light output increased greatly. The audio synthesizer was much more sophisticated, with 3 square wave oscillators & decay timing. The clockspeed was increased from 20Mhz to 40Mhz to allow the improved audio. The new speaker driver was a real PWM driven class D with the 0 crossing at 50% duty cycle. The speaker brought the total current with all the LEDs & sound to 0.6A.

The flaky buttons & switches which plagued Heroineclock I were replaced with an IR remote. It was a 1st experience decoding an IR remote & it revealed IR receivers don't output RS232 but PWM. The IR decoding ended up really schmick for it to handle the rapid button presses involved in setting a clock.  Modern LCD TV's have horribly slow IR parsing, in comparison.

The shift registers which drove Heroineclock I's LEDs were replaced by direct wiring to 1 GPIO per segment. A PIC18F6585 replaced the old PIC16F877. It had a massive number of pins, but only enough actively driven GPIOs for 27 segments. Instead of PNP transistors, the LEDs were driven by NPN's, allowing higher voltage. Instead of wiring the LEDs in parallel with massive amounts of current supplied to 2.5V bus lines, they were now 5 in series with 10V bus lines. The total current with all LEDs on was now 0.5A instead of 10A.

There's a small program to convert MIDI files into data tables for the clock to play back.  For the simple clock chimes, it was easier just to enter the data tables manually.  Having infinite note length & relying on the software decay made a more pleasing sound than having a defined note length.

For all the improved electronics, the whole thing could have been done much more easily with a raspberry pi playing mp3 audio. But the PIC would still have been necessary for multiplexing the LEDs & it was cheaper to leave out the additional raspberry pi. It was still a bit satisfying to use in a practical, modern application, a retro 8 bit platform with the kind of massive PLCC package that adorned high end electronics, 30 years ago.

Source code for Heroineclock II & thermometers:



x-pcb-layout - 96.07 kB - 08/15/2018 at 07:03




x-pcb-layout - 81.99 kB - 08/15/2018 at 07:03




x-csrc - 16.37 kB - 08/15/2018 at 07:02




x-csrc - 2.04 kB - 08/15/2018 at 07:01


x-xz - 239.59 kB - 12/07/2017 at 22:17


  • TODO

    lion mclionhead11/02/2020 at 07:10 0 comments

    All the lion kingdom's LED displays were made before 3D printing arrived, even the outdoor thermometer.  3D printed white PLA actually could make a good diffuser.  The lighting isn't as even as some clocks, but much better than heroineclock II.  This guy threw a lot more money at store bought components instead of making everything from scratch.  There are individually addressible LED strips which can show different colors, a much more powerful computer which gets time from wifi, a much heavier enclosure which requires a lot more hardware to mount on a wall.  His other projects are manely toys, but there are a few good ideas.  Lions actually want the time to drift fast instead of precisely track wifi.  It could benefit from 3D printed diffusers, but not replacement of the LEDs.

  • New remote arrangement

    lion mclionhead09/19/2020 at 23:34 0 comments

    With the addition of seconds & the remote also supporting the robotic air vent, it was time for some adjustments.  

  • Thermometer 3

    lion mclionhead08/14/2020 at 05:53 0 comments

    4 reconstituted autopilot boards from 10 years ago were reprogrammed & reworked for their new life as a sensor network. 

    1 transmitter board transmits the temperature from outside.

    1 transmitter board transmits the temperature from inside.

    1 reciever board sends the temperatures to the router.

    1 receiver board sends the outside temperature to a new LED panel.

    The outdoor thermometer runs at 32.768khz.  The PIC18F14K50 was found to use 150uA in idle & up to 30mA when transmitting. It needs to transmit for a long time to overcome interference. The easiest error correction is to transmit more data.  The PIC uses its maximum baud rate of 8192 baud.  The internet said the sleep current is lower when using the watchdog timer instead of idle mode, but this was found to not be true.   The watchdog timer can go to 120 seconds, but it would have to take all its ADC readings at the moment of transmitting instead of averaging them over 120 seconds.

    The thermometers transmit a 16 byte key to identify themselves, followed by the temperature repeated 4 times.  The key & temperature are also repeated 4 times.

    The existing thermometer board got a retrofit to transmit temperature to the router.  After 16 years of just showing the temperature, giant thermometers could finally record the temperature.

    After much debate, the outdoor thermometer got a new voltage divider to measure battery voltage.   It doesn't need to measure battery voltage over its many years of temperature measurements.  It only needs the battery voltage to test the solar panels in its 1st day.  The problem is the alternative is to go outside with a voltmeter several times.

    Its idle current increased to 200uA & lions rediscovered the ground for the voltage divider can't be a GPIO or it'll sink the high voltage from the battery.  When the power usage is this low, the high voltage from the battery raises Vdd.

    As bad as the compromises seem, the power usage is actually tiny compared to a modern standards based solution.  The modern solutions use an ESP32 & wifi.  They have to stay on for a long time to negotiate a wifi connection, which tends to erase any gain from their nano amp sleep current.  

    It was frustrating to discover despite being only a temperature sensor in a very suboptimal location, the enclosure still needed to be a proper weather station enclosure to get good results. Much cardboard prototyping yielded something like a bird house with a way to access the innards. Now the lion kingdom knows why it needed to keep around a speaker stand for 20 years. The mane problem is keeping the wind from giving the neighbors a free $90 thermometer. It's cost as much just to get temperature as a full chinese weather station.

    Thermometer with a smile, you might say.

    Junk NiMH battery from an ECX Ruckus rated for 7.2V.  

    Waterproofing the battery.

    Trying to protect the electronicals from condensation.

    Failed attempt to isolate the thermistor from conducted heat.

    The enclosure size was dictated by the solar panels.

    The electronicals were buttoned up & it was put outside.  The thermister was 5 deg higher than wunderground at night & 15 deg high by day .  The fluke was 20 deg higher than wunderground at night & bang on by day, despite being in the exact same place inside the enclosure.  Location of the thermistor inside the enclosure affected temperature.  The area without circulation was much hotter than the area with circulation.  When indoors, the thermistor was bang on.

    The thermistor:

    A full day of measurements revealed it suffered from heat conduction. A new assembly made of magnet wire & balsa would conduct less heat from the coroplastic. This was still...

    Read more »

  • Exterior temperature plan

    lion mclionhead08/10/2020 at 04:42 0 comments

    With no need to spend all day commuting, there has been a growing desire to measure outdoor temperature without the grid & recording the indoor temperature.  There are a lot of temperature sensors on the internet, using ESP32 & ESP8266 boards, exotic capacitors, lithium phosphate batteries, space grade solar panels, sucking megawatts of power to promote the latest wifi standards.  It's all a bit overkill, but representative of a time that emphasizes very suboptimal, off the shelf parts using every multibillion dollar consortium's bloated standard.

    The lion kingdom still has a lot of very optimized parts for this task from 10 years ago, when everything was purpose driven & had to be built from scratch.  Lions in those days evolved the equivalent of an IOT board out of a PIC18f14k50 & SI4421.  It used a milliamp at most when transmitting, & 3.3V.  The power consumption was so low by today's standards, it could run on some NiMH batteries & very cheap solar panels.   Lions wouldn't use Lithium batteries for this task because of the daily cycling.

    A small armada of these boards was built 10 years ago for transmitting heading from copters.  Today, they would be prized for their remote sensing ability.  They could be reworked for transmitting temperature.  The home router would have a board for receiving the packets.

    There isn't enough room to display the outdoor  temperature on a wall, but a web page could show it.  The temperature display could also receive packets & alternate between the indoor & outdoor temperatures.  There's no need to measure anything but temperature in Calif*.

  • Wishlist

    lion mclionhead07/28/2019 at 00:31 0 comments

    A lot hotter since the thermometer was installed. Lions have debated adding an exterior thermometer, a seconds display, & temperature logging.

    The seconds display is the least likely.  It would manely make it easier to wake up as close before the alarm as possible, but it would add a lot more blinking & it would be hard to see.  

    All enhancements to the thermometer point to a mesh network.  The lion kingdom has a supply of XBees, but they use a lot of power.  Temperature logging for the indoor thermometer would have unlimited power.  Temperature logging outside would require solar power. 

  • Clock documentation

    lion mclionhead04/04/2019 at 16:30 0 comments

    A year without commuting allowed the clock interface to never be used.  With the return to commuting, the lion kingdom had manely forgotten how to set the alarm.  It was time to document the control.  This is the last Yamaha remote the lion kingdom will ever have & it arrived 20 years ago with a stereo that's long gone.  The next remote once this one is lost will be completely different.

  • The remanes of Heroineclock I

    lion mclionhead08/16/2018 at 03:47 0 comments

    Thermometer II was made out of the known good LEDs from Heroineclock I, which left the original faceplate & questionable LEDs ready for landfill.  

    It was seriously overbuilt & had a lot more features.  Was surprised to discover the plastic was covered in window tint to make it darker, while also losing some brightness.  

    It's long journey since being painted in 2004 had come to an end.  The electronic section still has hope.  

    Whether the original balsa faceplate could be reused is doubtful. The lion kingdom doesn't foresee any way to afford a 2nd room. It's much bulkier than its size requires.

  • Thermometer II completion

    lion mclionhead08/14/2018 at 08:34 0 comments

    Be sure to label your GPIOs.

    2 layers of wax paper, just like Heroineclock II were applied.  The ancient LEDs were maxed out & it was still dimmer than Heroineclock II's minimum  brightness.  If you don't have any money, it says 81.  If you have money, it says 72.

    An accurate temperature reading is very very very hard because of the logarithmic resistance of the thermister combined with the logarithmic voltage from the voltage divider.  Didn't realize how far off the circuit was until comparing it to the Fluke.  Heroineclock 1 was calibrated only by testing ice & boiling water.  Fluke measurements from ice & boiling water are way off of 32 & 212.  Better results would be achieved by multiple GPIOs feeding variable current to the thermister.

    The basic equation for a voltage divider gives reasonable ADC values near habitable 

    temperatures.  A simple C program converted resistances from the data sheet to ADC values from the voltage divider.  Though it had some experimental test values, the ADC values were predicted purely from the data sheet.  This gave exactly the same temperatures as the Fluke, from 45F to 185F, accepting differences in thermal inertia.

    To make a better video, the thermometer got a completely worthless test mode.  The test mode was manely to measure its maximum current.  It only used 140mAh with all the LEDs on.  The PIC was clocked at only 10Mhz to reduce the power.

  • Thermometer 2 board

    lion mclionhead08/07/2018 at 20:39 0 comments

    The 1st home etched board since February rolled off the assembly line. Phones & raspberri pi's have made this fabrication extremely rare.

    Those PLCC 68's are still things of beauty & joys forever. Should have used a much smaller chip, but the 68's came 10 years ago & were never used. They were meant for building heroineclock II in through hole mode, but all through hole boards of that complexity were replaced by surface mount. It's totally pointless & expensive to use them now, outside of vanity designs. It'll be in full view of the apartment until the lion kingdom dies.

    It occurred to the lion kingdom to make the segments fade on, instead of smashing on like LED brakelights.  It might make it easier to sleep & give it an edge over Chinese shit.  It would also feel like slowing down the aging process if the numbers didn't quickly change.

    Would still have to bang the LEDs on when playing sound.  PWM needs to get above 200Hz.  The trick is fading slow enough to not wake up the lion, to not look like an incandescent light & yet fast enough to have a useful on time.  Having said that, sleeping is the only time a lion even sees the digits changing.  Once you get used to it, it doesn't matter.  

    The DVD archiving project yielded the original table for the original thermister.  20 years ago, you could obtain a bare thermister just by walking 2 miles, no shipping costs or 1 week delay.   30 years ago, someone who lived outside China even knew what a thermister was.

    Useful range would be 5k - 30k.  Heroineclock 1 used a carefully tuned op-amp to span the entire ADC range.  Modern designs just wire the thermister in series with a resistor.  A 10k gives 0.45 - 3.75 on the voltage range.  A 5k resistor gives 0.83 - 4.29.

  • Thermometer II

    lion mclionhead07/14/2018 at 20:51 0 comments

    The original heroineclock had a thermometer.  It could show temperature fulltime or oscillate between time & temperature.  It oscillated painfully for 10 years.  It could be resurrected as a fulltime thermometer, but it uses too much power.  There are 33 LEDs known to be good in Heroineclock 1 & 23 spares of Heroineclock 1's vintage.  A temperature display of Heroineclock 2's size needs 80 + at least 5 spares.  

    The framework of Heroineclock 1 could be left intact, with all the electronics replaced, LEDs rewired in series.  Heroineclock 2 left behind enough transistors to do the job.  Voltage regulators from Heroineclock 1 could be reused.  A slightly larger display could be made with 3 LEDs per segment.  

    3 LEDs per segment limited the new display to 8" tall.  Younger lions could make out 6" tall digits from anywhere in the apartment, so old lions might be still able to read it with a bit of effort.

    The LED count limited it to 0-199 in Fahrenheit.  Imperial is still the cheapest unit to display, as much as binary imperial would be even cheaper.

    Lessons learned from Heroineclock II were applied to thermometer II.  

    Far fewer pieces of foam were cut for each digit.  The foam length was limited by the amount of hot glue which would stay hot.

    Apply hot glue to the paper side of the joints, not the foam side.  It melts foam so nothing fits flush.  Don't do what Adam Savage does.  

    Glue middle segments of each digit first, then work outward.  This way, segments won't end up being too long for the remaneing space & the digits will naturally overrun the outlines.

    Try to hold the segments vertical until the glue sets.  The glue fills in the gaps from lousy cutting.

    Measurements don't have to be crazy accurate, because the cutting & gluing is terrible anyway.

View all 13 project logs

Enjoy this project?



seilerjacinda925 wrote 11/19/2019 at 16:08 point


Nice to meet you after viewing your profile i am Jacinda, from (jakarta) indonesia,

i have a project discussion with you please email me on: (

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

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