Announcement

Collapse
No announcement yet.

Need help with simple electronics circuit

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

  • Need help with simple electronics circuit

    Hello all,

    I know essentially nothing about electronics (as will become painfully apparent if you read on). I want to make a simple self-contained circuit* that will run on a battery, so relays and external power source is not what I need. It's main purpose is to turn on an LED when some contacts open. Obviously some form of ready made switch would be ideal, but I want the contacts to be able to move up to an inch further apart after opening. After searching on Youtube, I found something which will do what I want (I think?). Below is a circuit diagram (of sorts) that I sketched out from the video.

    My questions are:

    a) are the values of the resistors shown absolute or is it the ratio of the resistor's values that is important?

    b) if I reduced the voltage to say 3 volts (ie 3 volt battery), would this transistor still work at this voltage and if so, would the resistors have to have the same values or lower (but in the same ratio)?

    The Youtube video (approx 2.5 mins) can be found here (The opening of the contacts is equivalent to the cutting of the wire shown in this video):

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


    and the link to the transistor data sheet here:

    https://bit.ly/2Y13chO

    Any help from the electronics-savvy folks on here would be much appreciated.

    Ian.

    *This is for a sort of lathe carriage stop except that it doesn't stop the carriage, but simply tells me that the tool has reached a certain position and that I had better do something about it!

  • #2
    For 3V it will work the same, but you will want to reduce the 680 ohms to a lower value. A value of 220 ohms will act pretty much the same, and give an LED current of about 7-10 mA, which ought to be reasonably bright, depending on the LED.

    You could use 100 ohms just as well, or a higher value, depending on how bright the LED needs to be, and how bright it gets, since LEDs vary in their brightness at a given current.

    If you are using a 3V battery setup, you could increase the 2200 ohm base resistor quite a bit given that the minimum current gain is given as 110, and fig 3 suggests that it is quite consistent over a wide current range. A value of 10,000 ohms will drain the battery less, and still be good up to at least 10 mA LED current with a minimum gain part. Most parts are higher gain, so double that could still be fine.
    Last edited by J Tiers; 01-16-2020, 03:02 AM.
    1601

    Keep eye on ball.
    Hashim Khan

    Comment


    • #3
      J Tiers,

      Thanks for your quick reply, and understood.

      N.B. For some reason the scanned (as .jpeg) image (top half of an A4 sized page) is appearing as a tiny image when posted? My first time to post a photo. Hmmm.......

      Ian.
      Last edited by IanPendle; 01-16-2020, 02:47 AM. Reason: Typo correction

      Comment


      • #4
        You can copy and paste the image, but it showed up as base64 encoding. So I had to save it to disc and upload it here.

        Click image for larger version

Name:	image_7015.jpg
Views:	175
Size:	453.3 KB
ID:	1849239
        http://pauleschoen.com/pix/PM08_P76_P54.png
        Paul , P S Technology, Inc. and MrTibbs
        USA Maryland 21030

        Comment


        • #5
          Paul,

          Thanks for fixing this - it may (?) be of use to someone.

          (I will have to look up base 64 encoding to see what I'm doing wrong!)

          Ian.

          Comment


          • #6
            When I want to post pictures, I choose "Upload Attachments", and then browse to choose the images I want to upload (up to five). Then the image files will appear below the editor, and you can choose to insert them as small, medium, large, or full size. I don't know why your image got converted to Base64. This is the first time it's done that. Maybe a forum glitch? Some other things seem a little different, so...

            http://pauleschoen.com/pix/PM08_P76_P54.png
            Paul , P S Technology, Inc. and MrTibbs
            USA Maryland 21030

            Comment


            • #7
              Ian, your first post has a thumbnail that links to a bigger picture. It's just fine once you realize that.

              If you're going to run from a battery then go with Jerry's suggestion for a 10K resistor to replace the 2.2K. It's a small change but it'll slightly extend the life of the battery. Or if you opt for 3V then perhaps a 6.8K to be sure it switches on hard enough. 10K would see 2.2v/6800= 0.2mA which might be a touch on the light side depending on. 6.8K would up that to around 0.3ma and ensure it switches on fully to run the LED. Odds are that the gain is higher than the minimum 110 and that the 10K would be just fine. But for the sake of an extra tenth of a mA why take a chance?

              On spacing the contacts for a low voltage setup like this you could make up your own spring contacts. Or you could use a spring return switch and just have a "shoe" or cam or finger that opens the switch at the right point. Lots of options that use either a fancy microswitch, bigger spring loaded switch or just a custom made wiper assembly from spring wire.
              Last edited by BCRider; 01-16-2020, 04:02 AM.
              Chilliwack BC, Canada

              Comment


              • #8
                Paul,

                I did it via the Photo button - maybe that's why?. Next time I'll try the Upload Attachments button.

                BCRider,

                You said "Ian, your first post has a thumbnail that links to a bigger picture. It's just fine once you realize that."

                I'm not sure what you mean. [ EDIT - OK, I get it - finally! If I click on it it opens another window at the right size - DOH!] If I copy the image from the post into say Paint, then it also shows up much reduced, and if I try to resize it larger, then the resolution is hopeless. Not sure about all this..........

                Anyhow, thanks for the further input and suggestions re resistor sizes.

                Ian.
                Last edited by IanPendle; 01-16-2020, 04:21 AM. Reason: Because I finally understood what I was being told!

                Comment


                • #9
                  Originally posted by BCRider View Post
                  Ian, your first post has a thumbnail that links to a bigger picture. It's just fine once you realize that.

                  If you're going to run from a battery then go with Jerry's suggestion for a 10K resistor to replace the 2.2K. It's a small change but it'll slightly extend the life of the battery. Or if you opt for 3V then perhaps a 6.8K to be sure it switches on hard enough. 10K would see 2.2v/6800= 0.2mA which might be a touch on the light side depending on. 6.8K would up that to around 0.3ma and ensure it switches on fully to run the LED. Odds are that the gain is higher than the minimum 110 and that the 10K would be just fine. But for the sake of an extra tenth of a mA why take a chance?
                  ....
                  Should be fine with 10K at 3V. 3V - 0.7 = 2.3V the 2.3V / 10000 = .00023 The 0.00023 x 110 = .025 25 mA. Since that is the minimum beta, it should be fine up to at least 10 mA LED current, with a margin. Good for the suggested 220 ohm (8mA) resistor, using an average 1.25V for the LED forward voltage.

                  If this was for a cold weather application, I'd go with more margin, but here he should be fine for a room temp device. The odds are that the part will have a higher beta, as well, since we are using the minimum allowed value.

                  1601

                  Keep eye on ball.
                  Hashim Khan

                  Comment


                  • #10
                    Originally posted by J Tiers View Post

                    Should be fine with 10K at 3V. 3V - 0.7 = 2.3V the 2.3V / 10000 = .00023 The 0.00023 x 110 = .025 25 mA. Since that is the minimum beta, it should be fine up to at least 10 mA LED current, with a margin. Good for the suggested 220 ohm (8mA) resistor, using an average 1.25V for the LED forward voltage.

                    If this was for a cold weather application, I'd go with more margin, but here he should be fine for a room temp device. The odds are that the part will have a higher beta, as well, since we are using the minimum allowed value.
                    All very true and very likely..... Except a lot of times over the years I'd breadboard up some circuit or other using all the supposedly correct by the numbers values only to find that one device or the other didn't behave quite as it should according to the books and I had to adjust resistors to obtain the proper operation. And running a transistor right at the threshold base current seemed like one of those things that typically caught me out even when the theory said it should work.

                    But then that's why it's fun and wise to breadboard these things first anyway, right?
                    Chilliwack BC, Canada

                    Comment


                    • #11
                      Yes, that sort of thing is indeed one good reason.

                      Normally, when doing a design, one wants to use all the worst case limits. Whatever limit, high or low, fouls up the device the worst. In this case, beta is the problem, and low beta the issue to avoid. The minimum 25C gain is 110, over a wide range of currents, and using that, we should get a result where even the part with the worst gain will work with a 2:1 margin above minimum All those, and that will be most of the parts, having better gain, will work better.

                      When dealing with asian spec devices, one must be more careful. The folks over there, at least with parts not of the semiconductor type, will often select with 100% inspection and a hard cutoff at the limit. So you may get a half-gaussian distribution "crammed up against" the limit, with a fair number of inspection errors that fall over the limit. Then, you need to be very conservative.

                      Where one can get in trouble is with the variations.... beta is quoted for certain conditions, and when you vary from those, things may happen. In this case, it is a workshop environment, in a warm climate. Beta normally falls at low temps, but in Penang, that is likely not an issue. It also varies with current, but the spec curves, while not "binding", do not indicate a variation over the current range we need.

                      All these things indicate that he will be fine, and the battery saving (if he is using one) is probably worth the trouble.

                      The best argument for a slightly different circuit might be leakage over the surface of the circuit board, due to a hot humid environment. But the B-E junction is shorted in the "off" condition, so unwanted turn-on is not a factor if the contacts are good.
                      1601

                      Keep eye on ball.
                      Hashim Khan

                      Comment


                      • #12
                        Each resistor is calculated individually. Their ratio is not a factor.

                        Design considerations:

                        Supply (battery) Voltage = Vs

                        Your 680 Ohm resistor: This sets the current in the LED when the transistor is on. LEDs are current mode devices and all LEDs have a specified, design, operating current that produces the nominal brightness. The current can be less if you want the light to be dimmer: no problems there. The current should not be much greater than that value as that may shorten the life of the LED. The design equation for this resistor is:

                        LED current in Amps = I (Divide mA current ratings by 1000 to get the Amps)

                        R = (Vs - 1.7) / I

                        Your 2.2K supplies the current needed to bias the transistor On via it's base-emitter junction. It's value depends on the supply/battery Voltage and the gain of the transistor. The base current is a fraction of the collector current that lights the LED (the load). If the transistor has a gain of 100 and the LED needs 0.03 Amps (30 mA) then the base current will need to be 0.0003 A ( 0.3 mA).

                        Since the base-emitter junction of the transistor is about 0.7V, the design equation for this resistor would be:

                        R = (Vs - 0.7) / (I * hfe)

                        Where hfe is the gain of the transistor and the current is in Amps.

                        This resistor can be smaller, within reason. If it is larger, less base current will flow and that will allow less collector current. The LED may not be be at full brightness. A pot here could convert this circuit into a dimmer.
                        Last edited by Paul Alciatore; 01-16-2020, 04:52 PM.
                        Paul A.
                        SE Texas

                        Make it fit.
                        You can't win and there is a penalty for trying!

                        Comment


                        • #13
                          Thanks to everyone who replied, and with so much detail too. It's very much appreciated.

                          Ian.

                          Comment


                          • #14
                            You will get varying lifetimes out of the battery with that circuit as you play with the resistor values, but the battery will go dead fairly soon anyway, leaving you with a useless module. I am assuming you would want this to work unattended for months if not years, potentially something nearing the shelf life of the battery. You would be far better off using an FET instead of a regular transistor. Your led resistor could be the same value, but the 2.2k could be changed to 10 meg ohms and it would work the same- but with far far less idle current.
                            I seldom do anything within the scope of logical reason and calculated cost/benefit, etc- I'm following my passion-

                            Comment


                            • #15
                              If battery life is critical, you could use a logic level NMOS device, with a 100k pull-up, which will draw only about 26 uA when the switch is closed. Here is a schematic drawn in the free simulator LTSpice, showing the transition from switch open to switch closed. I am simulating the switch with a voltage source and diode that starts at 3 volts (diode reverse biased - switch open), and transitions to 0 volts (diode forward biased - switch closed), over a 1 mSec time period, showing the point where the MOSFET turns off. Note that a 220 ohm resistor only provides 5 mA to the LED, which in this case has a 1.8 volt forward voltage.

                              Click image for larger version  Name:	Limit_Switch.jpg Views:	0 Size:	196.0 KB ID:	1849377
                              The simulation ASCII file: Limit_Switch.asc.txt
                              Attached Files
                              Last edited by PStechPaul; 01-16-2020, 08:17 PM.
                              http://pauleschoen.com/pix/PM08_P76_P54.png
                              Paul , P S Technology, Inc. and MrTibbs
                              USA Maryland 21030

                              Comment

                              Working...
                              X