Show Posts
Pages: 1 [2] 3
16  Forum 2005-2010 (read only) / Interfacing / Re: reading rpm signal from cpu fan on: August 21, 2007, 12:10:22 am
Thanks I finally got it working  ;D

I was missing the 10k resistor and I used the following as code:

Quote
volatile byte NbTopsFan;
int hallsensor = 2;

void rpm()
{
  NbTopsFan++;
 }


/***************************************/
void setup()
{
 // pinMode(hallsensor, INPUT);
  Serial.begin(9600);
  attachInterrupt(0, rpm, RISING);
};

void loop ()
{
    NbTopsFan = 0;
    
    delay (1000);
    NbTopsFan = NbTopsFan * 30;
    Serial.print ("     ");
    Serial.print (NbTopsFan, DEC);
    Serial.print (" rpm");
 
    
};

It was a mix of yours and a mix of Benoit's, at least it works, now to get my character LCD to work.  On a side note I couldn't get yours to work, in the terminal I would get random numbers regardless if my fan was running or not.
17  Forum 2005-2010 (read only) / Interfacing / Re: reading rpm signal from cpu fan on: August 19, 2007, 05:39:35 pm
Ok I still can't get this to work on a Diecimila with 0009.  Am I calling the interrupt correctly?
Quote
volatile int NbTopsFan = 0;
int hallsensor = 3;

void rpm()
{
  ++NbTopsFan;
 }


/***************************************/
void setup()
{
  pinMode(hallsensor, INPUT);
  Serial.begin(9600);
  attachInterrupt(1, rpm, CHANGE);
};

void loop ()
{
    NbTopsFan = 0;
    
    delay (1000);
    NbTopsFan = NbTopsFan / 2;
    Serial.print ("     ");
    Serial.print (NbTopsFan, DEC);
    Serial.print (" rpm");
    Serial.print (13, BYTE);
    
};

Just to add: I have an external 12V powering the PC fan with the Yellow lead (hall effect sensor) going to pin 3.  When I open up the serial monitor I get 60 or 61 rpm, even when the fan is full out going (real rpm is somewhere around 7200) or when it's stopped.

Thanks

**exit: had the wrong pin in my wiring explanation
18  Forum 2005-2010 (read only) / Interfacing / Re: reading rpm signal from cpu fan on: August 17, 2007, 10:21:33 pm
I've tried your code Benoit on 0009 and it get the error:

Quote
In function 'void initInt0(byte)':
error: 'GICR' was not declared in this scop

Has the way interrupts changed since this code was written?
19  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Stepper Shield on: September 19, 2007, 12:58:39 pm
I'd love to reply if I had the knowledge, but alas I am a newbie  :'(

I will however take a look at it and if I can make any suggestions or such I will, I think it is great that someone is making a Stepper shield.
20  Forum 2005-2010 (read only) / Interfacing / Re: Garmin GPS on: July 25, 2008, 11:47:45 am
Have you made sure that the Garmin GPS unit is outputting in NMEA?  I think the Garmin units default to the Garmin protocol which may explain the strange output.
21  Forum 2005-2010 (read only) / Interfacing / Re: Hall sensors, interrupts etc. on: January 05, 2008, 03:55:23 pm
First, the Serial.Println command syntax can be found here:
http://www.arduino.cc/en/Serial/Println

As for the math; do you want to do:
((rpm*tyresize)/1000/1000)*60;

or

(rpm*tyresize)/1000/(1000*60);

I would assume it would be the second otherwise you could change your code to:
((rpm*tyresize)/1000000)*60;

And you don't need spaces between operators (multiply and divide).
22  Forum 2005-2010 (read only) / Interfacing / Parallax LCD Help on: December 17, 2007, 01:08:50 am
I have a 16x2 Parallax Serial LCD, I was wondering if anyone has been able to get it work?

It has 3 pins: GND, 5V and RX.  I have TX going to pin 1 (TX) on my Diecimila, and am running the following code:

Code:
int ledPin = 13;                // IR LED connected to digital pin 13
int statusPin = 12;             // LED connected to digital pin 12

volatile byte rpmcount;
volatile int status;

unsigned int rpm;

unsigned long timeold;

 void rpm_fun()
 {
   //Each rotation, this interrupt function is run twice, so take that into consideration for
   //calculating RPM
   //Update count
      rpmcount++;
      
   //Toggle status LED  
   if (status == LOW) {
     status = HIGH;
   } else {
     status = LOW;
   }
   digitalWrite(statusPin, status);
  
 }

void setup()
 {
   Serial.begin(9600);
   //Interrupt 0 is digital pin 2, so that is where the IR detector is connected
   //Triggers on FALLING (change from HIGH to LOW)
   attachInterrupt(0, rpm_fun, FALLING);
  
   //Turn on IR LED
   pinMode(ledPin, OUTPUT);
   digitalWrite(ledPin, HIGH);
  
   //Use statusPin to flash along with interrupts
 //  pinMode(statusPin, OUTPUT);

   rpmcount = 0;
   rpm = 0;
   timeold = 0;
   status = LOW;
 }

 void loop()
 {
   //Update RPM every second
   delay(1000);
   //Don't process interrupts during calculations
   detachInterrupt(0);
   rpm = rpmcount;
   timeold = millis();
   rpmcount = 0;
  
   //Write it out to serial port
 //  Serial.println(12,BYTE);
   Serial.println(rpm,DEC);
  
   //Restart the interrupt processing
   attachInterrupt(0, rpm_fun, FALLING);

  }
23  Forum 2005-2010 (read only) / Interfacing / Re: Someone to Port on: November 13, 2007, 04:28:16 pm
Yeah I saw, the dev only had the .hex file up.  Oh well, maybe when I'm done my other projects I'll take a serious stab at this.
24  Forum 2005-2010 (read only) / Interfacing / Re: Someone to Port on: November 07, 2007, 05:59:07 pm
I want to use the arduino to do the ODBII conversion.  I would probably have to use soft serial or something like that for the ODBII interface and keep the USB/Serial for the computer or even if possible have a serial lcd that displays the dtc's and button programmed to clear the dtc's.
25  Forum 2005-2010 (read only) / Interfacing / Someone to Port on: November 07, 2007, 05:15:48 pm
too bad someone couldn't port this http://www.obddiag.net/projects.html to arduino
26  Forum 2005-2010 (read only) / Interfacing / Re: Wind sensor on: October 09, 2007, 12:20:40 pm
I'm not evevn close to an expert but here's my 2c's:
The anometer you have linked would work on it's own, but since it communicates via serial, you won't be able to have it work and communicate with your computer via arduino at the same time.  But since it works via reed switches, which are to my understanding just on/off then you can use it and take out the serial communications part and have the reed switch attached to a digital pin somehow and have the arduino communicate with your computer.
NB I may be wrong above as I'm still a newbie to the arduino as well.

On a side note, I'm in the process of making my own anometer, but mine is to be ultra portable for measuring the wind speed while I windsurf.  I'm using a gutted pc fan and used http://www.instructables.com/id/Arduino-Based-Optical-Tachometer/ to input rotations of the fan.  It's still a work in progress, but I have my sensor assembly made and it works, I'll post pictures when I have time tonight.  I plan on writing something up because I'll be using a LCD and make it battery powered too.
27  Forum 2005-2010 (read only) / Interfacing / Re: Interfacing with graphing program on: July 23, 2007, 06:44:32 pm
did you get any response, as I'm interested in this too?  it would be nice to export to something that matlab or octave can read and plot
28  Forum 2005-2010 (read only) / Interfacing / Re: count pulses on: August 22, 2007, 11:28:04 am
This is just a far fetched idea and I wouldn't know how to put it together, but you could have the tipping rain gauge activate some sort of counter, independent of the arduino, then when you need the rain fall info have the arduino poll the counter.  This would assume that you only need the info once per day or some other predefined time period (this wouldn't help for IDF storm info).  
If your displaying and collecting info somewhere downstream of the arduino, like a computer, and just have the arduino sending the computer the info, then using interrupts might work as long as you're not interrupting some time dependent function, and time stamp the info from the rain gauge on the computer.

I'm pretty new at this stuff so you might want to just take my ideas as conceptual, I really have no idea how you would go about it (although the tipping rain gauge, if it's just a simple mechanical one, you could add a magnet to it and use a reed switch to do the activation of when the gauge tips).
29  Forum 2005-2010 (read only) / Interfacing / Re: MIDI / in setup on: August 17, 2007, 01:37:41 pm
I wish I could help, I'm still a newbie as well, in fact I just got the IDE running a couple of days ago and changed the timing of the 'Blinking' example.  I am sure if you write in that thread that I posted someone with some midi knowledge will help out.
30  Forum 2005-2010 (read only) / Interfacing / Re: MIDI / in setup on: August 16, 2007, 05:19:30 pm
Is this http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1186530609 what you're looking for?  It might be a step in the right direction.
Pages: 1 [2] 3