PDA

View Full Version : Photointerruptor circuit for spindle speed



Tom
24-11-2012, 06:50 PM
Hello all,
It's been a while since I was last here...

I'm in a world of hurt trying to wire up some form of spindle speed detection for a lathe.

I've got some Darlington photointerruptors (KTIR0121DS) which I think are the right thing for the job. I want to power them from a 5V supply, and sense the outputs on inputs to a parallel port (the PCPPS breakout board from DIYCNC).

Can anyone suggest the right circuit and resistor values for this?
I've made 3 versions now, and all of them seemed to work OK (swing from 0.6V to 5V when interrupted) until connected to the parallel port inputs. Once connected though the voltages were different, and only moved around 0.2V when interrupted, which is not enough to change the inputs.

I'm clearly doing something wrong, but after 3 attempts to start from scratch and recalculate, I haven't got things running...

Can anyone help?

Tom
24-11-2012, 07:08 PM
Here's the circuit I've arrived at. The resistance values are 100 ohm for the led, and 6800 ohm for the sensor. The signal gets connected to the parallel port.

What am I doing wrong?:thumbup:

Tom
24-11-2012, 07:31 PM
Here's a link to the datasheet:

KTIR0121DS datasheet pdf datenblatt - Kingbright Corporation - PHOTO-INTERRUPTER ::: ALLDATASHEET ::: (http://www.alldatasheet.com/datasheet-pdf/pdf/151393/KINGBRIGHT/KTIR0121DS.html)

Any pointers would be massively helpful...

i2i
24-11-2012, 08:04 PM
have a look here.

Need Encoder for threading (http://www.machsupport.com/forum/index.php/topic,21732.0/topicseen.html)

Tom
24-11-2012, 08:54 PM
Thanks for that. I've bitten the bullet and ordered some Optek OPB916B. It seems the processing circuitry is included, so should make life easier...

i2i
24-11-2012, 09:04 PM
cncdoctor makes an index pulse board which is perfect for this, but last time i looked he was out of stock.

Tom
24-11-2012, 09:10 PM
I recon those bits will do it... The cncdoctor board looks the business, but in the fullness of time I'm going to want spindle index, spindle pulse, x home and z home, so i was trying to do it simply and cheaply.

Back in the day I'd have sorted that KTIR0121 circuit in my sleep. All forgotten!

i2i
24-11-2012, 09:26 PM
i've used his board and it works well, but all you need is the sensor and the correct limiting resistor.

Tom
27-11-2012, 10:59 PM
Well, that was remarkably easy! 3 resistors, 3 sensors, a case, and an ethernet socket to carry the signals back to the control box. All working happily.

The only problem is I fried 2 inputs on the bob during my misadventures. Are there any options out there other than the diycnc bobs?

kingcreaky
27-11-2012, 11:17 PM
Worried about saying the obvious.... but have you ever used an Arduino? If I were doing what your doing; my initial tool would be an Arduino...

Apologies in advance if that is a useless comment.

Tom
27-11-2012, 11:37 PM
I have got an arduino, but I'm not sure it would add anything in this case. I'm just wiring 3 switches up to input pins on a parallel port. All the computing is done er... in the computer:)
The problem was my over confidence with electronics, but the sensors i2i pointed me to are much easier to use.

The arduino is great. I followed a guide on the web to make an RFID door lock. It still amazes me how simple it was when I use it.:)