School Help RPM counter [URGENT]

smeagol109

New Member
First of all I'm from portugal so sorry if I misspell something :(

Hello there I'm involved In a school project, and I searched the web to see if someone could help me develop a program that is basicaly a rpm counter that inputs the results into a lcd screen like this

http://www.microedeias.pt/kitmanuals/produtos/LCDazul.jpg

In my school we use Picaxe 28x2 and picaxe editor 6 as our programming software.

I already took out a sensor of a printer and figured out that it is light sensitive. So I attached white paper to a wheel with a black stripe, so when the black stripe hits the sensor it should count a rotation.

Can someone from this concept help me create a program? It would be awesome.

Thanks in advance

P.S. I know you might need the exact tension values but just work with a generic number, for example 5 volts normally, down to 1v when the black stripe crosses the sensor.

Ruben Gomes :D
 

geoff07

Senior Member
Hi Ruben,

I'm sure people can help you. First thing, what sensor are you planning to use? There are many types. It should have a part number on it or you could maybe post a photo?
 

lbenson

Senior Member
If you were at 5 volts and 1 volt, then those levels could be used as simple on/off indicators.
Code:
do
  do loop while pinC.1 = 0
  inc b4  ' count a revolution
  do loop while pinc.1 = 1
  ' now check the timer variable to see if 60 seconds have elapsed
  ' and do what you need to do
loop
The "timer" variable is mentioned in Manual 2 on page 14. M2 parts have a "time" variable which counts seconds, but that's not available on the 28x2.
 

goom

Senior Member
There are various methods of measuring speed. The "best" method will depend upon various things such as:
What speed range will you be dealing with?
How often do you ant to update the speed reading?
How quickly do you expect the speed to change?
If you can answer these questions, I suspect that you will get some responses which make sense for your particular circumstances.
 

smeagol109

New Member

SAborn

Senior Member
The sensor you have is called a "Photo interupter" it simply means it requires something to break the photo beam.

One option would be to use the "count" function in picaxe, as that allows you to count pulses over a nominated time period, for example over 1 second.
This will not allow for a instant display of speed as it requires the 1 second to read the pulses then display the data.

Or you could use the "pulsin" function where it measures the time of the pulse length, and calculate a speed from that.

I use pulsin to read the speed of a wind turbine to display rpm, and also for anemometers to read wind speed.

Personally i think your project is not very practical to just use a pedal system as per the link with no loading applied.

Perhaps you should look to something like this http://www.thebackshed.com/windmill/articles/PedalPower.asp

Although i know noone who can maintain 1000W of energy for very long, 100 - 200 watts is realistic, and perhaps 400W for a short sprint , but not human maintainable for long.
 

techElder

Well-known member
smeagol109, you need to "do the math" so you are familiar with what is involved with the PICAXE program. Remember it probably isn't as simple as "revolutions divided by time equals RPM", because with INTEGER math you have to account for OVERFLOW conditions that might occur.

Do you want to create a working prototype or just demonstrate the concept of counting during a time period and presenting the results as RPM?
 

nick12ab

Senior Member
i just need help with the program because in my school we don't learn arduino language
"Arduino language" is C/C++ - did you learn that?

There are comprehensive resources available on the internet for Arduino.

The upload date of that image and the website it is hosted on suggests that it came from someone else's project which will have code associated with it - is this also on that website?
 
Top