This video belongs to the openHPI course Wie programmiere ich meinen ersten Mini-Computer?. Do you want to see more?
An error occurred while loading the video player, or it takes a long time to initialize. You can try clearing your browser cache. Please try again later and contact the helpdesk if the problem persists.
Scroll to current position
- 00:00In today's lesson. we're doing a stakeout for
- 00:03build your flowers so that no longer has to dry up.
- 00:06For this you need your ESP32 microcontroller, the
- 00:10Plug-in board, the Soil moisture sensor, 3 jumper cables
- 00:15and a plant. The Jumper cables are needed, because
- 00:18you have to connect the cables to the Soil moisture sensor not so in
- 00:21plug in the plug-in board because there are no pins.
- 00:24are on it. The structure is super fast, because
- 00:28you only need the three pins of your Soil moisture sensor with
- 00:31extend the jumper cables and then into the plug-in board
- 00:33I have to put it in. Use for this we 3.3V and GND to get the
- 00:38Sensor with current to and pin 13 to supply the
- 00:41to read the values. The Soil moisture sensor plugged in
- 00:44you then into the earth of your plant.
- 00:47It's the same with us. Now, we want to remove the moisture
- 00:50of the earth and dependent on the of which the built-in
- 00:53LED of the microcontroller light up, if the
- 00:57plant needs water.
- 00:58Then we know about it. can water the plant.
- 01:02We want the LED only glows when the plant is
- 01:05water required, therefore we use the Logic block.
- 01:09with a suitable
- 01:10Condition to create a branch.
- 01:13To set the values of the soil moisture sensor
- 01:15to experience, we use the block "read analog" for pin 13.
- 01:20There we expect Values from 0 to 4095. Now.
- 01:26you can decide for yourself, when your flower was watered
- 01:29should be. One high value means that
- 01:32the earth is dry. We now specify that all
- 01:35Values above 4000 "too dry". and switch the LED on.
- 01:40As a reminder: The Build-In LED goes on when we
- 01:44set them to LOW. Now we turn the LED on yet
- 01:48if we don't water it. I have to. Then we lay
- 01:52for 100 milliseconds a We'll take a break, since we're going to
- 01:55not ask so often I have to. Ten times a second
- 01:59is quite enough. Now you can already see from afar
- 02:05to see if you're gonna be you should be watering. Besides
- 02:08we show you in a later lesson about how you can
- 02:12the values online in a Display diagram
- 02:14and so also on vacation
- 02:16always know how your plants are.
- 02:20Here you can you can check our plant monitoring
- 02:22in action. as soon as the water humidifies the earth
- 02:25has made enough, the LED off and on again,
- 02:28when the earth is too dry will be. We have the reflection
- 02:31the LED on the flower pot with a red dotted
- 02:34circle, because at our recording a Jumperkabel
- 02:37the LED's a little obscured. The project can be
- 02:40of course also with a Extend the water pump by
- 02:43the plant automatically to irrigate. A peristaltic pump
- 02:46is suitable for Example very good. Then you must
- 02:49you don't have to do it yourself anymore. water.
- 02:52It can also be used in this project to problems are coming. For example
- 02:57you don't have to take use serial monitor
- 03:00while you're watching the LED you want to light up.
- 03:03We had in the lesson to the pins that
- 03:07the pin, which is connected to the LED is connected, actually, for
- 03:11serial communication is meant to be. Through the
- 03:15USB connection, also universal Serial Bus, this data will be
- 03:20then in the serial monitor is displayed. So if you're gonna
- 03:25the values from the sensor with View the Serial Monitor
- 03:29you shouldn't want to be simultaneously control the LED.
- 03:32And the other way around. you want to control the LED,
- 03:36you should be able to see the blocks remove the messages, send them to
- 03:40send the computer.
- 03:42This ends week one. Next week, we'll be launching
- 03:46then with an overview about different
- 03:48Types of engines.
To enable the transcript, please select a language in the video player settings menu.