Friday, 11 March 2016

Undoing yellowing on ABS plastic like LEGO® bricks and old computer cases

Every owner of vintage computer hardware or older LEGO® sets will know the problem: the plastic that used to have a bright white or neutral grey colour, tends to turn yellowish or even brown over time. I used to believe this was an irreversible ageing process, until I did some research. My first find was a YouTube video presenting a rudimentary way of bringing back the bright white colour of LEGO® bricks. Further research led me to the Retr0bright project which presented a more advanced technique than the video.
Bromine.
Original photo by Jurii (license)

The culprit proves to be the flame retardant inside the ABS plastic. It is based on Bromine, which is not a big surprise because it has the same typical brown colour as gradually appears on the affected plastic parts. When exposed to UV radiation (which is present in sunlight), the bromine compound reacts with oxygen, causing the colour change. Ironically, the method to reverse this discolouration relies on the same UV radiation. The trick is to add hydrogen peroxide (H2O2) to the mix, which encourages the bromine compound to release the oxygen atom and put hydrogen in place, which undoes the colour change.

That is the basic idea behind the process. A refinement can be made with a chemical called TAED which can act as a catalyst to greatly speed up the reaction. This chemical happens to be an ingredient of typical “Oxy” laundry booster, so it is readily available.



I did some experiments of my own on some old LEGO® bricks of which I assumed they were doomed to be eternally bereft of their original bright white colour. As you can see in the above photo, the results are quite spectacular. Those are the same bricks (if you look carefully, the legs still have the speck of dirt on their left side). The above experiment was done with H2Oonly, and it took several days to obtain those results. The next experiment was done with Oxy added, which provided results much quicker:



The Retr0bright project used to have a wiki explaining how to make and use an optimal mixture for restoring old ABS plastic. Unfortunately this wiki is now down, and accessing it through the Internet Archive is slow and often incomplete. Therefore I will try to summarise the essential information here for easier reference, backed up by my own experimental results.


Caveats and general remarks

You will be working with hydrogen peroxide. Any solution between 3% and 30% strength can be used. The 3% variety is easily found in the pharmacy section of supermarkets etc, and won't do any harm if you only leave it in contact with your skin for no longer than a few dozen seconds. Up to 10% can be obtained from hairdressers, it is used for bleaching hair. This is more dangerous and skin contact should be avoided, also ensure it does not get into your eyes: wear goggles. Stronger solutions are more dangerous: 30% can produce instant painful burns, so never handle it without proper precautions. Needless to say: if you are a kid, you should not attempt any of this without adult supervision.

As with many chemical reactions, this one is dependant on temperature too. From my experiments, this proves to be an extremely important factor. It seems the reaction only really provides any results at all from 15°C (60°F) on, and only really starts to catch on at 20°C (68°F). Warmer means faster, but I do not recommend going above 30°C (86°F) if you want to leave the parts unattended for a longer time period. Certainly avoid going above 40°C (104°F) because parts could start to deform.

Ensure the parts are submerged at all times. Any part that is partially submerged risks developing a white sheen at the liquid-air boundary. If this does happen, it might be possible to remove the sheen by ‘burnishing’ it, i.e. rub another smooth and hard object against it. For LEGO, you could try a slightly harder plastic object like the brick remover.

More is not always better: do not be tempted to add more Oxy, stronger peroxide, heat, or stronger UV light. At some point you will be damaging the plastic beyond repair if you do.

Basic method

This method is easy and cheap, but not always practical.

  1. Find a transparent recipient large enough to hold the plastic parts you want to restore. Cover the bottom outside with tin foil, preferably with the matte side up (this will reflect light more evenly). You can also apply tin foil to the side of the recipient that points away from the UV source. If you really want to provide the most uniform lighting, put the recipient on a slowly rotating turntable.
  2. Pour the hydrogen peroxide solution into the recipient, enough for the parts to be submerged.
  3. Submerge the parts and ensure they cannot float up again, e.g. by placing a glass plate or something else transparent over it. Do not stuff too many parts together: ensure the light can reach every part.
  4. Place it in direct sunlight, or under a UV lamp that outputs a decent amount of light. For a 15 W lamp, do not put it closer than 25 cm (10 inches).
  5. Wait, stir up the recipient occasionally to let bubbles escape and to turn around parts, and take out and rinse the parts when they appear to have bleached sufficiently.
Bubbles
This method works OK, but may be slow, although it can go surprisingly fast when the liquid is warmed up to about 30°C. On a hot summer's day, parts can go from brown to bright white in a few hours. The advantage is that the peroxide solution will generally last long and can be reused. As long as you see bubbles forming on the plastic parts, the solution is still active. If no bubbles form within 5 minutes even when the solution is warmed up to 30°C, it has decomposed into plain water and must be replaced.


Faster method

  1. Do the same as above, but add a small amount of “Oxy” laundry booster to the mix. You should not add more than about 1/4 teaspoon per half litre of solution. Ensure it is well-mixed, you could dissolve the Oxy in a bit of warm water before adding it.
  2. Ensure the solution stays at about 25°C, or 30°C if you want it to go really fast.
  3. Monitor the solution carefully at regular intervals. As soon as it stops bubbling, remove the UV light source and take the parts out. If they are not yet sufficiently bleached, make a new solution.
This method can provide spectacular results within hours, even at moderate temperatures. The problem is that the solution will break down much faster, and as soon as the peroxide is gone, the UV light will again start the yellowing process. It is therefore essential to stop when the peroxide is exhausted.

Only add the Oxy when you're going to start using the solution. It cannot be stored for a long time with the Oxy added, unless perhaps you cool it down to near-freezing temperature, but I do not guarantee this.

The disadvantage is that the Oxy generally also contains detergents which will cause foam, especially with the peroxide bubbling. This will stop after a while though. The detergents may also leave a dull residue which needs to be washed off the parts. Also, see my comments about coloured parts below.

Efficient method for large parts

The above methods are unpractical for large parts like computer cases, keyboards, or LEGO® baseplates. For those, it is better to create a gel as proposed by the Retr0bright project, which can be applied to the surface with a brush. Simply place the parts with gel applied to one side in the UV light (or sunlight) and check on them regularly. Then repeat for the other side. On the Retr0bright website you can see a spectacular example of what this method did for a horribly discoloured Commodore 64, with repeated applications within a timespan of only eight hours.

I have not tried this myself yet, but a good recipe for the gel seems to be the original Retr0bright one:
  • 500ml of 10% to 15% hydrogen peroxide solution (dilute it down with distilled water if you have a stronger solution).
  • 2 heaped tablespoonfuls of Xanthan gum
  • 1 level teaspoon of Glycerine
  • 1/4 teaspoon of Oxy. Again, do not add the Oxy until you're about to apply the gel.
The same remark about temperature holds: try to keep the parts between 25 to 30°C. Ensure the gel does not dry out, replace it if it starts to dry.

Although in theory it could be omitted, the Oxy is very helpful for this method because the gel dries up within hours, therefore we can really use the extra speed from the TAED catalyst to save us from having to reapply new gel too many times.

If you do want to omit the Oxy, you will need to ensure the parts are kept at a temperature between 30 and 40°C while being exposed to the UV light, otherwise the gel will work unpractically slowly. You may be lucky that the sunlight provides exactly the right amount of heat, but for an indoor setup with UV lamp, you would need to find a way to warm up the parts to the right temperature without causing the gel to dry up quickly (a heater with a fan is obviously not a good idea).

What about coloured parts?

For LEGO®, the parts that suffer the most from yellowing tend to be the white, blue, and grey ones (obviously, on colours like yellow or red, a lot of additional yellow needs to be added for it to become visible). For white, there is not really a problem: you cannot overdo the bleaching. For colours however, the story is different, and from my experiments I can only conclude that results are unpredictable.

The hook and bottom blue plate were treated, and ended up too pale.

I tried the second method (with Oxy) on both a blue brick and grey hook that had badly discoloured. At first it got better, but in the end both parts were bleached beyond their original colour. However, I do have obtained quite good results by only using peroxide, with other bricks that were less yellowed to start with. I suspect two things: first, the pigments themselves were already damaged by the exposure to sunlight, making it impossible to restore the colour of really badly yellowed parts (unless someone would find another clever chemical process to revert that reaction). The yellow or brownish tint can be removed, but the original colour cannot be fully restored. Second, chemicals in the Oxy might further damage the pigments. I would avoid using Oxy with coloured parts. My intuition tells me that the risk of damaging the colours will be lower, the less chemicals you add to the mix, so the peroxide-only method seems safer.

If you have a really badly yellowed blue or grey part, I recommend using peroxide only without Oxy, and regularly checking on its status. Avoid strong UV exposure because it could further damage the pigments. Take the part out of the liquid as soon as it looks good enough. Maybe a slightly yellowed darker colour is preferable over a yellow-free bleak colour. You will have to accept that it may not be possible to get back the original appearance. Anyone who has more experience with restoring coloured parts, be sure to leave a comment.

As for imprints and stickers on the plastic, these will generally not be harmed by the peroxide, although I cannot give any guarantees. If you want to err on the safe side, your best bet is to use the gel method and avoid applying gel over printed logos or any other non-ABS parts.

Do ABS parts made today still suffer from yellowing?

Wikipedia states that the use of bromine-based flame retardants is declining in the Western world. I have no concrete information about this, so I did a small experiment on a recently bought LEGO® part from Pick-a-Brick. I placed it under the same UV lamp used for the above experiments, for several days. The result was no visible effect whatsoever, so I am inclined to say that recent LEGO® parts are less susceptible to yellowing than the ones from the nineties and earlier. Nevertheless, if you plan to exhibit your favourite LEGO® models in a sunlit room, it may be wise to provide some kind of UV shielding.

Friday, 13 November 2015

Why the WD TV Live remote control works so poorly

Owners of a Western Digital TV player, or WD TV Live as it tends to be called, may have noticed that the remote control is hit or miss. Especially in larger rooms, it only works when standing near to the player, which makes it a pretty poor ‘remote’ control. We have one of these things in our development setup and I got sick of having to walk up to the player every time I needed to change settings or start a new video. I tried to hook up the player to the network so I could use the web-based remote control, but the player cannot handle our heavy network traffic and freezes within 10 minutes, so this was not an option.

Out of sheer frustration I dismantled the top of the remote to see if anything was wrong with the infrared LEDs. This indeed reveals there is something wrong… by design.



As the photo shows, the remote has two LEDs, but instead of pointing forward, they point away from the central axis at a ±15 degree angle. Sure enough, when aiming the remote 15° away from the player, it works fine even at larger distances.

Let me tell you what our QA engineer thinks of this: he would want to find everyone responsible for this design and shove one of these remotes up each of their ***es. I agree.

I don't know what the motivation for this design was, maybe to enable even the most drunk of persons to control their player even when they can no longer aim properly? The problem is worst in large rooms because in smaller rooms, the infrared signals can bounce off walls and the off-center aim does not matter.

Unfortunately it is not trivial to remedy this by bending the LEDs such that they point forward, because this poor design is protected by ample plastic to hold the LEDs firmly into place. I'll try to do some surgery with an X-acto knife but I would not recommend this to the average consumer who does not want to risk cutting themselves. The easiest workaround is to actually aim 15° away from the player when using the remote.

Saturday, 1 November 2014

iTunes 12: hacking the playlist font sizes

In iTunes 11, there were only two options for the font size in list views. The ‘small’ size corresponded to a font size of 12, the ‘large’ size was 15. It was possible to change these font sizes by editing the TextStyles.plist file (for your specific language) inside the iTunes app bundle. The two relevant keys were 9002 and 9003.

In iTunes 12, the old choice between three list sizes was reintroduced. However, the font sizes associated with ‘small’, ‘medium’, and ‘large’ have been assigned dubious values: they are 11, 12, and 13 respectively. There is even less difference between smallest and largest than in iTunes 11. The row heights do change quite drastically, resulting in an overly spacious display for the large size.



Editing the same keys in the plist as before has no effect. After looking around a bit, I found the keys that are currently used: they are respectively #17920, named “Label” (this is actually the large size), #18688, named “Label_Medium”, and #18944, named “Label_Small”. It may be necessary to edit the other keys with similar names to get a consistent result. For instance, to revert the ‘large’ size back to its former 15 point size, you would need to ensure the Label, Label_Emphasized, etc. entries look like this:

        <key>17920</key>
        <dict>
                <key>- loc hint -</key>
                <string>Label</string>
                <key>font</key>
                <string>_HelveticaNeueSystem</string>
                <key>size</key>
                <integer>15</integer>
        </dict>

Of course, this hack needs to be re-applied after every iTunes update. You may want to keep a backup of the edited plist file so you can simply copy it (although you should check whether no other values have changed in the update).

Tuesday, 18 June 2013

Movie genres in Plex media center: huh?

This post is not so much about a quirk in a particular program. Read through to the end and you'll see that it exposes a problem with crowd-sourced internet databases in general.
A few updates ago, Plex switched to a a new database for movie genres. According to what I can find from a cursory scan, it is Freebase). Previously it used IMDb, which only had a very limited set of genres. So it was supposed to be an improvement. However, when I browse through movies in Plex I now see things like this:
If someone would pick REC or The Fly for a romantic evening with their girlfriend, things would not end well. And in what way is “black-and-white” a genre? And don't get me started about “airplanes and airports”. Apparently I misunderstood the whole point of Indiana Jones. They should have made it more obvious that it was all about Indy hopping from one airport terminal to another.
When browsing through the films in Plex Media Manager, they prove to have multiple genres and the second genre often makes a lot more sense than the first (e.g. Thriller for Sin City, Horror for REC).
I can guess how this database came into existence even by only taking a glance at the Google results page for the “freebase” thing I did not know until now. It probably works in a similar way as the good old Google Image labeler, where random people are encouraged to slap as many labels onto random images as possible. The people who have the most time for doing this are children and teenagers, whose first impression of a film like Sin City is “it's black-and-white!” (Which is wrong by the way, there is quite a bit of colour in it.) Therefore the labels that get the most weight, are the ones that these age groups consider relevant. Maybe it would be helpful if the database would keep track of what labels were assigned by what age groups. Any user of the database could then re-weight the entries according to an age group of interest.

Sunday, 2 June 2013

Assassin's Creed II & Brotherhood on Mac OS X: avoiding the keyboard bug

Anyone who has tried to play the Mac OS X version of Assassin's Creed II or Assassin's Creed Brotherhood on a machine with more than one keyboard or with a fancy gaming mouse, will have encountered the annoying bug that causes the keyboard not to work. The game must be started multiple times before it reacts to the desired keyboard.

The reason for this is that the game can only handle one keyboard. When it starts, it will pick a keyboard at random. Gaming mice like the ones from Razer or SteelSeries also present themselves to the OS as a keyboard, therefore it is possible that the game will pick your mouse as the keyboard device and you have no keyboard input at all.

The workaround is simple in theory: make sure that only the keyboard you want to use is plugged in while starting the game (from the UPlay interface). In practice this is problematic in case you want to play with an external USB keyboard on a MacBook: you cannot unplug the internal keyboard. Luckily there is a way to disable the built-in keyboard on a MacBook Pro as reported on the MacRumors forums. The following console command will unload the kernel extension that drives the keyboard:

sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext

(Ignore any errors that may appear.) The following command will re-enable it:

sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext

Obviously you will want to put these commands into scripts to make your life easier.

In case you have a gaming mouse and a Mac with no built-in trackpad, you will need to either launch the game by navigating the UPlay game launcher by keyboard, or you can quickly unplug the mouse right after having clicked the “Play!” button. It suffices that the keyboard you want to use must be the only keyboard-like device at the moment the game is booting. After the menu screen has appeared, you can plug in anything at leisure. One consequence of all this, is that you will not be able to use fancy keyboard macros with a gaming mouse.

By the way, the only way to play AC II in OS X without getting horribly frustrated by the mouse controls, is to use a high DPI gaming mouse, disabling all acceleration, and setting the X&Y sensitivity in the game's setting to minimum. Let's all thank Ubisoft for adding a bit of extra challenge to their games! (not)

Friday, 15 March 2013

Watch Phones, Smartwatches, and the iWatch

Recently some rumours about an Apple “iWatch” have popped up, and many people thought the idea of an internet-enabled communication device on one's wrist is something novel. Not really: so-called watch phones have existed for more than ten years. Of course, the first ones were clunky and barely went beyond prototype stage, but there have been widely available and quite usable watch phones for more than five years. Most of them originate from China, and can be bought in various places for reasonable prices. My main cell phone has been a watch phone since June 2008.

The main problem with pretty much every watch phone that currently exists however, is that it severely lacks in a certain way. And for some reason, whenever a manufacturer produces a new model that improves upon certain features, it gets worse in other features — I dubbed this “the law of conservation of suckiness”.

In a new article on my site, I shortly discuss the history of watch phones, what is good and bad about past and current models, why the concept of smartwatches that need a smartphone makes no sense from an economical point-of-view, and last but not least: a concept of a watch phone which I believe could become popular, and which I would really like to see manufactured in the near future.

One of the biggest problems is that whenever I tell someone that my watch is also a phone, they will immediately ask if it isn't uncomfortable to make calls with it and if I need to hold my arm in silly poses. The answer is: no. Yet, most current models do effectively suffer from this problem. My proposal contains a solution to get rid of this misconception. Watch phones will not become a commercial success as long as people have this Knight Rider-inspired mental image about them.

Uurwerktelefoons, Smartwatches en de iWatch

Recent zijn er geruchten over een Apple “iWatch” opgedoken, en velen dachten dat het idee van een communicatietoestel met internetverbinding dat op de pols gedragen kan worden baanbrekend was. Niet echt: zogenaamde watch phones of uurwerktelefoons bestaan al langer dan tien jaar. Natuurlijk waren de eerste modellen lomp en kwamen nauwelijks voorbij het prototypestadium, maar sinds vijf jaar zijn er wijd verspreide en behoorlijk bruikbare uurwerktelefoons. De meeste hiervan komen uit China, en kunnen op verschillende websites gekocht worden aan democratische prijzen. Sinds mei 2008 was mijn GSM voor dagelijks gebruik een uurwerktelefoon.

Het grootste probleem met elk model uurwerktelefoon dat nu bestaat is echter dat het zwaar tekortschiet op een of meerdere gebieden. En om een of andere reden vinden fabrikanten het nodig om telkens ze iets verbeteren aan een nieuw model, het te verslechteren op andere gebieden. Ik heb dit “de wet van behoud van onbruikbaarheid” gedoopt.

In een nieuw artikel op mijn website geef ik een korte geschiedenis van uurwerktelefoons, beschrijf ik de goede en slechte punten van vroegere en huidige modellen, waarom het idee van smartwatches die een smartphone nodig hebben om te werken op niets slaat, en tenslotte: een concept voor een uurwerktelefoon waarvan ik geloof dat hij wél populair zou kunnen worden, en waarvan ik hoop dat iemand hem kan produceren in de nabije toekomst.

Een van de grootste problemen is dat telkens ik iemand vertel dat mijn uurwerk ook een telefoon is, zij ogenblikkelijk vragen of het niet oncomfortabel is om te bellen en of ik mijn arm niet in een idiote pose moet houden. Het antwoord is: nee. Desondanks lijden de meeste huidige modellen effectief onder dit probleem. Mijn voorstel bevat een oplossing om dit misverstand uit de weg te ruimen. Uurwerktelefoons zullen nooit een commercieel succes worden zolang mensen er dit door Knight Rider geïnspireerde idee over hebben.

Monday, 4 March 2013

Transmission-daemon: never set peer limit to 0

In older versions of Transmission(-daemon), it was possible to set ‘peer-limit-per-torrent’ to 0 in settings.json, which would supposedly mean “unlimited number of peers”. A few versions ago however an industrious programmer found it necessary to make the limit literal and suddenly the “0” really meant “zero peers”. This caused Transmission to sit there, doing nothing, without giving any hints. It took me quite a while to figure this out. Even just a small warning in a log would have saved me a lot of precious time, dear developers…

Transmission-daemon: zet de connectielimiet nooit op 0

In oudere versies van Transmission(-daemon) was het mogelijk om ‘peer-limit-per-torrent’ op 0 te zetten in settings.json, wat dan zogezegd “onbegrensd aantal connecties” zou betekenen. Een paar versies geleden echter vond een ijverige programmeur het nodig om de limiet letterlijk te nemen en “0” betekende plots echt “nul connecties”. Dit zorgde dat Transmission op zijn gat bleef zitten niksen zonder een hint te geven waarom. Het heeft mij behoorlijk wat tijd gekost om hierachter te komen. Zelfs maar een simpele waarschuwing in een log had wat van mijn kostbare tijd kunnen redden, beste programmeurs…