Next Step, Display

My current mission in life is to develop a display for a homemade anemometer I built out of coffee scoopers, aluminum bar stock, and automobile parts.

I tried to insert a picture of my anemometer but it didn't work. :confused:

In any event, from what I've learned hanging around here I have been able to hack some code that counts the pulses from my anemometer and then uses those to calculate the windspeed in MPH to my Serial Monitor.

// read MPH

volatile int mphcount = 0;//see http://arduino.cc/en/Reference/Volatile
int mph = 0;
unsigned long lastmillis = 0;

void setup(){
 Serial.begin(9600); 
 attachInterrupt(0, mph_anemometer, FALLING);//interrupt zero (0) is on pin two(2).
}

void loop(){
 
 if (millis() - lastmillis == 60000){  /*Uptade every minute, this will be equal to number of pulses.*/
 
 detachInterrupt(0);    //Disable interrupt when calculating
 
 
 mph = mphcount / 104;  /* Convert pulsecount to MPH.*/
 
 Serial.print("MPH =\t"); //print the word "MPH" and tab.
 Serial.print(mph); // print the mph value.
 Serial.print("\t pulsecount=\t"); //print the word "pulses".
 Serial.println(mphcount); /*print pulses per minute. And print new line or enter.*/
 
 mphcount = 0; // Restart the MPH counter
 lastmillis = millis(); // Uptade lasmillis
 attachInterrupt(0, mph_anemometer, FALLING);//enable interrupt
  }
}


void mph_anemometer(){ /* this code will be executed every time the interrupt 0 (pin2) gets low.*/
  mphcount++;
}

Considering I didn't know what a Serial Monitor was a month ago when I showed up here, you guys have helped me to make some serious progress!

But now I need to take the next step and figure out how to get my little UNO friend to output to a display. I'm thinking a pair of 7 segment LED's would do just fine.

Can any body point me in a general direction?

Looks cool!
Have you set up something to get readings from it?

vinceherman:
Looks cool!
Have you set up something to get readings from it?

The innards consist of an 8 pole magnet I got out of a small block Chevy distributor. An AH175 does pick up duties and I’ll try another picture attempt.

It may actually be simpler to use an LCD display, such as a 1602 display (16 characters, 2 lines) or 2004 (with more room for future expansion). Very easy to control using the LiquidCrystal library. With with I2C backpack you need just two digital pins, power and GND, to connect it.

pntrbl:
My current mission in life is to develop a display for a homemade anemometer I built out of coffee scoopers, aluminum bar stock, and automobile parts.
910c5213f5c0334d5079aa7a89b09717e10cd233.jpg

Looks great, doesn’t even look like it’s cobbled together from various parts.