In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Python how to achieve automatic flower watering system", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "Python how to achieve automatic flower watering system" bar!
1. System function
Monitor soil moisture, ambient temperature and light intensity
Automatic watering according to the current environment, automatic heating of soil in cold weather
two。 Required components
1 TPYBoard board
Photosensitive module 1 block
DS18B20 module 1 block
Soil moisture detection module 1
Some DuPont lines
2 relays
3. Connection mode
After the wiring is finished, import main.py, boot.py, ds18x20.py and onewire.py into TPYBoard v102 drive letter to run. Automatic watering experiment code
5. source code
From pyb import Pin, ADCfrom ds18x20 import DS18X20 gl = ADC (Pin ('Y12')) # 300Light-1700 Dark sd = ADC (Pin (' Y11')) # 1800 dry-800Wet wd = DS18X20 (Pin ('Y10')) ks = Pin (' Y9rays, Pin.OUT_PP) jr = Pin ('Y8lighting, Pin.OUT_PP) while True: print ('\ t Light intensity:', gl.read (),'\ t soil moisture:' Sd.read (),'\ t current temperature:' Wd.read_temp () pyb.delay (200) if gl.read () 800: # multiple watering ks.value (1) else: ks.value (0) elif gl.read () > = 1300: # insufficient sunshine if sd.read () > 1200: # less watering Ks.value (1) else: ks.value (0) else: # Sunshine General if sd.read () > 1000: # normal watering ks.value (1) else: ks.value (0) if wd.read_temp ()
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.