Split signal from encoder

I have a 512 pulses optical encoder with four wires: +5V, ChannelA, ChannelB, GND and I'm using it as feedback for my motor position (max 80 RPM) on Arduino UNO.
At the moment, everything works fine, but I need also to generate a +5V signal everytime ChannelA is HIGH as input for an additional Arduino UNO board. This signal will be used to trigger an action on the second Arduino board.
I was thinking to read ChannelA by using an optocoupler in order to split the signal and use it both for feedback and for the +5V signal. Is it possible?
Is there any other easier solution to do that?

This is the datasheet for the 16N136 optocoupler.

Thank you for your support!

I was thinking to read ChannelA by using an optocoupler in order to split the signal and use it both for feedback and for the +5V signal. Is it possible?
Is there any other easier solution to do that?

The first question anyone would ask is why do you think you need an optocoupler to send a signal from one UNO to another if they operate at the same voltage (TTL level) ? Do you feel like you need electrical isolation ?
And second, are you already aware that the opto inverts the logic. (high IN =>low OUT) ?
So you need to invert the logic to keep the logic state the same.
Someone else might wonder why you don't just read the encoder output with an arduino digital input and use
a separate pin to send a digital output to the second arduino ?
The only reason to use an opto is to add electrical isolation, which at this point , has not been justified.

Hi,
What are the specs of your encoder?
Does it have open collector output?

Can you post specs/data please?

Thanks.. Tom.... :slight_smile:

but I need also to generate a +5V signal everytime ChannelA is HIGH as input for an additional Arduino UNO board.

One might also question why you need two Arduinos?
It is often a mistake made by beginners to se the solution to not enough pins or wanting to do two tasks at once. This is not the solution to those sorts of problems.

Only about 2% of projects need more than one processor.

Thank you a lot for all your answers and support!

The encoder output is open collector and the second device is based on Arduino UNO, but it's not mine.
The second device is an additional third party device and it has not been designed by me so I have no access to it.

All I can do is to provide a +5VDC input to the second device each time channelA from my encoder is HIGH.

I do not need isolation since both boards works at the same voltage, I was just thinking about the optocoupler because it seemed the easier solution to me since I have no control on the second device and I would like to avoid to generate a HIGH signal on a different digital output pin on my Arduino UNO via software. I would like to find a circuit solution that automatically splits the encoder signal into two signals (one for my Arduino and the second one for the additional board).

I would like to find a circuit solution that automatically splits the encoder signal into two signals (one for my Arduino and the second one for the additional board).

The device you speak of is called a TTL buffer gate. This a gate that takes an input and generates an identical output without inversion (the type with inversion is , strangely enough, called an invereter). TTL logic electrical characteristics are such that there is almost no limit to how many buffers can be driven by a single input. The standard is 10 gates per input , but , obviously , since each added buffer can also drive 10 inputs ... well , you get
the idea. Sure , thee is a propagation delay , but what's 10 nS among friends , right ?
There are a variety of non-inverting buffer gates but the classic from the 70s is the 7407.
The post link function doesn't seem to be working so you have to Google "TTL 7407 IC"

raschemmel:
The device you speak of is called a TTL buffer gate. This a gate that takes an input and generates an identical output without inversion

I checked the datasheet for the TTL 7407 IC but may be I didn't understand very well how it works.
I got that it takes an input and provides a single open-collector output so it doesn't split the input into two identical outputs. It's like to connect both Arduino boards in parallel to the encoder output, isn't it?

You would be better off using a 74HTC04, these are a lot easier to get hold of these days, and do the job better.

so it doesn't split the input into two identical outputs.

But that is not what you want is it. The input to the buffer is your encoder signal into the Arduino AND into this buffer.

You have no need to split a signal.

Maybe the OP doesn't realize one TTL output can drive more than one input.

raschemmel:
Maybe the OP doesn't realize one TTL output can drive more than one input.

The problem is that I don't know how the open collector output is realized on the encoder circuit so I can't estimate what's the fan out for this signal. Do you think I can try to just connect both Arduino boards to the encoder output?
Sorry if my questions are too stupid :confused:

Sorry if my questions are too stupid

I don't recall anyone saying that they were. I simply observed that you may not be aware of it.
Looking at your OP, I don't see any vendor link to the encoder or any datasheet, so I don't know how we are supposed to know what the fan out is.

raschemmel:
I don't recall anyone saying that they were. I simply observed that you may not be aware of it.
Looking at your OP, I don't see any vendor link to the encoder or any datasheet, so I don't know how we are supposed to know what the fan out is.

Unfortunately, I do not have the model for the encoder since it is integrated in a motor device that I bought from a Chinese company. I asked for the datasheet and they only said me that it uses an open collector output.

An open collector needs a pull up resistor to make it work, so what resistor do you have? If you want to drive it into two Arduinos you can. You only need one pull up resistor.

Do you know what an open collector actually means?
It is a transistor with the emitter connected to ground, the base through a resistor to what is ever connected to the rotary encoder. And the collector connected to nothing.

So you can connect an open collector output to any voltage through a resistor and the collector will switch between that voltage or ground.

So connect the open collector to both inputs of the two Arduinos, connect the grounds together and have ONE pull up resistor to the 5V pin of one of the Arduinos.

Hi,

To produce two identical outputs from the TTL buffer, you input your signal to TWO of the buffer inputs, this way you have TWO independent outputs.

Tom... :slight_smile:

To produce two identical outputs from the TTL buffer, you input your signal to TWO of the buffer inputs, this way you have TWO independent outputs

I'm glad that's settled.

I finally was able to receive the specifications for the encoder:

It is a push-pull and the maximum output current is 25mA, maximum voltage is 5VDC.
Does this information change anything for my situation?

It is a push-pull and the maximum output current is 25m

Well that is not open collector is it.

Yes it makes a difference, no need for a pull up resistor. Simply connect the output to the input pins of both Arduinos putting it through inverters is not necessary and there is not much you gain from it. If you want a bit of isolation simply put a 1K series resistor on each input pin, but you do not need it.

It works very fine, I just connected the output for the additional Arduino board in parallel with the encoder output and the Arduino UNO.

The output is always HIGH (+5VDC) until I start to spin the wheel and then it outputs a square wave.

It seems to work as expected, thank you for your assistance!