Activity No. 14: optimize the growth of your plants (Starter kit Vittascience)

Combine the light sensor and the screen with the NUCLEO-L476 board

Assembly of components

Light is an essential element for plant growth. How do you know if your plant is placed correctly to prevent it from withering? 

Here is the connection to make the light detector for your plants: 
- Connect the Shield Grove to the connectors on the card. 
- Connect, using the Grove cable, the screen to one of the ports named I2C available.
- Connect the light sensor using the Grove cable to one of the analog ports. We will choose port A2.


luminosite-EN

Programming

Now let's get to programming! 

The program we are going to create will measure the light received by the plants and display a message on the screen to tell you that they need to be exposed to more light. 

We are going to use several blocks:
- "if...then...else if....then" available in the Logic of the block locker. 
- " [LCD] display text ... on line 0 position 0 ", available in the Display of the blocks locker to manage the screen.
- "[Light sensor] luminosity on pin A2", available in the Sensors, to retrieve the value of the module.


the luminosity value is less than 300 then
- display the text "I am" on line 0
- display the text "too much in the shade" on line 1
- otherwise
display the text "I tan well!" on line 0
- wait 1 second
- clean the screen



Use the following interface to create the program: 



Launch the simulator to check the correct execution of your program or upload it to the card. 

You succeeded ? Perfect, you now know how to program a system to improve plant growth using your NUCLEO-L476RG board! 
Discover the other activities of the Starter kit by clicking on the icons below.

ترخيص المستخدم

لم يعلق أحد حتى الآن