Hi Everyone,
I have a project that is using a 5v Microcontroller (Sparkfun Pro Mini). It has the switch portion of a Rotary Encoder wired to pins 6 and 8. Pin 8 is INPUT_PULLUP and it's value is being read as a variable. Pin 6 is OUTPUT_LOW and is being used as the ground for this signal.
I want to use a second input on the same pins, however this input is coming from a 3.3v SAMD21 microcontroller. I tried just running a wire straight to pin 8 from the SAMD21, but it didn't work. I"m assuming the 3.3V arduino didn't have enough power to pull down the 5v signal from the Pro Micro.
So I thought a better Idea would be use a 2N2222 transistor from Pin 6 to Pin 8 and have the Base hooked up to an output from the SAMD21.
This worked in a quick bench test, but there was some strange delays and stuff and I realize its probably because I'm not doing right by the transistor.
So my question is: Do I need just a base resistor or more resistors? How do I calculate the base resistor? And I mean this from the perspective of an absolute beginner. I found formulas online but all the variables may has well been a foreign language. Rb is easy to translate, but hFe? I don't know what these mean or how to find those values. Is there some online textbooks I can read to understand this stuff a little better?
I have a project that is using a 5v Microcontroller (Sparkfun Pro Mini). It has the switch portion of a Rotary Encoder wired to pins 6 and 8. Pin 8 is INPUT_PULLUP and it's value is being read as a variable. Pin 6 is OUTPUT_LOW and is being used as the ground for this signal.
I want to use a second input on the same pins, however this input is coming from a 3.3v SAMD21 microcontroller. I tried just running a wire straight to pin 8 from the SAMD21, but it didn't work. I"m assuming the 3.3V arduino didn't have enough power to pull down the 5v signal from the Pro Micro.
So I thought a better Idea would be use a 2N2222 transistor from Pin 6 to Pin 8 and have the Base hooked up to an output from the SAMD21.
This worked in a quick bench test, but there was some strange delays and stuff and I realize its probably because I'm not doing right by the transistor.
So my question is: Do I need just a base resistor or more resistors? How do I calculate the base resistor? And I mean this from the perspective of an absolute beginner. I found formulas online but all the variables may has well been a foreign language. Rb is easy to translate, but hFe? I don't know what these mean or how to find those values. Is there some online textbooks I can read to understand this stuff a little better?
Attachments
-
109.1 KB Views: 21