red65536

hello. i had a quick question about hall effect sensors and arduino sample rates. i want to use a hall effect sensor to measure the rpm and acceleration of a wheel. the wheel will accelerate to 6000 rpm, or 100 rev a sec in about 6 seconds or so. my question is about the speed of the digital input.

first, will there be a race condition, and inaccuracy from the sensor and the clock pulses not syncing up.

and two, if anyone has a recommendation for a decent hall effect sensor.

i was also considering a optical sensor, but the set up the hall effect and magnet set up would work better i think.

thanks for the help,

anthonyanicolai@coe.neu.edu

mrmeval

Fans run at 3000rpms and this seems to work fine. I'm not sure how the fans get the hall effect sensor to output +5v pulses so you may want to look at an hall effect sensor that has the circuitry to do that for you.

red65536

how would you poll the sensor so theres is a constant sample rate, would it be by using an interupt, i feel that the code delay times would fluctuate based on the data that is acquired and the different times it will take to pass it along the serial conenction.

red65536

just to see if i have the concept down correctly. what i want to do i measuer the acceleration of a wheel. it will be spinning at 100 hrz at the top speed. i tihnk the best way to do this is to have the hall effect sensor singal the interpt on the aurdino every time it goes high. each time it is trigered i want to export a time stamp to the pc and log it, and then graph the trend of the acceleration based on the diference between a time stamp and its previous time stamp.

does hat make sense, or is there a better way to do data logging with the arduino.

thanks

Cheater

Another way which is better if your doing other things on the chip at the same time:1) When a interrupt fires, revolutions++;2) Every X ms (however fine you want it) get the number of revolutions and reset the variable to 03) Compare the previous number to the current number. The change is acceleration while the number is absolute speed.

mrmeval

The code should work. If you learn how to do that with an interrupt the chip could be doing other things until the interrupt is triggered. That would be important only if you were running something time sensitive like a scanned LED matrix or had to monitor some other sensors.

red65536

im not exactly sure how you would use the interupt for this situation. i have two ideas from what you have mentioned.

1) use the interupt as the data in from the hall effect sensor. when the interupt is triggered send the current time out via the serial link ot the comp to log and process this data and then graph it.2)run code to count all of the positive state transistions the hall effect sensor has, when setting up a timer to trigger the interupt at a constant time, and do the math based on how many revs per interupt period.

firestarter

I'm just getting started with the arduino and figured i'd give the pushbutton example a try. When i connect up everything as shown on this page http://www.arduino.cc/en/Tutorial/Pushbutton the LED gives me a flashing light instead of an on/off behavior... i'm stuck? Is it supposed to give me a flashing LED? or a state-like behavior which would make sense.

The led should follow the state of the button. Perhaps the input is floating, check to make sure that the switch is connected to pin 7. If you have a voltmeter, check that the voltage is 5 volts on pin 7 when the switch is not pressed and 0 volts when pressed.

Also, are you sure your sketch has been sent to the board, as I recall on mine. the default sketch just flashes the led.