K8055 and reading an rpm signal?

Have you got any means to check the signal from the sensor?
You may test the operation of the flip-flop by feeding there any 5V pulses.

Hi thanks for the reply

i am able to test the sensor by just wiring it to the 8055 - it works fine so the problem must be the flip flop

i will try giving it a 5v pulse manually and see what happens

Today i tried an optical trigger wheel

50% light / 50% dark

can you see any reason why this sensor would not work triggering the 8055 counter digital input 1

images.maplin.co.uk/full/c2282.jpg

This should work with the K8055 digital input.
Maybe the phototransistor is not getting good reflection from the wheel…
You may easily use a multimeter and check the collector voltage of the phototransistor when the collector is connected to the K8055 input. The voltage should go down near to zero when the light is reflected to it.
The emitter should be connected to the GND terminal of the K8055.

It seems the LED of the sensor needs external resistor and a power supply.
Do you have a data sheet to see what value the resistor should be?

not got a datasheet on this one

i had the collector connected to 5v and emitter to dig 1 - was this wrong ?

can you recommend a good sensor, will have to buy a new sensor anyway - i tried reversing the cathode and anode and blew the led :frowning:

would either of these be ok ?

uk.rs-online.com/web/search/sear … m_vc=av_uk

uk.rs-online.com/web/search/sear … &R=4550975

thanks again for the support

[quote]i had the collector connected to 5v and emitter to dig 1 - was this wrong ?[/quote]The K8055 digital inputs have internal pull-up resistors to +5V. The external device (transistor) should pull the input down.
The right coupling (with NPN) is:
Collector to the digital input.
Emitter to GND.

I’ll check the sensors you suggested.

It seems both of the sensors you suggested may be OK.
There is more complete data available for the first one, OPB608A.
The On-State Collector Current is specified and it is high enough for the K8055.

For the second one there is no such specs.
Anyhow it is said to be “high-sensitivity” - so probably OK too.

thanks for the advice at this hour !

what do you think of this one - more expensive but might be worth it

drillspot.com/products/71358 … cal_Sensor

According to the datasheet the output seems to be OK to connect to the K8055 digital input.
“Signal (+V to 0 Vdc Pulse)”

It seems you need also: “T-5 Reflective Tape”.

Please see the datasheet how this sensor should be mounted and used:
monarchinstrument.com/pdfs/m … 4-118R.pdf

i have found setting the debounce time to zero has enables the 8055 to read higher frequency pulses

shame it has taken this long to sort it out

i would have expected a debounce of 2ms would have worked fine (default)

are you sure the default is 2ms and not longer ?

It’s good to see that you got the system working!

[quote]are you sure the default is 2ms and not longer ?[/quote]According to my test the debounce time is quite accurate.
At the default 2ms debounce time the card can count up to the frequency of 220Hz (pulse width 2.3ms).
At zero debounce time the card counts up to 2kHz

does it read a shorter pulse width when the debounce is set to zero ?

[quote]does it read a shorter pulse width when the debounce is set to zero ?[/quote]Yes, it can. The pulse width (high and low) must be anyhow longer than 0.25ms.
At the max. frequency 2kHz the duty cycle must be 50%.
To get this frequency counted the debouce time must be set to zero.

i am using windows to meaure the time between pulses and have found it to be not too accurate

it is possible to attach an accurate timer circuit to the other couter channel and count the number of pulses for time measurement

can you suggest a good circuit for time counting

regards

You can use the PWM output as a frequency reference.
The frequency is fixed 23437.5Hz.
If you still have the counter IC 74HC4024, you can use it as a frequency divider.
By dividing the PWM frequency by 32 you get 732.421875Hz.
Feed this signal to the K8055 counter #2 input and use it as a reference in your program.

To get some PWM signal out, you have to set to the analog output #1 some value:

OutputAnalogChannel(1,128)Also remember set the debounce time of the pulse counter #2 to 0:

SetCounterDebounceTime(2,0)


You can get the +5V from the “upper” pin of SK2.

thanks again for the advice

so the frequency from the from the pwm is too fast for the counter ?

will it not just read at the maximum of 1khz ? that may be good enough for what i want to do

regards

Yes, the K8055 counter can count max. 2kHz.
Using the PWM output frequency 23.4375kHz divided by 16 you get 1.4648kHz.
This is also OK for the K8055 counter.
The debounce time must be set to 0.

i found that by changing the output of analogue 1 to

OutputAnalogChannel(1, 141)

the frequency generated was approx 500 pulses per second

is gives an accuracy of 0.002 ms which is good enough for this application

are the analogue inputs sensitive enough to read the output from a type K thermocouple ?

is there another type of sensor i could use instead like a LM35 (but with a slightly higher temp range)

thanks in advance

[quote]are the analogue inputs sensitive enough to read the output from a type K thermocouple ?[/quote]No. The type K thermocouple gives only a couple of mV at the “normal” temperature range. At 1000°C, about 40mV.

[quote]is there another type of sensor i could use instead like a LM35 (but with a slightly higher temp range)[/quote]I think the LM35 is a good choice. The output voltage is 1.5V at 150°C.
To get the best resolution you have to increase the K8055 input amplifier gain to 3. Then you get nearly full scale voltage, 4.5V at 150°C.