i was thinking about the idea of implementing a remote control idea based on optocouplers, from one Arduino to another Arduino.
The idea is to simulate remotely the action on a Joystick, for example i move the joystick up, and then i root a signal to another Arduino to simulate i did a move. This will be done via software and isn’t the principal target of the question.
My question is about the scheme below, where i thought i needed to give 5v to the optocoupler to work with a pullup resistor, but it still works with the small current transfered into the phototransistor.
Can tell me someone, if this is right to do or i need to add other components to be sure about the right working of the optocoupler.
If you go with the schematic, you will need a current limiting resistor between the Arduino 1 output and the LED of the optocoupler. You can use the internal pull-up on the Arduino 2 input pin or use an external pull-up resistor.
The project is bigger than just the optocoupler, so i want to isolate both because dont want to have a common ground. I mean i have more integrated circuits in other places, that doesnt relate to the circuit part of the optocoupler.
I know i can just use directly connection, but it isnt 100% safe to do, it need to be a completely for dummies system. Maybe someone without knowing how it works can configure a pin as output or viceversa when it should have to.
With the schematic i posted, im getting an high level on Arduino 2 Side when it is low on Side 1 and viceversa. Because, Arduino is capable of read a very low current passing transfered by the phototransistor.
Actually, i got a limiting current resistor on Arduino UNO, i forgot to put it in the schematic. My bad.
About Arduino 2, i will make something like the figure below with a greater pull-up resistor. Anyway i still get confused, about the 5v + pull-up resistor. Just want a good answer to put it in this case.