Announcement

Collapse
No announcement yet.

What resistors should i use for this circuit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What resistors should i use for this circuit

    I have 2N2222A and TIP120 on hand, assuming my 2N2222As i got on ebay are complaint with the spec they should be fine for this having a max of 0.5A sustained and i have a 1n5817 forward voltage should be 0.32v

    This circuit is for me light strip i use for my keyboard, where my PICO will control the light based on a photocell and my magnetic switch MC-38 will pull the base of the transistor to 0v if my keyboard tray is pushed in all the way, meanwhile i have my override switch, the switch has 6 pins i would use 2 of each pair of 3

    note that the GPIO pin i on the other end of a 25' (~7.6m) ethernet cable, i have 3.3, 5, and 12v Rails generated at this end of the ethernet cable, pico gets power via 25ft speaker wire with a micro usb plug on the end so vdrop on the main power lines is not a issue, vdrop on the 3.3v gpio pin may matter
    Attached Files
    Last edited by evilkitty; 04-27-2023, 10:37 AM.

    #2
    Re: What resistors should i use for this circuit

    2N2222A if you get a real one is probably acceptable, I'd call it marginal and if you decide to increase the LEDs it'd be bad. 2N4401 is probably better. TIP120 will work for more cases.

    For 2N2222A/2N4401, 120-150 ohms for either, closer to 120 ohms for R1, 150 ohms is okay for R2.
    For TIP120, 1KΩ should do it for either R1 or R2.

    Comment


      #3
      Re: What resistors should i use for this circuit

      Thanks, 27.5mA on the gpio pin... I'll go with a TIP120

      Comment


        #4
        Re: What resistors should i use for this circuit

        No, it's not going to be 27.5mA, it's a bit less than that...but yes the TIP120 will reduce current flow.
        If you want to really push your luck and depend on the characteristics of the individual transistor you can go up to 270Ω or so, but at this point you'll be depending on the transistor's specific characteristics. You might have a bad one and it won't work too well.

        Actually know what, think i misplaced a decimal point... 1K-1.2K should work for the 2n2222 but still have the pushing it caveat...
        Last edited by eccerr0r; 04-27-2023, 09:06 PM.

        Comment


          #5
          Re: What resistors should i use for this circuit

          Originally posted by eccerr0r View Post
          No, it's not going to be 27.5mA, it's a bit less than that...
          when a switch pulls the transistor base down it will 3.3v GPIO -> resistor -> ground that would be max current draw
          Last edited by evilkitty; 04-28-2023, 08:08 AM.

          Comment


            #6
            Re: What resistors should i use for this circuit

            Nah it will be less than it because the transistor itself will not let all that current flow. However this is moot as I didn't do due diligence with units and tried to shortcut milli- and kilo- and it should work with 1K resistors for both R1 and R2, provided the 2N2222 is up to snuff and not fake (i.e. more like 2N4401 and less like 2N3904).

            Comment


              #7
              Re: What resistors should i use for this circuit

              Originally posted by eccerr0r View Post
              Nah it will be less than it because the transistor itself will not let all that current flow. However this is moot as I didn't do due diligence with units and tried to shortcut milli- and kilo- and it should work with 1K resistors for both R1 and R2, provided the 2N2222 is up to snuff and not fake (i.e. more like 2N4401 and less like 2N3904).

              did you look how my override circuit works? that circut works by jumping the base to ground before the diode, that would be max current draw, if it gets to the transistor it would be lower, but at 1k ohm that is not a concern

              anyway this is how my 2n2222a shows up on my tester, useful?

              is there a way i can test for the hFE? figuring out the hFE is the part i do not understand in the base formula
              Attached Files

              Comment


                #8
                Re: What resistors should i use for this circuit

                ah I see now, thought you would just open the circuit if you want to disable it, seems kind of silly to short it to ground.
                and beta/hfe depends on the current flow so whatever you read in those transistortesters are likely wrong for the situation you're using it in.

                Comment


                  #9
                  Re: What resistors should i use for this circuit

                  Originally posted by eccerr0r View Post
                  ah I see now, thought you would just open the circuit if you want to disable it, seems kind of silly to short it to ground.
                  yea only 8 wires for gpio as rather limiting... not sure if a mux IC would work with a variety of I/O types (also some of my stuff will be on different cores, and a everything on the mux chip would need to be on the same core)

                  my other 7 pins are allocated for use (fan, photocell, DHT22 data, DHT22 power, D18B20, LED, button)
                  • my DHT22s seem to glitch up and need to be power cycled


                  i could use hold times on the button for this... but i have interface preferences, and the MC-38 switch reads 1 when the magnets is near and i may not my keyboard tray fully extended to invert the logic, shorting the base to ground was the only way i could think of to use a closed switch to turn the light strip off, well i guess i could use a PNP transistor, but this seemed simpler
                  Last edited by evilkitty; 04-28-2023, 11:27 AM.

                  Comment

                  Working...
                  X