Anemometer

../_images/Anemometer-full.jpg

Description

The anemometer is a project that runs on Raspberry Pi. It consists of four cups mounted on horizontal perpendicular arms, which are mounted on a vertical shaft connected wheel. The air flow past the cups in any horizontal direction turned the shaft at a rate that was proportional to the wind speed. Therefore, counting the turns of the shaft over a set time period produced a value proportional to the average wind speed for a wide range of speeds. It is used for measuring the speed of wind.

Learning Objectives

  • Coding, electronics, and physical science through a hands-on application that can be directly related to real life situations.
  • Motion concepts of the science of linear motion, mainly speed and velocity, angular and linear.
  • Renewable energy and their efficiency in relation to wind speed.
  • Air density and its effect on air pressure and wind formation.
  • The implementation of the engineering design process.
  • Application of theoretical concepts to real life situations.

Materials Needed

  • Raspberry Pi with micro SD card and Raspbian
  • Jumper wires
  • Wheel Encoder
  • Glue gun and glue sticks
  • Cutter blades or scissors
  • Thin sturdy cardboard (poster or portfolio cardboard)
  • 4 plastic cups

Setup and Functionality

The Anemometer project is simply a form of a rotating horizontal body made up of four plastic cups that are located on two linear supports that are at a right angle. The rotating structure is connected to an axis in its center that can smoothly rotate whenever pushed by the wind.

../_images/Anemometer.jpg

The axis in turn is connected to a wheel that is perforated (has holes in it) that is located between two infrared reflectance sensors that count the number of rotations based on the alternation of closed and open spaces on the wheel as detected by infrared radiations. The wheel encoder sensor (shown below) is connected and programmed to collect data on a Raspberry Pi board.

../_images/Anemometer2.jpg

Circuitry and Electronics:

The diagram below shows all the wiring and connections of all the components used in the Anemometer:

../_images/Anemometer.png

Programming

import RPi.GPIO as GPIO
import time
global f
GPIO.setmode(GPIO.BOARD)
#set pin 7 to input
GPIO.setup(7,GPIO.IN)
def rounds():
    encoder=0
    #the first(default) value is not a rotation
    #so we set the nrounds to -0.05, to not take
    #it in consideration.
    nrounds = -0.05

    temp = GPIO.input(7)
    for i in range(0,1000000):
    encoder = GPIO.input(7)
    if(encoder==0):
    # detecting variation between 0 and 1
    if(temp != encoder):
    temp = encoder
    #every 0.05 is a 1/20 of a rotation
    nrounds = nrounds + 0.05
    #print nrounds
    else :
    # detecting variation between 0 and 1
    if(temp != encoder):
    temp = encoder
    nrounds = nrounds + 0.05
    #print nrounds

    return nrounds

try:
    while True:
        start = time.time()
        nrounds = rounds()
        stop = time.time()
        #print nrounds
        #if the gear did turn
        if( nrounds!= -0.05):
            #timepassed is the time span since the gear started rotating
            #and the time it stopped.
            timepassed = stop-start
            #print timepassed
            #timepassed in second, we divide it by 60 to convert it to min
            rpm = nrounds/(timepassed/60)
            #0.21 is the diameter in 'm'
            ms = 3.141*0.21*(nrounds/timepassed)
            print ms
        #if not return 'rpm' and 'ms' = 0
        else :
            rpm = 0;
            ms = 0
            print ms
        #open file to write(any content that already exists will be erased)
        #To write in file without deleting content we simply replace 'w'

        #with 'a'
        f=open('/home/pi/Desktop/Speed.txt','a')
        #casting rpm to integer then string
        f.write("speed:" + str(int(rpm)) + " rpm " + str(round(ms,2)) + " m/s \n")
        #getting only 2 number after the comma, then casting it to string
        f.close()

except (KeyboardInterrupt, SystemExit):
    f.close()
    GPIO.cleanup()

Science Concepts and Skills

The anemometer rotating piece moves in a circular motion when it is pushed by wind. The encoder wheel also collects data as rotations per minute (rpm). The data collected should be converted from rotations per minute to meters per second, which is the linear velocity of wind. The following formula can be applied:

v = r × v_a × 0.10472

Where:
v is the linear velocity in m/s
r is the radius of anemometer revolving piece
v_a is the angular velocity (circular), in rpm (rotations per minute)

Read more.

In addition, the anemometer project can be linked to the production of energy using wind turbines. The wind speed data collected can be used to relate to the amount of energy produced by wind turbines. This will help in choosing the best geographic locations that are suitable for installation of wind turbines for effective and efficient production of renewable energy. Atmospheric pressure and air density can also play a role in wind formation. Air is made up of tiny molecules. When molecules of a gas are heated, they move at a faster speed. So when air is heated, its molecules start to move faster leading to more spaces between the molecules. As a result, the density of air becomes less as there will be lower number of molecules per unit of volume. This also means that the air has a lower overall pressure. On the other hand, cold air is made of more tightly packed molecules leading to more molecules per unit of volume, so it is denser and has relatively higher pressure. Air pressures in the atmosphere tend to balance out. Air will move from an area of higher pressure to an area of lower pressure generating wind.

Flex your brain! How could you apply angular and linear velocity to produce electricity from wind turbines?