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

An example Analysis of DIY Acousto-Optic switch on MicroPython Development Board

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

In this article Xiaobian for you to introduce in detail the "MicroPython development board DIY acousto-optic control switch example analysis", the content is detailed, the steps are clear, the details are handled properly, I hope this "MicroPython development board DIY acousto-optic control switch example analysis" article can help you solve doubts, following the editor's ideas slowly in-depth, together to learn new knowledge.

1. Experimental purpose

1. Learn the method of extending the simple Iripple O interface in the PC system.

two。 Further learn the design method of compiling data output program.

3. Learn how the photosensitive module works.

4. Learn how sound works.

5. Learn the connection method between F40 7Micropython development board and sound sensor and photosensitive sensor and use sound and light to control the light emitting diode to turn off.

two。 Required components

F407 Micropython development board

A sound sensor.

A photosensitive sensor

A piece of bread

Several light emitting diodes

A data line

Some DuPont lines

3. Working principle of photosensitive sensor module

1. Photosensitive resistor module is the most sensitive to ambient light, which is generally used to detect the brightness of ambient light, trigger single-chip microcomputer or relay module, etc.

two。 When the ambient light brightness of the module does not reach the set threshold, the do output high level, and when the ambient light brightness exceeds the set threshold, the do output low level.

The 3.DO output terminal can be directly connected with the single-chip microcomputer, and the high and low level can be detected by the single-chip microcomputer, thus the light brightness change of the environment can be detected.

The 4.DO output can directly drive the relay module of our store, which can form a light-controlled switch.

Light sensitive sensor

4. Working principle of sound sensor module

1. The sound module is the most sensitive to the ambient sound intensity and is generally used to detect the sound intensity of the surrounding environment.

two。 When the ambient sound intensity does not reach the set threshold, the OUT output high level, when the external ambient sound intensity exceeds the set threshold, the module OUT output low level.

3. The small board digital output OUT can be directly connected with the single-chip microcomputer to detect the high and low level, so as to detect the sound of the environment.

4. The small board digital output OUT can directly drive the relay module of our store, which can form a voice control switch.

Sound sensor

Hardware wiring method

We already know the working principle of the photosensitive sensor and the sound sensor, as well as the function of the three pins, so we only need to connect the positive and negative poles of the power supply to the 3.3V and GND of our F407Micropython development board, and then connect the signal output pins of the photosensitive sensor and the sound sensor to our F407Micropython development board. My sound sensor signal output pin is connected to the Y1 pin of the F407Micropython development board. The signal output pin of the photosensitive sensor is connected to the Y2 pin of the TOYBoard, so that the sensor is connected, and then we insert the positive pole of the light emitting digital tube into the positive pole of the bread board, and the negative pole into the longitudinal Jack of the bread board (a ···), then connect the negative electrode to the GND of the F407 Micropython development board with the DuPont wire, and the positive pole of the lamp to the X1 pin of our TOYBoard. Then we control the sound volume and light intensity to control the X1 pin output high level or low level to control the light-emitting diode, after wiring ok, write main.py, so that our DIY acousto-optic electronic switch is completed.

5. source code

# main.py-- put your code hereafter imports pybfrom pyb import Pinvoice = Pin ('Y1century pin. In) light = Pin (' Y2pm Pin.IN) led = pyb.Pin ("X1") Pyb.Pin.OUT_PP) while 1: if light.value () = = 1: if voice.value () = 1: led.value (0) pyb.LED (2). Off () pyb.LED (3). Off () pyb.LED (4). On () else: pyb.LED (3). Off () Pyb.LED (4). Off () led.value (1) pyb.LED (2). On () pyb.delay (5000) else: pyb.LED (3). On () pyb.LED (2). Off () pyb.LED (4). Off () led.value (0) This "MicroPython development board DIY acousto-optic control switch example analysis" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more about the article, welcome to pay attention to 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