keyestudio
Share your creative ideas with us here
By ran | 27 June 2024 | 0 Comments

HOW to Detect Ambient Light with Microbit

Overview

This lesson is a little bit similar to the previous illumination test by a photocell. But this time we will use keystudio TEMT6000 light sensor whose sensitivity is better than a photocell. You will learn how to use a TEMT6000 sensor and micro:bit to test the ambient light. Show the analog value on the micro:bit LED matrix or on the CoolTerm monitor.

Component Required

  • Micro:bit main board*1

  • Keyestudio Micro bit Sensor V2 Shield*1

  • USB Cable*1

  • TEMT6000 Ambient Light Sensor*1

  • DuPont jumper wire*3

  • Premium Battery Holder 6-cell AA*1

  • 1.5V AA Battery*6

Component Introduction

TEMT6000 Ambient Light Sensor:

This TEMT6000 light sensor is mainly composed of a high visible photosensitive light (NPN type) triode. It can capture the tiny light changes and magnify it about 100 times, which is easily recognized by the microcontroller for AD conversion.

Its response to visible light illumination is similar to that of the human eye, so it can judge the intensity of ambient light. But note that it does not react well to IR or UV light.

This sensor is available for friendly interaction applications.

Connection Diagram

30

Test Code

Img

Test Results

Wire up components,plug in external power and transfer code to micro:bit. Open CoolTerm, click Options and select SerialPort, set COM port and baud rate(115200). Click OK and Connect.

The CoolTerm shows the light intensity,the stronger the light intensity, the larger the analog value, as shown below:

 

Leave a Reply

Your email address will not be published.Required fields are marked. *
Name
E-mail
Content
Verification code