Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make a flower watering system with raspberry pie

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about how to make a flower watering system with raspberry pie. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Raspberry pie flower watering system is unified and functional:

Can be used for watering flowers, etc.

Second, hardware requirements:

Raspberry pie 3b, DuPont line (male to female) several, a bread board, a 1-way relay, a power pump, pvc water pipe, washbasin + plastic bucket

3. Language:

Python 2.7 +

Fourth, principle:

Raspberry pie control relay, relay control pump work.

(the python program sends high or low levels to the raspberry pie gpio, controls the relay to close and turn on, and indirectly controls the pump to work.)

Line connection 1, raspberry pie and bread line

You can click the following two pictures to familiarize yourself with the knowledge of raspberry pie 3b pins.

Raspberry pie wiring:

1. The red wire is connected to the second pin in the lower row (leading to 5v voltage), and the other end is connected to the positive pole of the bread plate.

2. The black wire is connected to the third pin in the lower row (leading to the 0v ground wire), and the other end is connected to the positive pole of the bread plate.

3. The green wire is connected to the 11th pin in the lower row (general input and output cable), and the other end is connected to the bread board abcde (do not connect to fghij, the line is blocked) any row or column.

2. The way to connect the relay with the bread plate

First look at the following two pictures to understand the next relay connection (we use the first constant start connection)

Relay connection (red connection vcc, input voltage 5v; black wire connection GND ground wire 0v voltage; green wire connection IN, signal input wire)

The red wire is connected to the positive pole of the bread plate, the black wire is connected to the negative pole, and the green wire and the green wire are connected in the same line.

Relay connected to small water pump

The NO terminal of the relay is connected to the red line on one side of the water pump, and the COM port is connected to the red line of the water pump power supply. The black line of the water pump is connected.

3. The overall effect of the connection.

VI. Python code

#! / usr/bin/env python

#-*-coding: utf-8-*-

Import time

Print "Raspberry Pie Control pump"

Try:

Import RPi.GPIO as GPIO

Except RuntimeError:

Print ("introduction error")

GPIO.setwarnings (False)

GPIO.setmode (GPIO.BOARD)

Out_chl = 22

V = 1

GPIO.setup (out_chl, GPIO.OUT)

While True:

Print 'channel d, output% d'% (out_chl, v)

GPIO.output (out_chl, v)

If v = = 1:

V = 0

Else:

V = 1

Time.sleep (2)

The above is how to use raspberry pie to make a flower watering system. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report