Professional Documents
Culture Documents
Project 03 Birthday Gift
Project 03 Birthday Gift
1. Introduction:
Under the weak light , the yellow robot will play a birthday song and
blink its LED; however, it won’t play music and blink its LED under the
strong light. Light and music can vary with light intensity! In this project,
2. Photoresistor
This photoresistor sensor integrates the LEGO building block and Easy
Plug port, which can be fixed on the yellow robot flexibly. Only a blue
cable needed can interface it with the yellow robot. You are free from
module, etc.
www.kidsbits.cc
kidsbits
It mainly uses photoresistive elements and changes with light intensity.
3. Parameter:
Port:EASY plug
Working Voltage:DC 5V
4. Components:
www.kidsbits.cc
kidsbits
When the ambient light is weak, LED will flash and the yellow robot will
play songs.
When the ambient light is strong, LED will be off and the robot won’t
play music.
detected result, the light intensity value is between 700 and 750. Then
When light intensity is between 700 and 750. When covering the
photoresistor, the detected value gets small. If the value is less than 700,
If you the intensity is not less than 700, LED will be off and robot won’t
play music.
www.kidsbits.cc
kidsbits
5. Connection Diagram:
Note: the LED module is interfaced with D12 and the photoresistor
6. Preparation:
(1) Slide the Bluetooth switch under the yellow robot to OFF end
(2) Interface the yellow robot with a computer via a USB cable.
www.kidsbits.cc
kidsbits
7. Test Code:
You can drag blocks to edit. Blocks listed below are for your reference
(1)
(2)
(3)
www.kidsbits.cc
kidsbits
(4)
(5)
Complete Program
www.kidsbits.cc
kidsbits
www.kidsbits.cc
kidsbits
8. Project Result
Slide the Bluetooth switch to OFF end, click to upload the code
to the yellow robot successfully, the robot will blink its LED and play
www.kidsbits.cc