17 April 2018

Canon Palmtronic 8 (LD-84)

Yes, another calculator showed up at home. This time it is a pocket device called Canon Palmtronic 8, also known as LD-84. It works off 2xAA batteries and has 8 digits shown on a VFD display. It also accepts an external 3Vdc power source.

This one did not need any restoration, except for some light cleaning of the plastic case.

The rightmost digit is slightly fainter than others because obviously it has been "on" longer than other segments.

What else? The weight is just fine, and those two batteries account for lots of it!

29 March 2018

Unresponsive Windows 10 laptop: automatic disk optimization

I have a 3-years old laptop at home (bought February 2015). HP, quad-core A8 CPU, 4 GB RAM, 5400 rpm HDD (slowish, I know). It came with Windows 8, then upgraded to 8.1 and finally to 10. It is used for browsing the Net and simple text and image processing. PCB design and Arduino coding, when needed. It has become less and less responsive without us adding new software. The symptom is the hard-disk being used 100% of the time without any apparent reason.

The problem lies in the user, or better, in the way we use it. This laptop gets used in the dark silent sleepy quarter-of-hours that lay between housekeeping chores (doing the dishes, getting ready for the next workday, ...) and hitting the pillow. That's between 23 and past midnight.

As far as I could understand, on Windows 10 I can define a "let me full control of the computer" time range, up to 12 hours long, but it doesn't span across midnight. Instead we need to be able to use it quickly, for 15-20 minutes in late evening, while Windows apparently does all its chores rendering the machine unresponsive.

So, before throwing it away in despair I wanted to try the move to Linux (Ubuntu): I've been using it as my main operating system at work in a 99% Microsoft-based environment, besides I know what I'm doing. Once I confirmed that everything apparently works booting off a USB drive, I needed some HDD space to install Ubuntu.

The correct procedure consists in shrinking the HDD though a standard Windows tool. That's when I saw the red alert light: Windows (10) is configured to do an automatic disk optimization once a week. On a 500 GB HDD full at 75% it could take half an hour. But what if in the meantime the antivirus updates, you use the computer and you shut it down because you're fed-updone? The whole process takes longer and I think it goes into an endless disk optimization, because it almost never completes.

Regardless this discovery I will install Ubuntu (16.04 LTS) on this HP 15-g005nl because there's no software keeping us tied to Microsoft Windows operating system.

Meanwhile, if you solved Win10 unresponsiveness due to 100% disk usage, let me know in the comments (and stay in-topic, I won't allow Win vs Linux flame or bad words about any of the products: tested solutions only).

18 March 2018

Modding a DIY USB Power Bank case with HT4936S

Since I had some spare 18650 Li-Ion cells laying around, I decided to fit them in a couple of empty power bank shells sold online for few €/$. Today I will report on what looks like to be a copy of Xiaomi 10400 mAh power bank.

Knowing my pre-charged cells were relatively good, I suspected something was wrong when right after the first few seconds using the DIY USB power bank to charge my smartphone the status LEDs reported 75% or even 50% of charge remaining.

A quick inspection with the DVM after recharging the power bank revealed that my four cells were all measuring 4.0V, while I would and could charge them up to their nominal 4.2V voltage. Time to troubleshoot the electronics.

With the help of a magnifier I could identify the all-in-one controller chip as HOTCHIP HT4936S (Company website). Datasheet can be found online (7 pages in Chinese) and translated into English with an online service. The datasheet is far from being comprehensive, but the device isn't too complex either. The HT4936S chip takes care of charge and discharge control, voltage booster to 5V/1A, 4 status LEDs, a control button and, as every Respected Chinese product, a flashlight (press twice the button to activate - if the flashlight LED is present - twice again to turn off).

A note about the flashlight. This power bank does not mount the flashlight LED, but I tested the double click on another "shell" with unmarked controller chip and it works.

At first sight the circuit on the PCB is very similar to the datasheet sample application. Good. Some components are missing from their pads. Not so good.

Problem #1: cells are charged up to 4.0V only.
According to the datasheet, the HT4936S can be configured to stop charging either at 4.20V or 4.35V: while pin 1 is left open it should charge cells to 4.20V, if grounded it goes up to 4.35V. Why does it stop at 4.0V then? Shorting together R1 pads will ground pin 1 and set the target voltage to 4.35V. It works, and it keeps charging. I stopped it at 4.25V/cell so they don't get damaged.

Solution #1.
While this mod forces the IC to charge cells up to 4.35V, it moves "upwards" the discharge detection, therefore the chip considers them depleted at 3.6V thereabout. There is still the doubt why it stops at 4.00V instead of 4.20V in the default configuration. So this solution is not the final answer.


Problem #2: ground connection intrinsic resistance.
The ground connection is made of a single long wire that is wind-up to make the four contact springs: unless you insert a pre-made 1S4P pack, negative terminals of your 4x 18650 pieces won't be at the same potential (under load). I measured 100 mV drop between GND pad on PCB and the farthest cell during full current recharge (about 800 mA input). A solution could be to add a thick wire/strip that connects together all negative terminals.
In case you wonder, this extra resistance does not seem to be the culprit of Problem #1 since it keeps charging up to 4.35V.

Solution #2.
There is no much room in the power bank case to shorten the ground path. So ... live with it.


I wonder if off-the-shelf power banks suffer from the same design errors. Probably not. I will consider these as an energy source when no other solution is available. On the other hand I will not let "waste" 4 cells in there, but rather leave just a couple.

05 March 2018

Count-up timer with TIL305 - optimizations

Looking at the 2x TIL305 timer I tried to imagine an even simpler version with lower parts count: could a single ATtiny2313 drive both displays? This AVR comes in a 20 pin package: take out two for power and one for reset (needed for low voltage programming and anyway it has limited current drive capability). That leaves 17 I/O pins.

My current implementation uses 5 pins for columns, 7 for rows and 1 for the decimal point: 13 I/O in total. Another display needs 5 control lines, we're 1 short (17 - 13 = 4).

If the decimal point is left out math tells us that 17 (total) - 13 (one full TIL305) + 1 (decimal point) = 5. That's enough to drive two TIL305 with one ATtiny2313.

But there is no room for the microcontroller to interact with the outside world, especially to receive an input signal like the 1 Hz clock. There is a way out!

When looking at the TIL305 running in landscape mode, you realize that your 5x3 symbols take up a total display area of 5x(3+3) pixels: the middle column (row #4) is never used because it acts as symbol spacer!

So, as long as you want to use 2x TIL305 in landscape mode displaying 4 symbols drawn on a 5x3 dot matrix, an ATtiny2313 will suffice as driver. You can now drop the code that sets row #4, thus running the scan 1/7th faster!

Want to get rid of the external 1 Hz timebase? Upgrade to an ATmega48 (o 88, 168, 328) and generate the clock with a XTAL so that the timing obtained in software will be more accurate than the internal 4/8 MHz RC.

26 February 2018

Count-up timer with TIL305 - built

Thanks to a pre-wired breadboard the circuit went together in an hour:


From left to right: most significant digits and ATtiny4313, least significant digits and ATtiny4313, CD4060 oscillator and divider. Decoupling capacitors on the Vcc supply rail (that must be used in digital logic circuits!) prevent detection of false 1 Hz input pulses.


The circuit in the picture is powered with a 18650 LiPo cell at about 3.8V and it has been running all night to test the firmware past 10 hours of operation.

At powerup is starts counting immediately. First only seconds are shown. Then minutes and seconds until 59' 59". Then it switches to what is shown in the picture. After 9h 59' you get HH MM.

The font was chosen as a trade off of readability vs cozyness vs current consumption. There is some MSD blanking too, but it doesn't last long.

Further improvements before looking for a suitable box: add the battery, a 1S LiPo (dis)charge controller, a power switch. Maybe some firmware improvement once the timer is shown to the public.

Besides as kitchen timer, it can be used as elapsed work(-day) timer ... that's where I will hopefully gather some extra feedback.

The firmware is written in BASCOM. I want to do some further optimisation before uploading the code to my github account. Binary is available on request as well as TIL305, if need too.

24 February 2018

Count-up timer with TIL305 - design

After building few clocks and thinking of many more, I wanted to do something slightly different. The "new" idea came one evening while cooking, when I realised I never remember at what time the pasta (food) will be ready. "Was it 20:14 or 20:20?"

I am too lazybusy to set a countdown timer every time and since my short-term memory is not willing to cooperate I chose to try a count-up timer: a simple device that shows elapsed time.

For this task I wanted to use TIL305 5x7 dot-matrix LED displays made in 1970's. Two challenges:
  1. they need an appropriate driver
  2. they are very current hungry
I had already solved the driver problem by reproducing someone else's idea to adapt an ATtiny2313 microcontroller. You need one ATtiny every TIL305. Cost-wise in 2018 this solution is probably cheaper than using obsolete unobtanium driver chips.

Texas TIL305, Monsanto MAN2A, ...

Since I want my timer to be battery powered, at about 38 mA per 2313&305 pair, I cannot use too many displays. Four digits is the minimum useful IMO ("mm:ss" and "hh:mm" for longer runs), but another idea comes to the rescue: use smaller font, 5x3 dots vs 5x7 and show two digits on each TIL305. This approach has another advantage: limit the required wiring (I won't be doing a PCB!).

How about the timebase? ATtiny's will not synchronise, they will receive both the same external timebase signal and rely on their internal clock to run the code. I could have had one master driver generating the pulse for others, but I am not sure on the internal RC calibration and on longer runs the difference vs 1 pps could be unacceptable. So there will be a 32.768 kHz oscillator and divider with CD4060 chip (because it accepts a wide range of supply voltage).



21 February 2018

Old vs modern high voltage capacitors

Side by side comparison of the size of 500+ V capacitors, same values. 1955 vs 2018!


Well, the dielectric is different!