Mini Handheld Anemometer Based on Micro:bit

by KittenBot in Circuits > Gadgets

444 Views, 3 Favorites, 0 Comments

Mini Handheld Anemometer Based on Micro:bit

IMG_8074.png
7月5日

The simple wind-receiving structure drives the magnet to rotate, the Sugar Hall module detects the number of times the magnet passes, and calculates the wind speed.

Supplies

Hardware

Micro:bit V2 * 1

SugarBox Expansion Board *1

Sugar Hall Sensor *1

OLED Module *1

3D Printed Part

several LEGO bricks

small magnet

Software

MakeCode

Structure

Insert the Micro:bit V2 into the slot of the SugarBox Expansion Board and secure the OLED Module directly in front of it for easy observation of the changes in wind speed values.

Secure the Sugar Hall Sensor on top to detect the presence of a magnet. Then install the mounting structure for the simple wind-receiving structure.

Install the simple wind-receiving structure and place the small magnet into the square hole of the LEGO brick.

Connect the modules and expansion boards together.

Principle

To calculate wind speed let's start with the principle of an anemometer. Below is the schematic diagram of the photoelectric anemometer, the three wind cup to turn the rotary table. There are several teeth on the turntable, and the LED beam is cut by the teeth on the gear plate, which will generate a pulse signal. As the wheel rotates, the teeth of the wheel cut the light beam, which sends out pulses representing wind speed.

Calculation Formula

The conversion formula of wind speed and pulse frequency is:

V (m/s) = 0.1 f (HZ)

Then, it can be deduced from the formula: V(m/s)=0.1f(HZ), when f=10, V=1m/s.

One circle of the turntable in the figure is 8 pulses. It is assumed that one circle is rotated every second, that is, 8HZ=1 cir/s. It can be obtained by substituting in the formula that 0.8m/s=8HZ=1 cir/s.

In this experiment, the Hall switch will be triggered when the wind cup shaft rotates, so as to replace the pulse signal obtained by cutting the beam.

Task Resolution

Now make an anemometer program that counts the number of turns every three seconds and calculates the wind speed by the number of turns. Display winding number and wind speed and add units on OLED at the same time.

①The program's pins and screens are initialized first.

②Set wind_flag variable state, set the variable to 0 and increase the number of turns by 1 when magnet is detected, set wind_flag variable to 1 when no magnet is detected. The winding number can be calculated accurately by this method.

③The number of turns and wind speed are displayed every 3 seconds.