Skip to content

활동

Energy light meter

고급 | MakeCode, Python | LED, 버튼, 빛 센서 | 13 날씨, 변수, 센서, 입력/출력

1단계: 만들어 보세요.

프로젝트 소개

The first of three projects to find out about energy use in your home or school by measuring how much light you use.

This light meter will help you measure how light levels vary around you when lights are turned on and off and find the best location to place the light timer in the next project.

학습 내용

  • How to take readings from the micro:bit's sensors and store them in a variable so that you can repeatedly view the same reading even after conditions have changed
  • Find locations for recording reliable environmental data

사용방법

  • With the lights turned off, place your micro:bit where you want to take the light reading, and press button A.
  • Move the micro:bit so you can see its display easily, and press button B to see the light level reading. This will be a number between 0 (dark) and 255 (the most intense light the micro:bit can measure) .
  • You can press B again if you're not sure of the reading.
  • Turn the lights on and make another measurement by pressing A again, then press button B to read the number.
  • Find a place where there is a big difference between the readings when the lights are off and on. Away from a window where daylight might come in, and closer to the electric light source would be best. A cupboard would be ideal, if it has electric lighting.
  • Take a few readings and find the average of the readings when the light is turned on. You'll need this number for the next project, the Energy light timer.

설명

  • The program uses a variable called reading to store the light level. It sets this at the start and whenever you press button A.
  • Storing the light sensor reading in a variable, rather than just showing it straight away, is a good idea because it means you can view the reading over and over again when you note it down.
  • Using a variable also means you can take a light reading in a place where it might be difficult to see the display and view the light measurement in a more convenient place.

준비물

  • micro:bit (또는 MakeCode 시뮬레이터)
  • MakeCode 또는 Python 편집기
  • battery pack (recommended)

2단계: 프로그래밍 해보세요.

3단계: 더 좋게 만들어 보세요.

  • Modify the code to calculate an average reading for you.
  • Add a second micro:bit and radio functionality to allow remote reading of light levels.
  • If you have access to a light meter that measures light levels in other units, compare the micro:bit's readings with it.
  • Use the light meter readings to make a timer to record how long lights are left on.