Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Clarification Request - 3.3v logic w/ 5v power to 2946
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Clarification Request - 3.3v logic w/ 5v power to 2946

by eph123 on Mon Aug 24, 2020 10:54 pm

Hmm ok, so to use the canal analogy, this is my expectation of what would be at work:

There is a valved culvert (transistor gate) and a weir (LED) in the canal.
The weir is downstream from the culvert.
Canal start is a known width (IS31FL3731 I/O pin = 34mA) and height (VCC = 3.3V) above sea level.
The culvert is connected to a pipe, which passively diverts excess water, flowing downhill from the start of the canal (3.3V) to the ocean (0V).
The weir is an unknown width (current across the LED) and an unknown height (3.3V - fV of the LED) above sea level.
Canal end is a known width (Rext = 20kmA) and unknown height x (3.3V > x > 3.3V - fV of the LED) above sea level.
The culvert's valve is controlled by a cable, which is hooked to a bobbin that floats at the height of the water at the end of the canal.
When the end of the canal is "full" (x @ 20kmA), the bobbin pulls the cable taught, and the flood valve is open, lowering the height of water before the weir.
When the end of the canal is not full, the bobbin's cable is slack, shutting the flood valve.
As a result, though the weir's height is unknown, the culvert ensures that just enough water goes over its top (about x @ 3.2mA) in order to keep the end of the canal "full".
Also, this means that the height of the water (V) isn't enough to damage the weir (doesn't exceed its max fV value, whatever it may be).

Am I close at all? Or totally off?

eph123
 
Posts: 11
Joined: Sat Aug 08, 2020 8:32 pm

Re: Clarification Request - 3.3v logic w/ 5v power to 2946

by adafruit_support_mike on Tue Aug 25, 2020 11:31 pm

You're pretty close.

The idea of sending excess water somewhere else doesn't correspond to anything in electronics, and creates some problems that will lead you astray. A more accurate model would replace the river with a pair of reservoirs and a pump:

The pump draws water out of the lower reservoir and sends water into the upper one. The pump is regulated to keep the water level in the upper reservoir 5m higher than the level in the lower reservoir. The total amount of water in the system remains constant, so you don't have to deal with the 'excess water' implied by a river.

The reservoir-and-pump model actually describes one of the fundamental rules of electronics, called Kirchoff's Voltage Law (KVL): the total distance the water level falls when flowing from the upper reservoir to the lower one has to equal the distance the pump raises water from the lower reservoir to the upper one. In the language of electronics, the sum of all voltage drops around a current loop has to equal the sum of all voltage sources in the same loop.

The idea really is as simple as it sounds: the water can only fall as far as it rises. Proving that a physical system obeys that rule is more complicated.

The other fundamental rule of electronics is Kirchoff's Current Law (KCL): the total amount of water that flows out of a chamber has to equal the amount of water that flowed into it. Again, the basic idea is simple enough: the chambers can't make water appear or disappear from nowhere. The hard part is proving a physical system behaves that way. The 'extra water' implied by a river violates KCL: the upstream part of the river seems to create water out of nowhere (and thus needs extra pipes to handle that water), and the lower part seems to make water disappear.


So.. using the reservoirs-and-pump model to explain how water at one end of the system is 5m higher than water at the other end, your idea of a weir and valved culvert works quite well. The height of the weir is a good analogy for an LED's forward voltage.. water can't flow past the weir until the water level is higher than the weir. The valved culvert is a very good model for a transistor. A signal controls the valve, and the valve controls the amount of water that can flow through the culvert per second.

In one version of a current source, the culvert (transistor) sits above a chamber whose width (resistance) is known. That chamber has a float that controls the culvert's valve, and the float can be set to a given level. The float opens or closes the valve by an amount proportional to the difference between the target value and the actual water level in the chamber. If the water level is too high, the float closes the valve. If the water level is too low, the float opens the valve.

That produces what's known as a 'negative feedback loop' working to keep the water in the chamber at the correct level.

We can model the I31FL3731's 20k resistor with another set of chambers between the 5m and 0m reservoirs. The lower one is the same length as the one below the culvert, but is only 1cm wide for every 1m of width in the main chamber. That chamber also contains a float (call it FL2), and the float in the main chamber (FL1) wants to stay at the same height as FL2.

You can control the water level in the narrow lower chamber by controlling the width of the chamber above it. The I31FL3731's 20k resistor is equivalent to that narrow upper chamber.

adafruit_support_mike
 
Posts: 61443
Joined: Thu Feb 11, 2010 2:51 pm

Re: Clarification Request - 3.3v logic w/ 5v power to 2946

by eph123 on Wed Aug 26, 2020 10:17 pm

I did some reading and video watching of how transistors physically work, and between your clarifications of my analogy and what I learned last night, I think I have the start of a good intuitive understanding of what would be going on. I think I understand now why I don't have to worry about the fV of the LEDs, nor need an extra resistor on any of those LEDs, beyond what the 2946 already has for Rext (via the current source you described). As long as the LED fV is below 3.3V, I'll pretty much be fine.

I think I pretty much have everything figured out now. I just have a few more parts to hunt down, and I think I can start purchasing the components on my BOM for this keyboard.

Mike, thank you a ton for the assistance you provided. I learned an enormous amount from you, and can't thank you enough for helping me develop an understanding of what I was looking at. I found your skill in educating on this subject to be superb. Thanks, and have a fantastic week!

eph123
 
Posts: 11
Joined: Sat Aug 08, 2020 8:32 pm

Re: Clarification Request - 3.3v logic w/ 5v power to 2946

by adafruit_support_mike on Thu Aug 27, 2020 4:02 am

Hey, I had fun doing it. ;-)

One explicit part of my job description is to help people learn technology. That means developing intuition alongside learning the formalism (aka: symbolic languages like mathematical equations, schematics, etc). Both are absolutely necessary if you want to get very far.

60% of the reasoning in tech is done on (continuously better trained) intution, 20% is spent using the formal methods to put that intuition under a microscope, and the last 20% is spent trying to develop intuition into things the formal system says are valid, but we don't really get (yet).

If intuition is how well you know your house in the dark, formalism is your flashlight. Unfortunately formalism is a *lot* easier to mass-produce than intuition, and you don't really need to understand it yourself to repeat what you found in a reference somewhere. So resources that want to teach have a strong tendency to wade nose-deep into the math (especially calculus.. it's a great way to say "look how smart I am") without ever explaining what all those symbols mean.

When you came up with your own metaphor, I was thrilled. It meant you were thinking, and giving me a vocabulary I could use to help you tune the metaphor.. a day when I can explain KVL and KCL in terms regular humans can understand is a damn good day in my book. ;-)

This conversation has been pure abstract science: proposing and testing ideas to build a model that provides useful descriptions for some part of the world. Doing it without all the trappings just meant I could focus on the fun stuff.

adafruit_support_mike
 
Posts: 61443
Joined: Thu Feb 11, 2010 2:51 pm

Re: Clarification Request - 3.3v logic w/ 5v power to 2946

by eph123 on Thu Aug 27, 2020 8:48 pm

Agreed; formalism is why I was never good at math; my education wasn't really able to answer my questions about "why" it worked, just that it did, and here's the formula. Well thanks, but that doesn't enhance my ability to work with it outside of rote memory, also known as being able to employ an understanding in practice. In our discussion, and some extra reading I'd been doing on the side, KVL and KCL make perfect sense to me, more or less as an extension of the Law of Conservation of Matter. If I were to work with a formula for KVL or KCL now, I'll not only be able to use the formula to perform a calculation, but I'll understand what's actually happening, which to me is a lot more important.

You're really good at what you do, and I'm glad we had a chance to speak. Hope you have a fantastic weekend when you get there!

eph123
 
Posts: 11
Joined: Sat Aug 08, 2020 8:32 pm

Please be positive and constructive with your questions and comments.