Tachometer with IR LED and BOEBOT RECEIVER
ErikL
Posts: 4
Hi guys, hopefully somebody might be able to help me out with this. My dad likes to work on watches and wants to have a tachometer that measures the rpm of various unknown hairsprings. I am trying to help him out with his project and my initial idea was to use an IR LED/BOEBOT RECEIVER combo. I have the circuit built on my basic stamp and thus far have tested one program which senses when the IR beam is reflected. My thought was to then implement a counter using the count command to find the rpm value for various springs. I tried the sample program from the help menu with some minor changes to pin assignments and the powering of the IR LED instead of a pushbutton but all I get is a constant readout of 0 rpm. Is it possible to use the count command with the state of an IR receiver or am I making an incorrect assumption?
The code for testing the IR circuit is below:
' {$STAMP BS2}
' {$PBASIC 2.5}
irDetect VAR Bit
DO
FREQOUT 10, 1, 38500
irDetect = IN13
DEBUG HOME, "irDetect = ", BIN1 irDetect
'PAUSE 100
LOOP
The code for the counter program is below:
IRsensor VAR Bit
DurAdj CON $100 ' / 1
Capture CON 1000 ' 1 second
cycles VAR Word ' counted cycles
Main:
DO
FREQOUT 10, 1, 38500
IRsensor = IN13
PAUSE 100
COUNT IRsensor, (Capture */ DurAdj), cycles
DEBUG CR, "RPM: ", DEC cycles, CR
PAUSE 1000
DO : LOOP UNTIL (IRsensor = 1) ' wait for button press
LOOP
END
The initial help program was for a active low pushbutton circuit and I noticed that when IRsensor = 1 in the second DO LOOP it continues to repeat and when I change it to 0 the program stops. So I am wondering if it doesn't have time to recognize a change in states or if the state itself is not an "impulse" like the change of a pushbutton? I unfortunately cannot use a hall effect sensor because the hairspring is obviously metal which means it could be effected by a magnetic field and the oscillations could be effected. So I am currently at a roadblock, any help would be much appreciated.
The code for testing the IR circuit is below:
' {$STAMP BS2}
' {$PBASIC 2.5}
irDetect VAR Bit
DO
FREQOUT 10, 1, 38500
irDetect = IN13
DEBUG HOME, "irDetect = ", BIN1 irDetect
'PAUSE 100
LOOP
The code for the counter program is below:
IRsensor VAR Bit
DurAdj CON $100 ' / 1
Capture CON 1000 ' 1 second
cycles VAR Word ' counted cycles
Main:
DO
FREQOUT 10, 1, 38500
IRsensor = IN13
PAUSE 100
COUNT IRsensor, (Capture */ DurAdj), cycles
DEBUG CR, "RPM: ", DEC cycles, CR
PAUSE 1000
DO : LOOP UNTIL (IRsensor = 1) ' wait for button press
LOOP
END
The initial help program was for a active low pushbutton circuit and I noticed that when IRsensor = 1 in the second DO LOOP it continues to repeat and when I change it to 0 the program stops. So I am wondering if it doesn't have time to recognize a change in states or if the state itself is not an "impulse" like the change of a pushbutton? I unfortunately cannot use a hall effect sensor because the hairspring is obviously metal which means it could be effected by a magnetic field and the oscillations could be effected. So I am currently at a roadblock, any help would be much appreciated.
Comments
Yes, NC stands for not connected. It is relatively common to see "NC" on schematics.
Right again.
Pots are often used as a voltage divider but here the pot is being used as a variable resistor (as a single component of a more complex circuit).
In an attempt to provide a little more information here is my circuit in "word" form. Maybe I am not reading the schematic correctly:
Pin 1 of 555 chip: have a jumper going to the ground as well as one end of the capacitor
Pin 2 of 555 chip: the other end of the capacitor as well as a jumper going to pin 6 of the 555 chip
Pin 3 of 555 chip: one end of a 220 resistor and the other end of resistor to free space on the breadboard
Pin 4 of 555 chip: one end of a 220 resistor and the other end of resistor to free space on the breadboard which is then jumped to pin of basic stamp
I have the IR LED cathode sharing same row as free end of resistor from pin 3 which is then jumped to pin and anode of IR LED jumped to ground
Pin 5 of 555 chip: nothing
Pin 6 of 555 chip: one end of jumper with other end of jumper going to free space on bread board which then shares same row with middle pin or "wiper" of Pot
Pin 7 of 555 chip: one end of 470 resistor with other end going to VDD as well as one end of jumper which goes to free space on bread board which then shares one other pin of Pot
Pin 8 of 555 chip: jumper going to VDD
I don't know if this helps at all however I am definitely stuck trying to get this calibration circuit to work and a peculiar thing I noticed was if I remove the IR LED and run the program I get a debug screen which shows varying frequencies related to how I adjust the pot but then when I replace the IR LED it goes back to 0 with no change regardless of pot adjustment.