Basic Stamp for a Tachometer
JackG
Posts: 3
I need to build a tachometer for my lathe, and I’m considering using a Basic Stamp processor (I’m a software developer, so I’m comfortable coding, but know little to nothing about the Basic Stamp).· My though it to use an encoder·disk with several black and white areas (probably 8) mounted on the spindle and then use a light sensor of some sort so sense the speed.· The output would be a four digit seven segment display of some sort.· The speed range is 0 to around 3000 rpm. Nothing fancy.
My initial questions are:
1)····· Does the Basic Stamp have the processor speed for this task?· (8 x 3000 RPM·= about 400 pulses per second).· I would assume so, but need to ask the question.
2)····· Does it have enough program space (EEPROM) for this (count revolutions and drive a four digit seven segment display)?· The spec sheet for the BS2 says it'll handle about 500 instructions, but I have no feeling for how much can be done in 500 instructions.
3)····· What other questions should I be asling?
·Thanks,
·Jack
My initial questions are:
1)····· Does the Basic Stamp have the processor speed for this task?· (8 x 3000 RPM·= about 400 pulses per second).· I would assume so, but need to ask the question.
2)····· Does it have enough program space (EEPROM) for this (count revolutions and drive a four digit seven segment display)?· The spec sheet for the BS2 says it'll handle about 500 instructions, but I have no feeling for how much can be done in 500 instructions.
3)····· What other questions should I be asling?
·Thanks,
·Jack
Comments
here is a link about bs2 instruction speed...
http://www.emesystems.com/BS2speed.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
At 50 Hz you have to spend lots of time waiting for a pulse, as there is no Interupt with the Stamp.
If the Stamp is doing something else·when a pulse happens then you·may miss it.· This will throw your count off.
You might want to set up a counter circuit, and then check it 10 times a second, and reset it.
A second counter, counting the AC line would make a good clock for this application.
This way you have time to do do whatever house keeping, read switches, update displays, and not miss any RPM Pulses.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Alan Bradford ·N1YMQ
Plasma Technologies
Canaan NH 03741
www.plasmatechnologies.com
Looking at other posts, I think that there’s built in function called Count (or something like that).· I have not read any specific documentation (is it available online?), but I assume that it’s a synchronous function that is passed a time span (I second).· It then counts pulses for a second then returns.· My thought was to call Count, when it returns, display the RPM, and then call it again, and so on.
How much code (approximately) does it take to drive a four digit seven segment display?· Less than 500 instructions?
·http://www.parallax.com/Default.aspx?tabid=420
Jim
http://forums.parallax.com/showthread.php?p=893416·so it can keep up with the count. You should have no trouble taking an encoder sample (either using a software loop or the count command) then output that value to a display. Alternating these two will provide you with a very useable, apparently seamless·tach display.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."