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.
Hardware- Micro:bit V2 * 1
- SugarBox Expansion Board *1
- Sugar Hall Sensor *1
- OLED Module *1
- 3D Printed Part
- several LEGO bricks
- small magnet
Step 1
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.
Step 2
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.
Step 3
Install the simple wind-receiving structure and place the small magnet into the square hole of the LEGO brick.
Step 4
Connect the modules and expansion boards together.
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.
Step 1: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.
Step 2: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.
Step 3:Task resolution
①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.
Comments