Jattie van der Linde

Shoe string engineering

User Tools

Site Tools


projects:anemometer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
projects:anemometer [2023/10/02 18:15] – created jattieprojects: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. If the device turns at 1 rpm, what is the resulting wind speed?+I have a three cup anemometer with half spherical cups of 80mm diameter and the cup canters are 155mm from rotation point. if the device turns and 60 rpm, what is the resulting wind speed?
  
-To calculate the wind speed based on the given information for your three-cup anemometer, you can use the formula for cup anemometers:+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) / (* C)
  
 Where: Where:
  
-^|is the diameter of the cups (in meters)| +  * D is the diameter of the cups (in meters) 
-^RPM |is the revolutions per minute| +  RPM is the revolutions per minute 
-^|is the distance from the cup center to the rotation point (in meters)|+  C is the distance from the cup center to the rotation point (in meters)
  
-In our case: +In your case: 
-^|80mm|0.08m| +  80mm 0.08m 
-^RPM|1|| +  RPM = 60 (revolutions per minute) 
-^C|155mm|0.155m|+  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) / (* 0.155)
  
 Simplifying the equation: Simplifying the equation:
  
-Wind Speed ≈ 0.001295 m/s+Wind Speed ≈ 7.307 m/s
  
-Therefore, with a rotation speed of RPM, the resulting wind speed would be approximately 0.001295 meters per second.+Therefore, with a rotation speed of 60 RPM, the resulting wind speed would be approximately 7.307 meters per second.
  
 +===== 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
 +</code>
 +
 +==== 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.IN, pull_up_down=GPIO.PUD_UP)
 +GPIO.add_event_detect(pin_number, GPIO.FALLING, callback=increment_counter)
 +</cpde>
 +
 +**Note:** Replace ''pin_number'' with the GPIO pin number you want to use.
 +
 +==== Define the callback function to increment the counter ====
 +
 +<code python>
 +def increment_counter(channel):
 +    global counter
 +    counter += 1
 +</code>
 +
 +==== Create a loop to keep the program running ====
 +
 +<code python>
 +try:
 +    while True:
 +        time.sleep(1)
 +except KeyboardInterrupt:
 +    GPIO.cleanup()
 +</code>
 +
 +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 ''increment_counter'' function is called, which increments the counter variable. The program then enters an infinite loop, waiting for interrupts.
 +
 +Remember to replace ''pin_number'' with the desired GPIO pin number for your application.
 +
 +===== 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  (or ampere/meter). In order to close a normally open switch, for instance, a certain number of Ampere-turns, called **CAT**, are required (**c**losing **A**mpere-**t**urns). To open the same switch the magnetic field must be reduced down to an **o**pening value in **A**mpere-**t**urns **OAT**). 
 +
 +<WRAP center round tip 60%>
 +OAT<CAT is always true
 +</WRAP>
 +
 +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. 
 +</WRAP>
 +
 +The figure below illustrates this variation.
 +
 +{{:projects:screenshot_2024-02-18_195106.png?400|}}
 +
 +===== Reed Reference Documents =====
 +
 +
 +  * {{:projects:ap-interen.pdf|}}
 +  * {{:projects:notes_reed_switch_modifications.pdf|}}
projects/anemometer.1696270510.txt.gz · Last modified: 2023/10/02 18:15 by jattie