Do beeswax candles produce negative ionisation? Nope.

This short note is heavily based on Are Ions Good for You, a beautiful exposition of the actual science of ionisation and pollution of the air.

There are lots of claims around the internet, mostly by beeswax candle makers, that beeswax candles are “natural ionizers”. The theory goes that beeswax candles emit “negative ionisation” which spreads through the room and causes pollutants and allergens to bind together because, apparently, those things are positively charged. No source or explanation is ever provided, and I very much believe that’s because the claim is bogus.

First of all, one of the most fundamental tenets of the laws of physics is conservation of charge. The creation of every negatively charged ion must be accompanied by the corresponding creation of a positively charged ion. If the candle is producing just negative ions, where are all these positive ions going? They’re either being emitted as well (thus completely defeating the purpose of increasing the ratio of negative charges in the air) or the candle itself is going to end up with an enormous positive charge (which will attract and neutralise any negative ions in the air, again defeating the purpose). It’s just impossible for a candle to simply release negatively charged ions and have that be the end of the story. End of story.

OK, so let’s just assume, for the sake of argument, that candle do somehow add negative ions to the atmosphere. Is this good? According to a series of papers published by Krueger et al. between 1957 and 1963, negative ions help the airways in the lungs to clear. However, in 1971, Andersen’s book Mucociliary Function in Trachea Exposed to Ionized and Non-Ionized Air proved these claims to be false. Not only did he carefully identify the flaws in the earlier studies, he performed a large experimental study under very controlled conditions that demonstrated that there is no relationship between ion concentration/polarity and the performance of the airways of the lungs. Despite the earlier papers being debunked, they are still referenced to this day in a show of stunning confirmation bias.

It gets worse. New ion pairs (that is, one negative and one positive) are created in the air continuously due to radioactive decay and cosmic radiation, at a rate of 5–10 ion pairs per cubic centimeter per second. These ions are continuously recombining, as they are attracted due to the opposite charges. A high level of pollution will turn most of the ions into charged particles, or heavy ions, but with no preference for either polarity. Since the 1930s, it has been known that the attachment coefficients for negative and positive ions attaching with aerosol particles are almost the same, resulting in a population of aerosol particles divided more or less equally between negative, positive, and neutral particles. This is true with moderate pollution levels. With very high aerosol concentrations, there are not enough ions to charge the aerosol particles, and the neutral particles will dominate.

Again, this measured, controlled science completely conflicts with the claims on the beeswax store pages. Where does this claim that all the pollutants are positively charged come from? How does that claim even make sense?

It’s worth noting that hot flames do create ionisation, albeit balanced positive and negative charges (as demanded by basic physics). This only happens to an appreciable extent in flames over 1500°C; candle flames are closer to 1100°. Furthermore, the ions rapidly recombine as they leave the flame, there’s no way the candle in the corner of the room can have a significant effect on the constant generation and recombination of ions happening in the rest of the room.

Also, in defence of candles, they are little miniature incinerators that draw fresh, possibly dusty and polluted air up into the flame. It stands to reason that these pollutants will be turned into harmless CO2 and H2O. But I’ve failed to find any evidence that this effect has any noticeable effect on pollution levels, nor any explanation why beeswax candles would be particularly good at this. Surely if this were true, there would be scientific papers confirming this, and the beeswax candle makers would be the first to proudly reference this research. These claims are much easier to test than the ionisation claims. But instead, they implicitly reference papers from the 1950s that have been well and truly debunked and disproven.

I’ve nothing against beeswax candles themselves. If you buy locally sourced beeswax candles, you’re going to get something that smells nice, (apparently) lasts much longer, doesn’t have a huge ecological cost, and your money is going to a beekeeper instead of an overseas petrochemical conglomerate. Heck, they’re even sustainable probably. All of these plus points make it all the more puzzling that they overreach to these absurd ionisation claims.

Extraordinary claims demands extraordinary evidence. The online stores that expound upon the beeswax candle’s special ionisation properties are all extraordinary claim and zero extraordinary evidence.

Have I missed something? Do you think it might be possible that beeswax candles have special ionisation properties? Have you got evidence? Let me know what you think in the comments below.


Using MOSFETs as blocking diodes

Connecting a battery backwards to an electronic circuit can rapidly do a lot of damage — current will flood through (and destroy) many integrated circuits when powered up the wrong way, and electrolytic capacitors have a famous tendency to explode. For this reason, it’s common to use a blocking diode in a circuit to provide reverse polarity protection:


If the battery is connected correctly, as shown, current flows through the diode to the circuit, and the circuit operates normally. If the battery is reversed, the battery tries to pull current through the diode the wrong way, and the diode refuses to conduct — protecting the load from damage.

Find out the disadvantages of this circuit, and how to do better…


XKCD’s ‘Click and Drag’ comic in Google Maps form

I just threw together a zoomable view of xkcd’s latest comic using the Google Maps API and US$0.27 of Google App Engine quota: Click and Drag. It helps to find some of the more off-the-beaten-track easter eggs, view it here!

If I get enough (i.e., any) interest, I will clean up the source code and make it available.


Deriving magnetism from electrostatics and relativity

Imagine a world where there was no magnetism at all — just electrostatic forces. It turns out that by adding Einstein’s laws of special relativity to that world, and looking at the effects that special relativity has on moving charges, the laws of magnetism appear — just by mashing electrostatics and relativity together.

In other words, the moving electrons in an electric motor’s coils see the world from a different frame of reference to the copper atoms making up the windings of the motor — and this imbalance is what makes the motor turn!

There’s a bunch of stuff around on the internet on this, but I find it hard to process because it deals with general relationships between magnetic and electric fields, not specific examples. I’m sure this is actually very general and useful, but it’s also beyond my immediate understanding as well. So, I tried approach the problem in my own way using just special relativity and high-school level physics, and it works!

See how it’s all connected…


Automatic vs Manual transmission cars

Don’t worry, this post is not advice on how to live your life. Actually, on second thought, it is. Well, no, not really, it’s mostly about cars. And life.

Maybe I should start off with my main point:

Things which are “easy-to-use” often come with hidden drawbacks.

Some examples:

  • Point-and-shoot digital cameras (vs Digital SLR cameras) – Due to their larger sensors, SLR cameras can give much sharper images and more beautiful out-of-focus backgrounds. As well as much better performance in low-light situations, and more versatility with a variety of lenses. However, the compact size and low cost of point-and-shoot cameras make them a perfectly valid choice for casual photographers.
  • Automatics cars (vs manual cars) – Unlike point-and-shoot cameras, there is no valid reason (special circumstances aside) I can think of or find that justifies wanting a car with an automatic transmission – if you’re blessed with two legs.

At this point, I’m going to drop the illusion of making a general argument about “easy things” and just rant about automatic cars instead.

What’s the actual difference between auto and manual?

Find out…


Where’s the North Pole on Google Maps?

I’ve seen several posts on the internet asking about the North Pole on Google Maps: where is it? Why isn’t there any snow there? Where’s Santa’s house?

There’s a couple of reasons why the ice around the North Pole is not shown on Google Maps.

Find out why…


The Galaxy Nexus PenTile display: a reasoned take on the debate

There has been a lot of discussion on the ‘net about the infamous PenTile display. Lots of sites are throwing numbers around, comparing the ‘subpixel resolution’ of competing phones such as the Galaxy Nexus and iPhone 4/4S. Some commentary has been insane, comparing apples with oranges and declaring PenTile an abomination regardless of resolution. Others, like this one, are a lot more reasoned, but still seem to ignore the well-proven fact that the eye’s visual acuity depends on the colour in question. Let’s rattle off a couple of undeniably true facts:

  1. Hypothetical 1000ppi RGB and PenTile displays can both look absolutely sharp and perfect.
  2. The acuity of the human eye varies significantly between colours. Acuity is particularly poor with blue light.

Take the following example: these four squares consist of fine lines. From left-to-right, they are: #1: white/black, #2: red/cyan, #3: green/magenta, and #4: blue/yellow.

Stand well back from your monitor, until you can’t tell the lines apart. Now slowly move back in. Notice how the blue/yellow (#4) lines look almost the same as white/black (#1), and red/cyan (#2) look very similar to green/magenta (#3)? Very roughly speaking, this is because our eyes smear out blue light slightly, so we can’t tell the difference between white lines (yellow+blue), or alternating yellow and blue lines. Similarly, the only difference between red/cyan and green/magenta is where the blue lies.

I started this not-terribly-scientific experiment with the “hypothesis” that the eye had a higher acuity to green than red and blue. This is apparently the reason that is used to justify PenTile’s use of twice as many green subpixels as red or blue. However, although my pictures above suggest that green is more visible than blue, my eyes are more-or-less equally acute with respect to red and green light. This is backed up by at least one actual proper study, as well. [Interestingly, the original PenTile technology was RRGGB, which makes much more sense!]

So, we can conclude that the resolution of red subpixels might be the limiting factor for an RGGB “Retina” PenTile display, whereas the resolution of green subpixels might be the limiting factor for an RGB Retina iPhone 4 display. Comparing the two of these numerically is very difficult and highly subjective. The sharpness with which the eye can see these colours is different, and even this difference varies according to the brightness of the image, and the individual. To see numbers calculated with no apparent regard to these factors and presented to five significant figures is just laughable.

The closest you can come to a meaningful comparison is stating what sort of displays would be equivalent if green sub-pixel resolution was all that mattered, and what would be equivalent if red/blue sub-pixel resolution was all that mattered. The linear green sub-pixel resolution is the same for both RGB and PenTile displays, because both feature full green sub-pixels. The linear red/blue sub-pixel resolution of PenTile is compromised by a factor of sqrt(2), because red pixels are diagonally separated. So, here we go:

The effective equivalent RGB resolution of a 1280×720 PenTile display probably lies somewhere between 905×509 (if red/blue is the limiting factor by far) and 1280×720 (if green is limiting factor by far.) That is, somewhere between the-highest-resolution-ever-seen-on-a-smartphone (except the iPhone 4S by a hair) and the-highest-resolution-ever-seen-on-a-smartphone (by a mile, although some [dirty LCD] RGB 720p devices have been launched since.)

And we’ve come all this way without mentioning display size. The bigger the display, the bigger the font can be and the further you can comfortably hold the device from your eyes. A bigger display should therefore mean a lower linear resolution limit before the display be reasonably considered a ‘Retina’ display.

The proof of the pudding is in the eating

My conclusion? It is virtually impossible to pre-judge a display that we haven’t even seen before. I would love to hear subjective comments from people who have seen the device in person in Hong Kong; otherwise, I’m not interested.

Continue reading, including simulated images from a 720p PenTile display…


Rattling Nikon MH-18a charger: how to fix/prevent

During my holiday in Thailand, I was silly enough to drop my Nikon MH-18a battery charger on the floor from a height of a metre or so. As soon as I picked it up, I heard a rattle. When I looked inside, this is what I found:

Nikon MH-18a shattered inductor

The core of the inductor had broken into several pieces. The pieces are shown here, below the copper coils of the inductor. Even though inductor cores are made from ferrite, a notoriously brittle ceramic, I was pretty disappointed to see that the charger was so fragile. After failing to find any suitable replacement parts, I decided to figure out what it was for.

What is the inductor’s job? (Don’t care? Skip to ‘How to fix to fix the problem.’)

A reverse-engineered schematic of the mains electricity conditioning part of the circuit is shown below, with the broken inductor core depicted in red:

The flyback converter draws pulses of current at a frequency much higher than the 50 or 60 Hz of mains electricity. The two capacitors and inductor combine to form an LC filter, which prevents this high-frequency energy from leaking back into the electricity supply and interfering with other devices.

What effect does the broken core have?

If you plug in the charger while ferrite fragments are still sitting in the box, all sorts of nasty short-circuits could happen.

Even with the inductor effectively absent, the voltage in the two capacitors is still topped up 100 times per second by the mains electricity supply. The flyback converter should therefore have plenty of energy to run the rest of the circuit with, and the battery charger should still function normally. As mentioned in the previous section, the only issue I can identify is that the current waveform being drawn from the electricity supply will be different and noisier, which may cause interference to other devices nearby, or a slight reduction in efficiency.

How to fix the problem

High Voltage

Do not open the charger while it is plugged in, or if it has been plugged in for the past few hours. Capacitors inside the device are charged to potentially lethal voltages during operation, and may maintain this charge after being unplugged. Do not plug the device in unless it has been completely re-assembled, and test it under close observation at first as overheating/fire are possible with any mains electricity device. Do not open the charger if you don’t completely understand all the points mentioned in this box.

Opening up the charger and removing the shattered pieces should remove loose bits of shrapnel that might have caused short circuits, and leave your charger completely functional — the inductor core is completely unnecessary.

To disassemble the charger, simply remove the sticker on the bottom (which is hiding one of the screws) and undo the two screws. The screws are designed to take a funny 6-point star driver, but fortunately a plain small flathead screwdriver did the trick for me.

How to prevent the core from breaking

If you’re very clumsy, or want to cover all your bases, you may wish to open up your charger and preemptively pot (surround) the inductor with epoxy (e.g. Araldite) or similar. Make sure you pay attention to all the notes in the yellow box above, though.


Orewa college requiring laptops: Good. Recommending the iPad: Bad.

UPDATE (August 2014, 3 years since I published this article): I hate to brag, but I told you so…

There’s been a story going around the media about Orewa college adding laptops to its compulsory stationary list. Furthermore, Orewa college has recommended the iPad as the best ‘laptop’ to use for this purpose, due to its ‘ease of use and long battery life.’ Apart from journalists managing to confuse the two previous statements to invent the headline ‘Orewa college requires iPad on stationary list’, my main gripe is with the specific recommendation of an iPad.

In order to recommend a device, you have to keep in mind what the purpose of the device is. With the points mentioned below in mind, I would love to see the recommendation of an iPad defended in the context of a normal school day.

What’s wrong with the iPad?

For the sake of argument, I’m going to weigh up the Apple iPad ($779) against the Asus Eee PC 1005P ($536).

It’s expensive. With well over $200 separating the two, the iPad has to have some meaningful advantage over the Eee PC to be a sensible recommendation. Those on a tighter budget could go for a Acer Aspire One D255E ($375), which is just as capable as the other two as far as schoolwork is concerned, although it does represent a compromise in terms of battery life.

It’s optimised for anything but schoolwork. Let’s compare the two in the context of some common subjects:

    History — Laptop use would presumably be focussed on accessing web references to research and bolster arguments. No particular advantages either way, just about any device these days can display a webpage.

    English — Research is no different as above, but when it comes to writing essays, the Eee PC has an actual keyboard, whereas the iPad would fall back on a touch-screen keyboard which is much slower and fatigue-inducing to use. Eee PC wins.

    Maths — Pop OpenOffice spreadsheet or GNU Octave (both free software) on the Eee PC and you’re drawing graphs, playing with linear algebra, whatever you like. iPad’s calculator is inferior to a standard calculator that has been in maths class for the past many years. Eee PC wins by a wide margin.

    IT — Software development on an iPad? Apple put up perplexing barriers to software development on their devices, completely barring free experimentation with programming, and knocking out any nascent software engineers before they can even start. Eee PC wins.

    Workshop/electronics/graphic design — Apple iPad? Just ridiculous; unheard of. Windows/Apple PC? Yes; fantastic, free, open source software all over the internet. Eee PC is the only solution worth even considering.

    Wasting time posting facebook updates — Apple iPad is definitely quicker for this one.

In short, the social-network-centric nature of the iPad versus the maturity and popularity of Linux/Windows means that the iPad is just useless for freely exploring the possibilities of computing, programming, mathematics, electronics, graphic design, engineering, etc. Considering that an iPad might replace a desktop PC in the home due to some family’s tight budgets, this seems completely ridiculous.

The iPad is a luxury toy for people who already own a proper computer, and want a fashion item to show off to their friends.

What’s wrong with Orewa college’s purported reasons for recommending the iPad?

According to the story, Orewa college has recommend the iPad due to its “ease of use and long battery life.” Other advantages claimed by Orewa college (at this link) are also covered below.

Ease of use? — The Apple iPad is so easy to use because, as mentioned above, it doesn’t really do anything other than take mediocre photos, display web pages, and a bunch of random games and web services. It’s only hard to get anything wrong on the iPad because you can’t get anything remotely useful done at all.

Battery life? — The Eee PC boasts a battery life of 11 hours, longer than any school day for sure.

No viruses — Anyone who knows anything about computer security knows that this is like saying a ship is unsinkable – extremely ignorant. Also, it’s wrong.

“Abundance of apps!!!!” — There’s a great abundance of “apps” for PCs too…

“Voice recording apps useful!!!” — I can’t believe someone actually wrote this; Windows comes with a sound recorder built in. If you want some fancy program that automatically organises the recordings or whatever, there is going to be some open source software out there to do this for you. The idea that Apple apps are some amazing new idea is astonishing. Yes, it’s new for phones. But PCs have supported software written by anyone since they were introduced in the 1970s.

“Useful for all the family” — This looks like it is just copied-and-pasted marketing gibberish straight from Apple.

What I find so amazing about Orewa college’s list of advantages of the iPad is that it all looks very convincing and exciting, until you analyse the contrapositives – i.e., what they’re implying about PC laptops:

“PC laptops don’t have battery lives of 10 hours.” Wrong, some do.
“PC laptops don’t have cameras built-in.” Wrong, most do.
“PC laptops don’t have auto-update of system software.” Um, yes they do, it’s called Windows Update.
“PC laptops are not useful for all the family.” This one deserves some elaboration to say the least.
“PC laptops don’t have an abundance of freely available apps.” This is just idiotic, as pointed out above.
“PC laptops can’t record voice.” What, is the microphone just for decoration???

Thanks for reading. Do you think I’m being too harsh on the iPad? Let me know in the comments below!


Setting up gmail as a relay host in postfix (without creating certificates)

When your linux box needs to send email (e.g., mail sent by a webpage, cron job output, etc), postfix can normally send the email directly to the recipient. However, if your ISP blocks port 25 outbound, or you want to keep a nice log of all outgoing messages, or want replies to arrive in your gmail account, this may not be ideal. One alternative is to use a Gmail as a relay host, i.e., postfix will basically pretend to be a gmail user, and send all mail through that account.

There are already a number of guides on the internet explaining how to set up postfix to relay outgoing email via Gmail:

These guides are excellent, I wouldn’t have been able to set up my server without them. However, they all demand the creation of CAs and self-signed certificates. If you don’t know what I’m talking about, then you’ve come to the right place! And if you do know what a CA is, then the purpose of this post is to point out that creating one is completely pointless in this case. So I’m proud to announce…

A simplified guide: setting up postfix to relay through Gmail

  1. Add the following lines to /etc/postfix/
    relayhost = []:587
    smtp_use_tls = yes
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    # The following line is optional, but recommended (see below)
    smtp_tls_CAfile = /etc/ssl/certs/Equifax_Secure_CA.pem

    The last line is not necessary for postfix to successfully send messages, but it prevents ‘certificate verification failed’ warnings. I believe the /etc/ssl/certs/ directory is populated by installing OpenSSL.

  2. Place the following in a new file at /etc/postfix/sasl_passwd:
  3. Hide your password, and do some other magic stuff:
    $ cd /etc/postfix   
    $ postmap sasl_passwd          # creates sasl_passwd.db
    $ chmod 600 sasl_passwd sasl_passwd.db
  4. Restart postfix:
    $ service postfix restart      # this varies from system to system
  5. Test:
    $ echo 'It works' | mailx -s 'Test message'

What if doesn’t work — debugging

If you find that the recipient (e.g. doesn’t receive an e-mail, have a look in the log files. They’re located in different places depending on your configuration settings/distribution, but have a look in /var/log/mail.err, /var/log/maillog or /var/log/mail for starters. If the problem isn’t self-evident from looking at these messages, have a look at the official Postfix Debugging Howto for more help — or, leave a comment on this post!

Forwarding emails sent to usernames on your linux box

Utilities (e.g. at, cron, mdadm, etc) often send emails to the user if errors occur. The emails default to username@domain, where domain is the FQDN of the system. If you want these messages to be sent to a different address, create .forward files in the home directory of the relevant users:

# Forward messages for your user
$ echo > ~/.forward      
$ echo 'It works' | mailx -s 'Test message' username

# Forward messages for the root account
$ echo > ~root/.forward  
$ echo 'It works' | mailx -s 'Test message' root

Setting the ‘From’ name

Take with a grain of salt, there’s probably a better way than falling back on the sendmail emulation provided by postfix:

$ sendmail -F 'Name to Appear in From Field'

But wait, if we provide no certificate, will the emails be encrypted? [Optional!]

Yes. The email is encrypted; this can be confirmed with tcpdump. Encryption is accomplished using TLS (see Diffie–Hellman key exchange for an explanation of how two computers can communicate securely with no pre-arranged secrets or certificates.) Certificates are quite separate; they are used to verify whether the Gmail server is really the Gmail server, not some imposter. Of course, certificates and encryption are easily confused, as they’re always found together — there’s no point preparing a secure, encrypted channel to an imposter.

So, Gmail provides the certificate; and postfix can verify the authenticity of this certificate using file provided via smtp_tls_CAfile in step 1 above. The connection is then secured. Postfix then proves its identity using the plain old username and password (which is pretty much the only identity proof that we have at our disposal as a mere Gmail user) and the emails can be sent.

But why does postfix have configuration options to accept certificates and keys? What about configuration options starting with smtpd_ ? [Optional!]

The server/client distinction is very clear cut with many protocols, like HTTP — the web browser is the client, the web host is the server. Postfix is not so straightforward, because it acts as a middle-man — it’s a server when its receiving mail from the outside world, and then it’s a client when it relays that mail towards its final destination. So, postfix can be thought of as an SMTP server (smtpd) and client (smtp) combined. The configuration options are divided into smptd_* and smtp_* accordingly.

If we wanted our postfix server to accept mail on a secure connection from other computers on the network, and provide a certificate proving its authenticity to these other computers, then this is when these other options would become useful. But because we’re only accepting mail from localhost (for now), these options are completely irrelevant.