Announcement

Collapse
No announcement yet.

resistor values for 2n2222a w/ SSR

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

    resistor values for 2n2222a w/ SSR

    So if I take a 2N2222A transistor and a G3MB-202P relay and 3.3v logic controller

    What resistor value should I be using for the base? Normally i would just take a ~1k resistor and go, but i need to work every time and not fail

    The problem I am trying to solve: my dad hates 3 way switches (he is not even the one wiring them) and insist on the only way to get through a room at night is to turn the light on, go to the other side of the room and turn that light on, go back and turn the 1st light off, then go back again and turn that light off, screw that I'll make a software light switch that uses door sensors (more reliable than a motion sensor working)

    -----------------------

    second question if i use the same logic wire can i make a double throw SSR switch by using 2 of these one on a 2N2222A and a P2N2222A or would i have issues with overlap there both are on/off at the same time (not sure if that is even a issue for my thermostat)
    Attached Files

    #2
    Re: resistor values for 2n2222a w/ SSR

    most ssr's use an optocoupler and can run down to 3v
    to answer the question, you need to find out how much current the ssr needs, then look at the 2n2222 hfe and then you can calculate the current.
    ir just experiment starting with 10k

    Comment


      #3
      Re: resistor values for 2n2222a w/ SSR

      a PIR sensor on the ceiling works well btw, i have done it on a staircase once

      Comment


        #4
        Re: resistor values for 2n2222a w/ SSR

        The relay pulls 7.5mA when wired to my usb port, so what resistor range/value be?

        i know there is a formula, but i am not sure what values to use


        note that my final circuit will be using 5.2-5.35v, however there will be around 25-30 ft of telephone wire to the relay

        -------

        as for the second part of the question, it seems i have 2N3906 for PNP, would (would have issue with a double on for state for a moment?) this work see attachment
        maybe i need a schottky diode on the PNP base?

        again not sure what resistor value to use
        Attached Files
        Last edited by evilkitty; 11-26-2022, 10:13 AM.

        Comment


          #5
          Re: resistor values for 2n2222a w/ SSR

          It looks you're just using common ground level shifting you need NPN transistors and the PNP probably is not useful here if you can't get the shifted voltage elsewhere.

          Since the relay is only 7.5mA (and will be even less current with the 30ft wire plus transistor saturation voltage) you don't need to current limit collector, and you don't need much base current to keep the driving transistor on. A 1K base resistor should be sufficient for even weak 2n2222a's and you can do 470Ω if you want to pound the transistor even more.

          Comment


            #6
            Re: resistor values for 2n2222a w/ SSR

            The Omron G3MB-202P DC5 relay is an SSR, which is basically an LED and 440Ω resistor inside (for the 5V model) and roughly around 10mA load.
            With a lazy 2N2222 beta of 75, base-drive 2.6kΩ or lower would be plenty, and 1kΩ is fine. The RP2040 GPI/O's output 3.3V and typ. 4mA but note their are settings gpio_set_drive_strength can also move it from 2,4,8,12mA in software.
            You need an NPN to keep the higher SSR voltage away from the RP2040.

            Comment


              #7
              Re: resistor values for 2n2222a w/ SSR

              Thanks, now i know what resistor to use for my DIY smart light socket

              Now as for that dual relay setup, i want to emulate the logic of my mechanical relay (SPDT)

              PNP and NPN transistors have opposite switching characteristics

              i have access to my data pin, 3.3v, 5v, and ground and very little pcb space

              Comment


                #8
                Re: resistor values for 2n2222a w/ SSR

                Use another npn transistor as an inverter... or use another gpio pin and do the same except write it with the opposite phase...

                Comment


                  #9
                  Re: resistor values for 2n2222a w/ SSR

                  BTW thought PN2222A TO92 pinout was E-B-C when looking at the flat face with pins pointing down... that picture was really bothering me beyond just the lack of details...

                  Comment


                    #10
                    Re: resistor values for 2n2222a w/ SSR

                    just used a random npn transistor i found on google images

                    i already modded my ethernet cable to have 9 conductors, getting a 10th is not happening

                    Comment


                      #11
                      Re: resistor values for 2n2222a w/ SSR

                      I am not shure that your problem is clear to me, but maybe you can consider a implementation of some logic gates, that if two switches in opposite side of room is in same state there is no light, else it is. In this case, wire can be a small diameter and easely 'glued' on wall with (in) wall paint.
                      Attached Files

                      Comment


                        #12
                        Re: resistor values for 2n2222a w/ SSR

                        I'm not sure what you are trying to make - "... can i make a double throw SSR switch..." I take to mean DPST? This is like connecting the two SSR inputs in parallel, so the one 2N2222 powers both at the same time.
                        If you want a SPDT switch then you need another transistor.
                        You want to make one end of a 3-way light switch?

                        Comment


                          #13
                          Re: resistor values for 2n2222a w/ SSR

                          why not use cordless switches??

                          Comment


                            #14
                            Re: resistor values for 2n2222a w/ SSR

                            Originally posted by stj View Post
                            why not use cordless switches??
                            did not know that was a thing... well i have the relay installed and wired at this point and i can make the smartest auto light you have ever seen on my pico now (photocell, door sesnors/switch input as well as buttons at each door)

                            Originally posted by redwire View Post
                            I'm not sure what you are trying to make - "... can i make a double throw SSR switch..." I take to mean DPST? This is like connecting the two SSR inputs in parallel, so the one 2N2222 powers both at the same time.
                            If you want a SPDT switch then you need another transistor.
                            You want to make one end of a 3-way light switch?
                            i want to make a SPDT out of 2 SSR relays for my thermostat that has had a few of those mechanical cheap blue relays die (so when the next one fails i can permanently fix it)

                            all i needed to know for the light switch problem was the base resistor value (Thanks redwire)
                            the issue was my dad hates 3 ways and so he does not want them installed (i think they confuse him somehow), well since i am installing a pico in this room i figured i would make a smart light so i can have a light to use to get though the room without relying on any switches, he had to use these super old T12 8 ft fixtures (from ~1995 new in box he never got around to installing), i checked the power draw with my clamp meter... 540 watts for 2 fixtures, he plans to have four and another four 4ft fixtures and there are another 4 light bulb sockets fixtures on this circuit, good thing we replaced that piece of 14awg on the 20 amp circuit from the panel (everything else was 12awg)

                            Comment


                              #15
                              Re: resistor values for 2n2222a w/ SSR

                              https://www.youtube.com/watch?v=abJCIgRKQk0

                              https://www.youtube.com/watch?v=9Pw7U0XFgUM

                              Comment


                                #16
                                Re: resistor values for 2n2222a w/ SSR

                                This should work in theory, still not sure about about the resistor values, but there are some issues
                                • debug led has 1.95 fV, maybe i should just put 1 led in the 3.3v logic (or the 5v logic), with a mechanical relay i could just put it in parallel with the relay, but with a SSR i would only expect the device with a lowest forward voltage to turn on
                                • not sure about resistor values
                                • when logic goes high i think both relays will be on for a ~250ns
                                  • off-off is fine
                                  • on-on could be a issue, not sure if my HVAC cares but it could (even if it does i doubt that is long enough to be a issue, but idk)


                                2n2222A has a turn on time of 35ns and a turn off time of 300ns
                                Attached Files
                                Last edited by evilkitty; 11-28-2022, 12:56 PM.

                                Comment


                                  #17
                                  Re: resistor values for 2n2222a w/ SSR

                                  That would work, I tried to do it with two transistors but it would be finicky so I did not post the idea.
                                  The debug LED's lose too much voltage though, so the SSR does not get enough voltage. You have 5V subtract the debug LED let's say 2.2V and 0.1V for the transistor on, and that leaves 2.7V but the SSR minimum is 4V. So you would move the debug LED to be in parallel with the SSR drive (adding a resistor for the LED like 1k).
                                  The intermediate transistor can use high resistor value say 10k on the base, and no need for the second R2 at the base. R2 to 5V still around 2.2k

                                  Comment


                                    #18
                                    Re: resistor values for 2n2222a w/ SSR

                                    Bump
                                    Last edited by sam_sam_sam; 11-28-2022, 07:53 PM.
                                    9 PC LCD Monitor
                                    6 LCD Flat Screen TV
                                    30 Desk Top Switching Power Supply
                                    10 Battery Charger Switching Power Supply for Power Tool
                                    6 18v Lithium Battery Power Boards for Tool Battery Packs
                                    1 XBox 360 Switching Power Supply and M Board
                                    25 Servo Drives 220/460 3 Phase
                                    6 De-soldering Station Switching Power Supply 1 Power Supply
                                    1 Dell Mother Board
                                    15 Computer Power Supply
                                    1 HP Printer Supply & Control Board * lighting finished it *


                                    These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                                    1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                                    2 Hem Saw Computer Stack Board

                                    All of these had CAPs POOF
                                    All of the mosfet that are taken out by bad caps

                                    Comment


                                      #19
                                      Re: resistor values for 2n2222a w/ SSR

                                      Originally posted by evilkitty View Post
                                      i want to make a SPDT out of 2 SSR relays for my thermostat that has had a few of those mechanical cheap blue relays die (so when the next one fails i can permanently fix it)
                                      I would suggest the following

                                      What is the voltage to the blue relays I am guessing that they are 5 volts if they are you can use a 4N25 with a drop down resistor for each relay coil power and then use the 24 volts from the transformer of the air conditioner or use much better relays or a SSR on separate board in an enclosure

                                      Do not be tempted to use the power of the thermostat electronic output directly to power your up graded relays or SSRs this not good idea because these thermostat boards are very easily damaged by voltage spikes and static electricity and some of these thermostat are not cheap sometimes over $100.00 depending on the features that it has

                                      One note if you go this route please make sure that the thermostat still function correctly before attempting to do this upgrade

                                      I had a customer that had one of these electronic thermostat that had a relay issue but also had an issue with the outside temperature sensor not reporting so they want to replace the thermostat so I got them a replacement thermostat but unfortunately it would not operate the defrost function correctly because this one of those air conditioning units that has to use a special thermostat

                                      But a few months later the compressor would not turn on now the real issue was that the thermostat wires were so full corrosion that wires were coming apart after running new thermostat wires I was able to get back the outside temperature sensor function and the heating issue and the cooling issue with there original thermostat that I thought was the issue because I know about the relay issue that these thermostat have
                                      Last edited by sam_sam_sam; 11-28-2022, 08:21 PM.
                                      9 PC LCD Monitor
                                      6 LCD Flat Screen TV
                                      30 Desk Top Switching Power Supply
                                      10 Battery Charger Switching Power Supply for Power Tool
                                      6 18v Lithium Battery Power Boards for Tool Battery Packs
                                      1 XBox 360 Switching Power Supply and M Board
                                      25 Servo Drives 220/460 3 Phase
                                      6 De-soldering Station Switching Power Supply 1 Power Supply
                                      1 Dell Mother Board
                                      15 Computer Power Supply
                                      1 HP Printer Supply & Control Board * lighting finished it *


                                      These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                                      1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                                      2 Hem Saw Computer Stack Board

                                      All of these had CAPs POOF
                                      All of the mosfet that are taken out by bad caps

                                      Comment


                                        #20
                                        Re: resistor values for 2n2222a w/ SSR

                                        Originally posted by sam_sam_sam View Post
                                        What is the voltage to the blue relays I am guessing that they are 5 volts if they are you can use a 4N25 with a drop down resistor for each relay coil power and then use the 24 volts from the transformer of the air conditioner or use much better relays or a SSR on separate board in an enclosure
                                        just 5v songle relays i got for ~0.25 each


                                        Originally posted by sam_sam_sam View Post
                                        Do not be tempted to use the power of the thermostat electronic output directly to power your up graded relays or SSRs this not good idea because these thermostat boards are very easily damaged by voltage spikes and static electricity and some of these thermostat are not cheap sometimes over $100.00 depending on the features that it has
                                        Are you talking about the board in the HVAC unit? if you are talking about inside my thermostat, i have VERY dumb (actually quite a clever design) but it was designed to not need any electronics
                                        my dad was complained saying the tubes were 'sticking' guessing there is some metal fatigue going on and it is not as accurate as it used to be, i was looking at how i was gonna solve this and asked my self why am i trying to replace all of this, the only issue is the tubes, one is a double throw switch and the other is a single throw switch and a pair of mechanical relays would do the exact same thing, then i decided to log the temp and the tube states so i can log there behavior and se how much variance they have


                                        Originally posted by sam_sam_sam View Post
                                        One note if you go this route please make sure that the thermostat still function correctly before attempting to do this upgrade

                                        I had a customer that had one of these electronic thermostat that had a relay issue but also had an issue with the outside temperature sensor not reporting so they want to replace the thermostat so I got them a replacement thermostat but unfortunately it would not operate the defrost function correctly because this one of those air conditioning units that has to use a special thermostat

                                        But a few months later the compressor would not turn on now the real issue was that the thermostat wires were so full corrosion that wires were coming apart after running new thermostat wires I was able to get back the outside temperature sensor function and the heating issue and the cooling issue with there original thermostat that I thought was the issue because I know about the relay issue that these thermostat have
                                        my dad had gotten a new thermostat and returned it cause it did not seem to properly support aux heat, our unit has 2 heat levels, low and high, with my current design i have had issues cause of the contact wearing out in the relay

                                        Originally posted by redwire View Post
                                        That would work, I tried to do it with two transistors but it would be finicky so I did not post the idea.
                                        The debug LED's lose too much voltage though, so the SSR does not get enough voltage. You have 5V subtract the debug LED let's say 2.2V and 0.1V for the transistor on, and that leaves 2.7V but the SSR minimum is 4V. So you would move the debug LED to be in parallel with the SSR drive (adding a resistor for the LED like 1k).
                                        The intermediate transistor can use high resistor value say 10k on the base, and no need for the second R2 at the base. R2 to 5V still around 2.2k
                                        wait i can put it in parallel and it work? i forgot i am not trying to use a common resistor, though in the interest of saving board space how about this? [attached]
                                        i should not really need 2 LEDs assuming my 5v wire is working and if i cared about that i would have a power led on the board (clearly i do not have this, but if i did there is no need to make that function part of the relay circuit)

                                        ** added my single throw relay to the image (also have a input pin from the tubes, a DS18B20, and a LED)

                                        the top double throw does heat/cool and the bottom does more heat

                                        BTW i have those snubber caps on by board (for the mechanical relay), should i remove them? when i do this modification, would it hurt anything? would it help anything?
                                        Attached Files
                                        Last edited by evilkitty; 11-29-2022, 08:28 AM.

                                        Comment

                                        Working...
                                        X