Hi all
I'm using a Wemos D1 mini and a HC-SR04 Ultrasonic sensor to detect object proximity.
The Wemos outputs HIGH or LOW to a digital pin if the object is within or out of range
I need to take this output (3.3v) from the Wemos and use it as an input on the Rasberry GPIO
I have found a 6N138 optocoupler that I believe is adequate
https://www.onsemi.com/pub/Collateral/HCPL2731-D.PDF
From my calculations, the emitter operates at 1.3v @ 1.6mA
3.3v-1.3v=2v
2/0.0016=1250 Ohm
I have used this to obtain a resistor value of 1.5K
I would also like the raspberry pi input to be pulled down to ground to avoid floating values.
Have I calculated correctly and is my schematic correct?
Many thanks