projects:anemometer
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| projects:anemometer [2023/10/02 18:15] – created jattie | projects:anemometer [2024/02/18 19:54] (current) – [Important notes about reed switches] jattie | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Calculating wind speed ===== | ===== Calculating wind speed ===== | ||
| - | If I have a three cup anemometer with half spherical cups of 80mm diameter and the cup canters are 155mm from rotation point. | + | I have a three cup anemometer with half spherical cups of 80mm diameter and the cup canters are 155mm from rotation point. |
| - | To calculate the wind speed based on the given information for your three-cup anemometer, you can use the formula | + | To calculate the wind speed based on the given information for your three-cup anemometer, you can use the formula: |
| - | Wind Speed (in meters per second) = (π * D * RPM) / (60 * C) | + | Wind Speed (in meters per second) = (π * D * RPM) / (2 * C) |
| Where: | Where: | ||
| - | ^D |is the diameter of the cups (in meters)| | + | * D is the diameter of the cups (in meters) |
| - | ^RPM |is the revolutions per minute| | + | |
| - | ^C |is the distance from the cup center to the rotation point (in meters)| | + | |
| - | In our case: | + | In your case: |
| - | ^D |80mm|0.08m| | + | |
| - | ^RPM|1|| | + | |
| - | ^C|155mm|0.155m| | + | |
| Plugging in the values into the formula: | Plugging in the values into the formula: | ||
| - | Wind Speed = (π * 0.08 * 1) / (60 * 0.155) | + | Wind Speed = (π * 0.08 * 60) / (2 * 0.155) |
| Simplifying the equation: | Simplifying the equation: | ||
| - | Wind Speed ≈ 0.001295 | + | Wind Speed ≈ 7.307 m/s |
| - | Therefore, with a rotation speed of 1 RPM, the resulting wind speed would be approximately | + | Therefore, with a rotation speed of 60 RPM, the resulting wind speed would be approximately |
| + | ===== interrupt-driven counter ===== | ||
| + | |||
| + | |||
| + | To create an interrupt-driven counter on a Raspberry Pi using GPIO pins, you can follow these steps: | ||
| + | |||
| + | ==== Import the required libraries ==== | ||
| + | |||
| + | <code python> | ||
| + | import RPi.GPIO as GPIO | ||
| + | import time | ||
| + | </ | ||
| + | |||
| + | ==== Set up the GPIO mode and initialize the counter variable ==== | ||
| + | |||
| + | ```python | ||
| + | GPIO.setmode(GPIO.BCM) | ||
| + | counter = 0 | ||
| + | ``` | ||
| + | |||
| + | ==== Set up the GPIO pin for input and configure the interrupt ==== | ||
| + | |||
| + | |||
| + | <code python> | ||
| + | GPIO.setup(pin_number, | ||
| + | GPIO.add_event_detect(pin_number, | ||
| + | </ | ||
| + | |||
| + | **Note:** Replace '' | ||
| + | |||
| + | ==== Define the callback function to increment the counter ==== | ||
| + | |||
| + | <code python> | ||
| + | def increment_counter(channel): | ||
| + | global counter | ||
| + | counter += 1 | ||
| + | </ | ||
| + | |||
| + | ==== Create a loop to keep the program running ==== | ||
| + | |||
| + | <code python> | ||
| + | try: | ||
| + | while True: | ||
| + | time.sleep(1) | ||
| + | except KeyboardInterrupt: | ||
| + | GPIO.cleanup() | ||
| + | </ | ||
| + | |||
| + | This code sets up the GPIO pin as an input with a pull-up resistor and detects falling edge interrupts. When the interrupt is triggered, the '' | ||
| + | |||
| + | Remember to replace '' | ||
| + | |||
| + | ===== Important notes about reed switches ===== | ||
| + | |||
| + | The sensitivity of a REED switch is characterized by the value of the magnetic field which is required to | ||
| + | change its state. The magnetic field is expressed in Ampere-turns | ||
| + | |||
| + | <WRAP center round tip 60%> | ||
| + | OAT<CAT is always true | ||
| + | </ | ||
| + | |||
| + | Order of magnitude OAT-CAT : | ||
| + | |||
| + | ^For standard switches^^ | ||
| + | |CAT |12 and 50 Ampere-turns| | ||
| + | |OAT |5 and 30 Ampere-turns|. | ||
| + | ^For standard or mercury wetted switches^^ | ||
| + | |CAT |35 and 150 Ampere-turns| | ||
| + | |OAT |10 and 80| | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | NOTE : if the leads on a switch are cut, the CAT and OAT values will increase | ||
| + | |||
| + | Bending modifies the CAT and OAT values of a switch | ||
| + | Cutting the leads on a REED switch has the effect of increasing the CAT and OAT ratings in a significant manner. | ||
| + | </ | ||
| + | |||
| + | The figure below illustrates this variation. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ===== Reed Reference Documents ===== | ||
| + | |||
| + | |||
| + | * {{: | ||
| + | * {{: | ||
projects/anemometer.1696270510.txt.gz · Last modified: by jattie
