Hall Effect Wheel Speed, next step
please note: trying set hall effect sensor wheel speed of car. have discs teeth produce signal using lump of metal , mr arm generate signal. using uno r3
so have far hall effect sensor outputs analogue signal , have managed read , convert 1 or 0 stored in variable "hallval". led part can see working.
what need do, or think need measure time takes switch "hallval" 1 next "1" in order calculate speed.
so have 2 questions, given sensor have right , cannot buy new ones.. yet.
1) have done far enough / know easier way achieve require?
2) how can measure time 1 next 1? there functions can suggest might me.
so have far hall effect sensor outputs analogue signal , have managed read , convert 1 or 0 stored in variable "hallval". led part can see working.
code: [select]
int hallpin = a0;
int ledpin = 13;
int val;
int hallval;
void setup()
{
pinmode(hallpin, input_pullup);
pinmode(ledpin, output);
serial.begin(9600);
}
void loop()
{
val = analogread(hallpin);
if (val <= 75) digitalwrite(ledpin, high);
else if (val > 75) digitalwrite(ledpin, low);
if (val <= 75) hallval = 1;
else if (val > 75) hallval = 0;
serial.println(hallval);
delay(1);
}
what need do, or think need measure time takes switch "hallval" 1 next "1" in order calculate speed.
so have 2 questions, given sensor have right , cannot buy new ones.. yet.
1) have done far enough / know easier way achieve require?
2) how can measure time 1 next 1? there functions can suggest might me.
you have use interrupts, there number of ways. make sure hall sensor can switch fast enough too
http://www.societyofrobots.com/robotforum/index.php?topic=14973.0
german can use google translate , code still same
http://saduino.ch/mechatronic/index.php?article=umdrehungsgeschwindigkeit-von-stirling-motor-mit-hallsensor-messen
this code depends on whether have latch sensor or not.
http://www.societyofrobots.com/robotforum/index.php?topic=14973.0
german can use google translate , code still same
http://saduino.ch/mechatronic/index.php?article=umdrehungsgeschwindigkeit-von-stirling-motor-mit-hallsensor-messen
this code depends on whether have latch sensor or not.
Arduino Forum > Using Arduino > Sensors > Hall Effect Wheel Speed, next step
arduino
Comments
Post a Comment