question about digital sensors interface with MCU

Thread Starter

Saeedk9574

Joined Jan 1, 2024
35
Hi everyone,
I am working on a GSM SMS relay controller and I have a question about interfacing of digital sensors (like motion detector, smoke detector, and so on) with MCU. When I see the similar boards they have used optocouplers to connect these digital sensors to the microcontroller, however these sensors have a common ground with the controller board. So we wont have isolation with optocoupler because of the common ground. My question is while there is no isolation why we do not use a simple transistor instead of optocoupler?


View attachment 194572
 

Ian0

Joined Aug 7, 2020
13,117
Good point.
There is no need to use an isolator when there is no isolation.
Make sure that the output voltage from the sensor is compatible with the input voltage of the MCU pin, and protect the pin from any interference pickup in the wiring.
You might not even need the transistor.
 

cmartinez

Joined Jan 17, 2007
8,749
Maybe the designer was trying to protect transients from going into the MCU's input pin by using the optoisolator. There are better, simpler and cheaper ways to accomplish that, though.
 

nsaspook

Joined Aug 27, 2009
16,275
Maybe the designer was trying to protect transients from going into the MCU's input pin by using the optoisolator. There are better, simpler and cheaper ways to accomplish that, though.
Correct but the opto's are pretty good (breaking the conducted transient energy path with no capacitive or inductive coupling for radiated transient energy) at transient protection with dirty signals in systems with things like alternator power and lots of inductive devices, One jumper or solder pad on a PCB design can make them isolated or not, so it's a very common design on power control I/O modules. I sometimes use them as protection for controllers that doesn't have robust I/O protection.
 
Top