Ambient Light Sensors

An ambient light sensor is a little light-to-frequency chip that you’ve certainly got in your tablet, most probably in your phone and you might even have one in your laptop if you’re lucky. Ambient light sensors let us change the panel brightness in small ways so that you can still see your screen when it’s sunny outside, but we can dim it down when the ambient room light is lower to save power. Lots of power.

There is a chicken and egg problem here. Not many laptops have ambient light sensors; some do, but driver support is spotty and they might not work, or work but return values with some unknown absolute scale. As hardware support is so bad, we’ve not got any software that actually uses the ALS hardware effectively, and so most ALS hardware goes unused. Most people don’t actually have any kind of ALS at all, even on high-end models like Thinkpads

So, what do we do? I spent a bit of time over the last few weeks designing a small OpenHardware USB device that acts as a ALS sensor. It’s basically a ColorHug1 with a much less powerful processor, but speaking the same protocol so all the firmware update and test tools just work out of the box. It sleeps between readings too, so only consumes a tiiiiny amount of power. I figure that with hardware that we know works out of the box, we can get developers working on (and testing!) the software integration without spending hours and hours compiling kernels and looking at DSDTs. I was planning to send out devices for free to GNOME developers wanting to hack on ALS stuff with me, and sell the devices for perhaps $20 to everyone else just to cover costs.


The device would be a small PCB, 12x22mm in size which would be left in a spare USB slot. It only sticks out about 9mm from the edge of the laptop as most of the PCB actually gets pushed into the USB slot. It’s obviously non-ideal, and non-sexy, but I really think this is the way to break the chicken/egg problem we have with ALS sensors. It obviously costs money to make a device like this, and the smallest batch possible is about 60 – so before I spend any more of my spare money/time on this, is anyone actually interested in saving tons of power using an ALS sensor and dimming the display? Comment here or email me if you’re interested. Thanks.

Published by


Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

38 thoughts on “Ambient Light Sensors”

  1. Most devices have cameras; would it be possible to use those to fake an ALS, or would the power draw be too much?

    1. I actually tried doing that about 8 years ago. Long story short; cameras are bad because they use lots of power, you have security concerns about the webcam LED being on all the time, you can’t use the webcam without asking the backlight to stop updating and the fact that a lot of webcams have brightness auto-contrast set in hardware.

  2. I basically never touch brightness, even though I know I would probably get better battery life if I did. I’d love to have one of these. $20 is fine.

  3. How much power will the USB device use, and will it support USB autosuspend? :)

    More seriously: I’d like to use my existing ambient light sensor for brightness control, but I can’t in all honesty say that I’d buy a USB device to do so.

    1. That’s actually quite hard to answer, as the device spends 99.9% of the time in a suspend mode, but I would expect it to be no more than couple of mA, and perhaps 20mA with the debug LED turned on.

  4. I guess it would not be possible to utilize this in a desktop computer, or is there a way to dim a desktop display connected over HDMI?

    1. Yes and no. The problem is that it’s not very well standardized, so on my panel a specific command might set my brightness 10% lower, on yours it might turn the contrast up to max.

  5. This wouldn’t work for desktop machines with external monitors, would it? It would be nice if my desktop machine could turn down the brightness late in the evening automatically.

    1. You could put it on an usb extension cable or in a hub (ideally the display would have one).

      I would definitely want one for 20$.

  6. Hi hughsie, we just launched a start-up aimed at providing low cost, low volume assembled PCBs that would be perfect for the type of manufacturing you are talking about. The entire process is self service at Don’t hesitate to email me either!

    Project looks awesome and I would like to try it out.

  7. Does it just detect light or can it tell you the colour as well ?

    Either way, I could imagine this being used for arts/hobbiest type projects by people with raspberry PIs.

    1. Heh, well, it would actually tell you the color too, although with not a lot of accuracy. The color filters in the chip used are really sensitive to the angle of the light (typical for inexpensive sensors), but should be good enough for “red” or “green” detection.

  8. In which materials will be made the case?

    Do you plane to have different models? (Plastic or aluminum, red, blue, …)

    1. For a $20 RRP, that leaves a $10 materials budget, of which $9 is taken by the 7 components at 100 quantity and the PCB. That leaves just over 1USD for the case, which includes all the milling and optical guides. At the moment I’m thinking of just using transparent heat shrink tubing; better ideas welcome.

  9. I’d be in for one @ $20. If you get enough formal preorders, might it be possible to do a larger batch size and drop the price? @ $15, I’d probably spring for 2.

    1. I’m having trouble keeping it under £15, let alone $15. The first set of PCBs have come back wrong (communication issues with the supplier, both my fault and theirs), so I’m having to pay some more and wait for another panel. At £300 for just one panel RNE is an expensive game.

Comments are closed.