Author Topic: LTV-846 & ATMega Port  (Read 763 times)

0 Members and 1 Guest are viewing this topic.

Offline Quarlo KlobrigneyTopic starter

  • Frequent Contributor
  • **
  • Posts: 968
  • Country: pt
  • This Space For Rent
LTV-846 & ATMega Port
« on: December 08, 2021, 06:50:04 am »
LTV-846 & ATMega Port or what stupid thing am I doing |O

I have a 12VDC source feeding the diode input to an optocoupler via a 560Ω resistor.
The diode cathodes to ground.
The input to the AVR ports are inputs and their prospective pullups are on.
The emitters of the opto transistors go to ground. The same common ground as the AVR.
What I see :scared: is 12VDC on the port inputs!

WHY???
« Last Edit: December 08, 2021, 06:54:15 am by Quarlo Klobrigney »
Voltage does not flow, nor does voltage go.
 

Offline jwet

  • Frequent Contributor
  • **
  • Posts: 535
  • Country: us
Re: LTV-846 & ATMega Port
« Reply #1 on: December 11, 2021, 04:00:57 am »
The ground for two sides shouldn't be shared- this is whole idea of an opto isolator.  The LED cathodes on the left should all return to the 12V supply.  The emitters on the right should all return to your micro controller ground.  The only coupling should be the photons that are lighting up the transistors.  The ground of your 12V system has no relation to the ground of your AT Mega.  This is exactly why optocouplers are useful, they can bridge different ground domains.  Their isolations specs (5000V for the LTV-846) is the difference in ground that they can handle.  With the two grounds tied together, you're defeating the purpose of having an opto coupler.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf