Skip to main content

Project 2: Measuring Light

  • Chapter
  • First Online:
Windows 10 for the Internet of Things
  • 656 Accesses

Abstract

The projects that you’ve encountered thus far have used GPIO pins to turn LEDs on or off. But what if you wanted to control the brightness of an LED? Given that you can only turn pins on (high: 3.3V) or off (low: 0V), you have no way to send less power to the LED; the lower the power, the dimmer the LED. If you consider solutions (or features) of devices that are sensitive to ambient light—such as a backlit keyboard—you may have noticed it changes brightness as the room becomes darker. In this project, you’re going to explore how such a feature works. That is, you’re going to build a fancy LED nightlight.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    See https://en.wikipedia.org/wiki/Photoresistor.

  2. 2.

    Creative Commons Attribution-Share Alike 3.0 Unported License.

  3. 3.

    There are other ways to do this, but this uses a technique you’ve seen previously.

  4. 4.

    This pattern of ever-increasing complexity continues in the next chapters—so strap in and hang on!

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Charles Bell

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Bell, C. (2021). Project 2: Measuring Light. In: Windows 10 for the Internet of Things. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6609-0_11

Download citation

Publish with us

Policies and ethics