Wire up anode to +5v or VCC on the H-Bridge, cathode to a resistor (between 100R and 300R) other end to ground on H-Bridge. Next the sensor. Emitter to ground (Another ground I have), collector to the Encoder B on H-Bridge then taking the out to the Arduino Digital Pin 13. I'm then reading the pin as an input.
I've not actually getting any output back. Does anyone have any ideas as to why not. Have I wired the sensor up correctly? Am I missing some resistors? Any ideas guys
Yes, that's wired right, but you will have problems because:
quadrature inputs are usually logic signals, not analog signals.
The pullup resistors are very low value for a phototransistor, too strong a pullup.
Its clear this unit is designed for an encoder with open-collector logic outputs, not
raw photo-transistor analog output.
To solve 2) you'll need to remove the built-in pullups, or better still route the quadrature
signals directly to your own board.
To solve 1) you'll need a conditioning circuit to cleanup the analog signals. This means
preset-pots as pull-ups to adjust the sensitivity (some experimentation needed) and
lots of hysteresis (74HC14 inverters are commonly used) to translate slow noisy analog
signal from the phototransistor to clean fast logic signals. Sometimes a little capacitance
can help cleanup the signal before the inverters, depending on how much noise is
present.
MarkT:
Yes, that's wired right, but you will have problems because:
quadrature inputs are usually logic signals, not analog signals.
The pullup resistors are very low value for a phototransistor, too strong a pullup.
Its clear this unit is designed for an encoder with open-collector logic outputs, not
raw photo-transistor analog output.
To solve 2) you'll need to remove the built-in pullups, or better still route the quadrature
signals directly to your own board.
To solve 1) you'll need a conditioning circuit to cleanup the analog signals. This means
preset-pots as pull-ups to adjust the sensitivity (some experimentation needed) and
lots of hysteresis (74HC14 inverters are commonly used) to translate slow noisy analog
signal from the phototransistor to clean fast logic signals. Sometimes a little capacitance
can help cleanup the signal before the inverters, depending on how much noise is
present.
Would it be simpler to just scratch the idea of running it through the H-Bridge and just create my own board using the correct resistors and the correct signal to wire to arduino? Rather than struggling with work around's for the H-Bridge?
So, all I would need to do is use that schematic and use the set-up I've got now and replicate that on a board. Then take the out from that to a pin on the arduino?