Welcome! Log In Create A New Profile

Advanced

Workings of the opto endstop v2.1 (calling electronics gurus)

Posted by AgeingHippy 
Workings of the opto endstop v2.1 (calling electronics gurus)
May 20, 2010 11:51PM
Hello All

I am trying to learn electronic theory and have done some reading. A lot of what I have read is seems very esoteric (is that the correct word), so I do not understand yet how circuits work and am being befuddled by circuits with loads and loads of resistors in them.

As reference use the opto endstop 2.1 diagram

I have finally determined that the resistor's purpose is to limit or control the flow of current, so in many cases (when linked in series) it is to limit the amount of current that will pass through the device it is in series with. For example R3 will protect the LED and R2 protects the HL210B.

What confuses me is the purpose of R1 which links the output pin with Vcc???

Sorry if this is elemental, but I would like to understand why the boards work.

In addition, pins 4,5 and 7,8 are attached to Vcc and Ground respectively but the diagram also indicates Vcc and Ground connections. Are those connections just for clarity or are they also links to the power source? My gut feel and investigation makes me think they are just for clarification. But then when would these symbols actually indicate a physical connection is required there?

Finally, I assume pins 2 pins, hence 2 wires are each used to carry Vcc and Ground to prevent the cable heating up?

Thanks
Re: Workings of the opto endstop v2.1 (calling electronics gurus)
May 21, 2010 01:44AM
R1 acts as a pull-up resistor.

The H21LOB uses an open collector output, so when the output is supposed to be low, the output transistor is turned on (causing the line to go low). However, when the output is supposed to be high, the transistor turns off and the output "floats". R1 is what causes the output to go high when the transistor turns off.
Re: Workings of the opto endstop v2.1 (calling electronics gurus)
May 21, 2010 09:39AM
Hi madscifi

Thanks for that. Now I have learned about pull-up and pull-down resistors and also have an idea how the H21L0B works... vaguely smiling smiley

I assume when you say the output "floats" that means the output is indeterminate and is therefore needs to be 'pushed' high by the connection to Vcc via R1?

I was wondering what the anode and cathode connections were for - now see they are there to power the internal LED. The current flows constantly through R2 which limits the current to 22.7mA maximum. possibly less if taking the internal resistance into account?

So when the opto-switch is open VO is pulled high to Vcc (5v) and some current flows through VO (ultimately) towards the Atmega344p on the motherboard which will throw the ENABLE switch if required. In this instance there is now no flow through R3 and the signal LED1. Now I am not clear if current actually flows to the Atmega344p or if the voltage is simply set with no current flow??

Now when the switch is closed, VO is pulled Low by closing the open transistor in HL21L0B causing current to run through it which means current runs from Vcc through the LED1 and R3 lighting LED1. Also, because R1 is so high in relation to LED1 and R3 minimal (maybe negligible) current runs through R1.

Now when VO is pulled low it means the voltage at VO is somewhere between Vcc and Ground? This is implied by the fact that there must be a voltage drop across the LED1 and R3.

confused smiley My brain is hurting. I do not understand when current flows and when a simple potential difference exists. I guess I have a long way to go.

cheers
Re: Workings of the opto endstop v2.1 (calling electronics gurus)
June 13, 2010 02:15AM
AgeingHippy Wrote:
-------------------------------------------------------
> So when the opto-switch is open VO is pulled high
> to Vcc (5v) and some current flows through VO
> (ultimately) towards the Atmega344p on the
> motherboard which will throw the ENABLE switch if
> required. In this instance there is now no flow
> through R3 and the signal LED1. Now I am not clear
> if current actually flows to the Atmega344p or if
> the voltage is simply set with no current flow??

The input of the atmega "looks like" a (very small) capacitor, so some current will flow while it charges up to vcc, then none will flow.

> Now when the switch is closed, VO is pulled Low by
> closing the open transistor in HL21L0B causing
> current to run through it which means current runs
> from Vcc through the LED1 and R3 lighting LED1.
> Also, because R1 is so high in relation to LED1
> and R3 minimal (maybe negligible) current runs
> through R1.

yep, current through R1 is negligible, but there has to be at least a little bit to charge the atmega's input capacitance.

> Now when VO is pulled low it means the voltage at
> VO is somewhere between Vcc and Ground? This is
> implied by the fact that there must be a voltage
> drop across the LED1 and R3.

"low" means it's being held at less than about 1 volt. usually safe to assume it's being held at ground. c-e voltage of a saturated transistor is usually less than 0.3 volts.

The transistor in the sensor pulls the output low when the light from the LED shines on it. So, your indicator led should be lit when there's nothing in the sensor, and go out when something blocks the light from the LED.


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Sorry, only registered users may post in this forum.

Click here to login