Re: Interfacing bs2 to shaft sensor and lcd
KERBS
Posts: 26
·'m really in over my head!!!
···· I want to input a speed signal ( hall effect wheel sensor), a rate signal (also a hall effect sensor reading magnets on a rotating shaft), calibration constants corrispond to real world units for the above signals. run some basic to output live speed, and rate of application to an LCD.·
···· the only thing is im way behind the 8 ball.· I bought a boe starter kit and started in on it, but i can see that at this rate ill be well into my nineties before get anywhere.
can someone point me in the right direction? or at least let me know if the bs2 can accomplish this?
·· Any·basic stamp pros·out there want to take a real novice under his or her wing?
·
···· I want to input a speed signal ( hall effect wheel sensor), a rate signal (also a hall effect sensor reading magnets on a rotating shaft), calibration constants corrispond to real world units for the above signals. run some basic to output live speed, and rate of application to an LCD.·
···· the only thing is im way behind the 8 ball.· I bought a boe starter kit and started in on it, but i can see that at this rate ill be well into my nineties before get anywhere.
can someone point me in the right direction? or at least let me know if the bs2 can accomplish this?
·· Any·basic stamp pros·out there want to take a real novice under his or her wing?
·
Comments
Yes, the BS2 can easily do this. Here's exactly what you are looking for:
http://www.parallax.com/html_pages/robotics/machining/RPM_display.asp
This uses a parallel LCD but you could use a serial if you desire. Do you still think you will be in your nineties when you figure this out? If so, there's another guy on this list who will soon be in his 90s and he's a good Stamp programmer!
Ken Gracey
Parallax, Inc.
ive got a test board hooked up, with a pulse generator, I ran a simple do:loop program on my stamp to simulate a situation. when i dubugged it seemed like some of the pulses got missed at higher frequencies ie 1000hz. is this because of overhead? how do i eliminate that?
How fast of pulses do you need to measure ?
Terry
Are you using COUNT or PULSIN? Which Stamp are you using?
If you are using the same arrangement as I have on the mill speedo then you will need to have the magnet very close to the sensor, if you are detecting changes in magnet poles rather than a magnet passing by the sensor. I think I placed the sensor and magnet within a few millimeters or so.
Ken Gracey
It sounds like Kerbs is trying to count every pulse without missing any.
Is that true Kerbs ?
Terry
As to the question regarding missing pulses. If I understand things correctly, count measures frequency. this would be a useful value for determining "live" rate (speed and shaft rotation), however, accumulated figures (area and toal lb applied) would have to be estimated by some means. if we also count and store accumulated pulses, calculations for area and lbs accumulated could calculated directly.
By the way, thank you very much for helping. I really feel much more confident with all this help
Yes, I've seen this done with weather stations (anenometers/rain buckets) and with wheel encoders for robots. I think the part is called a binary ripple counter. Others on this forum can recommend an exact part. It counts and increments a value you can retrieve at any time. Here's an example:
http://www.sfu.ca/phys/430/Lab5.pdf
Use Google "BASIC Stamp binary counter" or something similar and you'll get some labs from universities like the one above.
Ken Gracey
Parallax, Inc.
To this end I have collected these Items cp82c54 with 3 independant 16 bit counter, 74LS590 8 bit counter, 74HC165 Parallel in/Serial out interface chip, and a 44780 LCD. Now, can any one help me from here. Do I need a to use the 16 bit counter, or will the 8 bit unit work for me. And Since the 16 bit counter has 3 independant counters, can I use it for counting both signals from the 2 sensors? And once I get this assembled, how the heck do I write the code?? AAAAAAAAAAAAAH
top-level Pseudocode:
while 1 DO
Read time until one second has passed
Read wheel counters, convert to distance traveled, and store.
Read product application counters, convert to produce amount, and store.
Generate desired metrics for LCD (Application Rate, Speed)
Display Metrics on LCD
END WHILE
You shouldn't write the code starting with a massive pile of parts wired up to the BASIC Stamp. You need to start in small pieces, working from a breadboard. First, get the counter working with the sensors. Then, develop the code to have the Stamp do the math for application rate and speed. Use DEBUG to show the values. Once it is working add an LCD for display (I recommend a serial version for starters - keep it simple and switch to a parallel if you are going to make several such gizmos).
Start with a couple of components and a BASIC Stamp. Then, post your specific question for the particular part and task. We can help you much easier that way. Okay? Build this one step at a time, keeping the whole project in mind.
Ken Gracey
Parallax, Inc.
Are you getting pulses from the shaft sensors ?
Can you count the pulses (or pulse frequency) ?
Can you communicate with the LCD ?
As Ken has said earlier, you must tackle projects one piece at a time. Get one part working then move on to the next. I would start with the LCD, because then you can use the LCD to debug and test the other parts of the system.
Bean.