Page 91 - Robo_Genius_V1.0_flipbook_C4
P. 91

Concept


                 A light  sensor  on  the  Micro:bit  can  measure  the  amount  of light  in  the
                 environment. By using the Micro:bit’s light sensor, we can control the movement
                 of a servo motor based on how bright or dark it is. For example, when the room

                 is bright, the servo motor might move to one position, and when it is dark, it
                 could move to a different position. This kind of control is useful for devices like
                 automatic window blinds that open when it is sunny or close when it gets dark.


                 Observations


                 After  setting  up  and  running  the  code  to  control  the  servo  motor  with  the
                 Micro:bit light sensor, the following can be observed:

                 1.  In a bright room (lighter): The servo motor moves to 180 degrees. This
                    simulates the motor responding to higher light levels, like opening blinds

                    when it is sunny.

                 2.  In a dim or dark room (less light): The servo motor moves to 0 degrees.
                    This shows the motor responding to low light levels, such as closing blinds
                    when it gets dark.

                 By varying the light levels in the environment, you can observe how the servo

                 motor changes its position, demonstrating how the light sensor can be used to
                 control the movement of a motor automatically based on light intensity.


                 Application

                 A light  sensor  is used  in  solar  garden

                 lights.  During  the  day,  the  light  sensor
                 detects sunlight and keeps the lights off
                 while charging the battery. When it gets

                 dark, the sensor notices and automatically
                 turns the lights on. This way, the lights
                 only  turn  on  at  night, helping  to  save

                 energy and keeping gardens or paths lit.














                                                                             Basic Motor Control and Sensors  89
   86   87   88   89   90   91   92   93   94