Announcement

Collapse
No announcement yet.

smoothing out voltage spikes and dips?

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

    smoothing out voltage spikes and dips?

    noone seems to be getting back to me on my previous thread so i figured i should start a new one.

    i am building a led light bar using a lm3914 IC. it is working but my imput voltage is all over the place as soon as i try to use it it just bounces from 2 to 10 bulbs lit up and rocks back and fourth.

    i need help smoothing out the voltage for the input. i am assuming with a capacitor and a resistor but i dont know where to put the pos,neg lead of the cap and if i even use a resistor at all or the size of the cap and resistor.

    i am super close to getting this thing working and if i could get any advice to solve this last step i could finally get this out in the field working.

    #2
    Re: smoothing out voltage spikes and dips?

    Are you using a ceramic bypass cap on VCC?

    Comment


      #3
      Re: smoothing out voltage spikes and dips?

      no I am running the ic off a lm317. The output on the regulator is the input on the bar graph IC

      Comment


        #4
        Re: smoothing out voltage spikes and dips?

        What do you mean by the output regulator is fed into the input of the LM3914? What do you use to feed the VCC pin of the LM3914?
        Can we what circuit you ending up with, I thought you were trying to get the LED to show your potentiometer resistance from 0~100 Ohms using LED lights as an indicator.
        Last edited by budm; 07-04-2012, 02:10 PM.
        Never stop learning
        Basic LCD TV and Monitor troubleshooting guides.
        http://www.badcaps.net/forum/showthr...956#post305956

        Voltage Regulator (LDO) testing:
        http://www.badcaps.net/forum/showthr...999#post300999

        Inverter testing using old CFL:
        http://www.badcaps.net/forum/showthr...er+testing+cfl

        Tear down pictures : Hit the ">" Show Albums and stories" on the left side
        http://s807.photobucket.com/user/budm/library/

        TV Factory reset codes listing:
        http://www.badcaps.net/forum/showthread.php?t=24809

        Comment


          #5
          Re: smoothing out voltage spikes and dips?

          The lm3914 is powered by a voltage regulator (lm317) so I have a constant 10v feed. Because this will operate like a automotive circuit I did not want to have the vcc voltage fluctuate. Because this is driven by a battery that is sometimes being charged and sometimes not. The main voltage is 11.5v -14.5v. So that drives the input leg of the volatge regulator. The output leg of that regulator (10v) is directly driving the bar graph IC (lm3914) and that stable voltage is my reference sorce for adjusting high and lows etc..

          The best way I can describe this is like a gas gauge in a car full tank is 10 lights and empty is 1 light the problem I am having is just that the "gas" keeps moving around causeing the leds to react in real time rendering it almost useless

          Comment


            #6
            Re: smoothing out voltage spikes and dips?

            A few thoughts...

            1) Your battery should not be dipping down to 11.5V unless it's not in the vehicle and is discharging continually before recharged again. IF you need the circuit to work down to 11.5V or lower, you need to set the LM317 to a lower voltage than 10V because the forward drop voltage across an LM317 is usually 2V or higher (but for specifics check the LM317 datasheet for the drop at the current consumption of the circuit).

            2) There should be a decoupling capacitor between the LM317 output and the VCC (datasheet may call it V+) pin. Positive lead of capacitor wired to LM3914 VCC/V+ pin, negative lead of capacitor wired to ground.

            3) Besides the regulator forward drop issue mentioned above in #1, it does not matter that the LM317 input voltage from the battery fluctuates, the output from it will remain stable so long as you have the capacitor and the input voltage minus the forward drop is still a larger number than the regulator's set regulation voltage.

            To put it another way I'd set the LM317 to regulate at around 8V instead of 10V, IF what I have assumed is correct but more details about exactly what this project is including a schematic could be very helpful.

            Comment


              #7
              Re: smoothing out voltage spikes and dips?

              It is actually a battery bank and it is set to charge around 12v. Forward drop of the circuit is 1.25v. I have plenty of headroom and its not important. This thing sits at 14.4v all day except when the batteries are driving a large amp draw of work lamps then I am around 13.6v. Its all automotive batteries with auto alternator.

              I did not know about decoupling the vcc feed I will add a cap right away. What size should I use?

              To help explain the is a tank of water on the back of a quad. I use it for watering trees. Its pretty low tech and I am doing this project because I'm too cheap to pay for a gauge and also I really have a lot of questions about diy progjects like this that I need answers for and cause I'm not much of a book guy I learn better from forums like this one and a community like everyone here.

              The probem is not the vcc feed fluctuation problem the problem is the ref voltage in problem. Low is .5v and high is 4.5v and my ref in is working fine fluctuating between these numbers and lighting up the according number of led bulbs. The problem is when the water in the tank fluctuates when I hit a bump the gauge goes crazy till the water stops moving around. I need to figure out a way to add a
              "Shock absorber" so that there is a bit of a delay to the voltage ref input to the IC

              I will draw up a schematic and submit it here as soon as I can.

              Comment


                #8
                Re: smoothing out voltage spikes and dips?

                Ok I think what your looking to add is called hysteresis. But first you need to make sure your linear regulator is running steady. This means that you need a .1uf monolithic ceramic capacitor on the input pin of the LM317 in addition to an electrolytic... the capacitance of the electrolytic is not critical but I would recommend at least 10uf... in circuits where the power is coming from a linear transformer such as a wall wart the capacitance can be several thousand uF. These capacitors will help absorb noise from the alternator, radio, so on and so forth. Then you need to stabilize the output of the regulator. The standard per the LM317's datasheet is a 1uf solid tantalum cap. But at the same time you could also use an electrolytic if one is not available. You don't need too low an ESR for your output filtering cap if you go electrolytic, say 22uf or even a 100uf 105C rated general purpose cap would probably work, maybe a low end "entry level" low ESR cap. Too much or too little capacitance on the output and too high or too low an ESR will cause a linear voltage regulator to oscillate. But whatever you use keep in mind that if you go with more than 10uf of capacitance on the output you should add 1N4001 or 1N4002 protection diode(s) to keep from nuking the regulator when the power is cut off or in case of a short circuit.

                The other trick with an LM317 is to optimize R2 so that a minimum amount of quiescent current flows across the adjust pin. The datasheet says 240 ohms, but the actual value will be determined by the maximum input voltage going into the regulator. I suggest using a 805 or 1206 case size SMD resistor soldered directly across the output and adjustment pins for R2. This is about as close as you can get and will maximize transient response. Additionally you can put a 10uf electrolytic on the adjustment pin. This will give additional ripple rejection... however be advised that such a cap will cause the regulator to have a "soft start" which whatever device your regulating may or may not like.

                Additionally you should also have a .1uf ceramic (or whatever the led driver datasheet says) on the VCC pin of the IC. That should take care of just about all the transient ripple and noise going into the IC.

                Now then about your signal. Fast response is great when you need to see rapid changes on the meter. But in your application, what you need to see is more or less an average voltage reading coming from the tank. This is where things would get a bit complicated.

                The first thing to do is to minimize your sensor variations by installing some sort of mechanical baffle around the sensor. Could be as simple as a small piece of pipe running down to the bottom of the tank with a small hole drilled in it with the sensor sitting inside. That will help eliminate much of the effects of sloshing and the amount of hysteresis you need to keep your reading stable.

                Now then, I will assume that your sensor acts as a variable resistor based upon the level of the fluid in the tank. So, the simplest feedback method I can think of is to use a voltage divider with R1 coupled to the output of the LM317 and the sense pin of your IC and R2 going from the sense pin to ground. To select the right values you need to measure the resistance of the sensor with the tank full, empty, and possibly a couple points in the middle. This will tell you what sort of bandwidth your working with on your feedback loop and will inform you if the sensor operates in a linear or logarithmic manner. Depending on the difference resistance between full and empty the sensor may need to act as R1, R2, or in series or parallel with R1 or R2 as R3. This will more than likely take some calculations in addition to trial and error. I recommend breadboarding the circuit and use trim pots to find what works best.

                So about the hysteresis thing... to average things out, you need to add a capacitor of sufficiently large value to act as a reservoir.. it could be 10uf, 100uf, 1000uf whatever... the larger the value the less sensitive it will be to transient voltages caused by sloshing. Not knowing the specifics of your setup and how much current is flowing thru your feedback loop your just on your own... again some trial and error will probably be needed. The more current flowing thru your voltage divider the larger the cap will need to be. It might even be necessary to add on an additional voltage regulator before the feedback loop depending on the resistance of the sensor.

                I would also recommend using a 1N4148 diode between your voltage regulator and the feedback loop. This will keep power from the feedback capacitor back feeding into your regulator circuit when the power is cut off.

                I'm sure there is a better way to do this... I wish I knew more about op-amp theory. I would think that there should be a way to average out the fluctuations in feedback voltage between sloshes and even compensate for vehicle tilt using a cheap LM324.

                Comment


                  #9
                  Re: smoothing out voltage spikes and dips?

                  What is the full scale voltage that will cause all 10 LEDs to light up, you divide that by 10 so each LED will represent 1/10th of the input maximum voltage, so if you make it 1 Volt per LED, then that may be too fine of the scale so you will see any small changes generated by your signal source. You can damp the input signal with RC circuits.
                  We need to see your circuits.
                  Never stop learning
                  Basic LCD TV and Monitor troubleshooting guides.
                  http://www.badcaps.net/forum/showthr...956#post305956

                  Voltage Regulator (LDO) testing:
                  http://www.badcaps.net/forum/showthr...999#post300999

                  Inverter testing using old CFL:
                  http://www.badcaps.net/forum/showthr...er+testing+cfl

                  Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                  http://s807.photobucket.com/user/budm/library/

                  TV Factory reset codes listing:
                  http://www.badcaps.net/forum/showthread.php?t=24809

                  Comment


                    #10
                    Re: smoothing out voltage spikes and dips?

                    please excuse the crudity of my horrible drawing it is the first time i have drawn a schematic. but so far this is where i am sitting. i have everything mocked up on a breadboard with a 0-90 ohm trim pot to simulate the tank float. it is working right now.

                    also i still cant figure out what pin 7,8 do?
                    7 seems to adjust led brightness
                    8 i just put to ground

                    i played with them till i got the bulbs to light up i dont know if i did this correctly or not
                    Attached Files
                    Last edited by scampo77; 07-05-2012, 10:27 AM.

                    Comment


                      #11
                      Re: smoothing out voltage spikes and dips?

                      You should put a capacitor at the input to the regulator and another near pin 9 (VCC) of the LM3914. Perhaps a few dozen uF before it and 1 to 10uF ceramic, film or tantalum after. Pins 7 and 8 form a voltage divider, the amount of current that flows does determine LED brightness, see page 7 of the datasheet you linked.

                      Also see on the datasheet page 2 that if your leads to the led(s) is over 6" long then a 2.2uF cap should be placed between them and ground.
                      Last edited by 999999999; 07-05-2012, 10:40 AM.

                      Comment


                        #12
                        Re: smoothing out voltage spikes and dips?

                        The diagram does not show any caps at all.
                        Attached Files
                        Never stop learning
                        Basic LCD TV and Monitor troubleshooting guides.
                        http://www.badcaps.net/forum/showthr...956#post305956

                        Voltage Regulator (LDO) testing:
                        http://www.badcaps.net/forum/showthr...999#post300999

                        Inverter testing using old CFL:
                        http://www.badcaps.net/forum/showthr...er+testing+cfl

                        Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                        http://s807.photobucket.com/user/budm/library/

                        TV Factory reset codes listing:
                        http://www.badcaps.net/forum/showthread.php?t=24809

                        Comment


                          #13
                          Re: smoothing out voltage spikes and dips?

                          Boy! I look at your diagram and it does not make sense the way you have it hook up. the Vref out pin 7 (Ref Out) out put is not used for the ref voltage for the High side of the Comparator pin 6 (RHI), Pin 4 (RLO) is also connected strange.
                          You have a resistor R5 connected between RHI and RLO, R8 is also connected between PIN 4 and pin 6.
                          Right now the RHI and RLO voltage will be varying with the POT so the comparator circuit trip point will keep adjusting the trip point in the the comparator circuits. The RHI and RLO have to be sitting at real steady voltage.
                          May be I am reading your diagram wrong?
                          Where did you get this diagram from?
                          Attached Files
                          Never stop learning
                          Basic LCD TV and Monitor troubleshooting guides.
                          http://www.badcaps.net/forum/showthr...956#post305956

                          Voltage Regulator (LDO) testing:
                          http://www.badcaps.net/forum/showthr...999#post300999

                          Inverter testing using old CFL:
                          http://www.badcaps.net/forum/showthr...er+testing+cfl

                          Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                          http://s807.photobucket.com/user/budm/library/

                          TV Factory reset codes listing:
                          http://www.badcaps.net/forum/showthread.php?t=24809

                          Comment


                            #14
                            Re: smoothing out voltage spikes and dips?

                            By the way, you should measure the DC voltage at pin 4 (RLO) and ground, pin 6 (RHI) and ground to see if it is rock solid when you vary the pot from Full CW, and Full CCW.
                            Never stop learning
                            Basic LCD TV and Monitor troubleshooting guides.
                            http://www.badcaps.net/forum/showthr...956#post305956

                            Voltage Regulator (LDO) testing:
                            http://www.badcaps.net/forum/showthr...999#post300999

                            Inverter testing using old CFL:
                            http://www.badcaps.net/forum/showthr...er+testing+cfl

                            Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                            http://s807.photobucket.com/user/budm/library/

                            TV Factory reset codes listing:
                            http://www.badcaps.net/forum/showthread.php?t=24809

                            Comment


                              #15
                              Re: smoothing out voltage spikes and dips?

                              If the led brightness is set too high the leds might be drawing too much current, causing the LM317 to shutdown...just an idea.

                              Idk how your circuit is supposed to work, but after looking at the LM3914 datasheet, I came up with this circuit (pic attached).

                              R1 = 1k
                              R2 = 4k7
                              C1 = 10uF
                              D1 = 1N4148 or 1N914 or 1N4001

                              Ref voltage should measure about 6v
                              LED current is 12.5mA
                              Rsensor is just a potentiometer, it should be 25-100k
                              Attached Files
                              Last edited by ben7; 07-06-2012, 01:02 PM.
                              Muh-soggy-knee

                              Comment


                                #16
                                Re: smoothing out voltage spikes and dips?

                                @ben, that is more like it (6V/10 = 0.6V per step), the RHI should be fed with the good Vref voltage using the internal Vref in the IC as shown in your diagram and in the App notes. His circuit will not work since RHI will vary with the post so the comparator will just keep on hunting the signal and the the way it was wired up makes no sense at all. There should be filter cap after the Diode feeding the V+ of the IC, and alot of caps for Vin/Vout of the Regulator also.
                                I did not look to see how much current the internal V ref can handle, since his potentiometer is 100 Ohms, that means, at 6V there will be about 60mA through the pot, he will need to change the pot value as you suggested.
                                Last edited by budm; 07-06-2012, 02:15 PM.
                                Never stop learning
                                Basic LCD TV and Monitor troubleshooting guides.
                                http://www.badcaps.net/forum/showthr...956#post305956

                                Voltage Regulator (LDO) testing:
                                http://www.badcaps.net/forum/showthr...999#post300999

                                Inverter testing using old CFL:
                                http://www.badcaps.net/forum/showthr...er+testing+cfl

                                Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                                http://s807.photobucket.com/user/budm/library/

                                TV Factory reset codes listing:
                                http://www.badcaps.net/forum/showthread.php?t=24809

                                Comment


                                  #17
                                  Re: smoothing out voltage spikes and dips?

                                  Originally posted by budm View Post
                                  @ben, that is more like it (6V/10 = 0.6V per step), the RHI should be fed with the good Vref voltage using the internal Vref in the IC as shown in your diagram and in the App notes. His circuit will not work since RHI will vary with the post so the comparator will just keep on hunting the signal and the the way it was wired up makes no sense at all. There should be filter cap after the Diode feeding the V+ of the IC, and alot of caps for Vin/Vout of the Regulator also.
                                  Yeah I do agree, there should be a filter cap.

                                  Oops! looks like I missed Scapmo's post #7, he is NOT having trouble with voltage fluctuation or stability issues, he needs an extra capacitor to make the reading stable when he goes over bumps (the float will bob when that happens-giving false readings).

                                  Updated circuit, idk if it will work though. You might need to change the capacitor C3 to a larger or smaller value to give the desired slow response effect, but not too slow.

                                  Try a 4.7uF cap for C3 first, if it is too slow, go lower, if it is too fast try a larger capacitor.

                                  Also note that when the potentiometer's wiper is closer to ground, the C3 will discharge faster. This is because a larger current will flow through a smaller resistance, hence C3 discharges faster.

                                  C2 is another filter capacitor of 10uF.
                                  Attached Files
                                  Muh-soggy-knee

                                  Comment


                                    #18
                                    Re: smoothing out voltage spikes and dips?

                                    The problewm in his circuit was that the RHI and RLO were not fed with good stable Ref voltage, his pot affect the voltage feeding the RHI and RLO, so the voltage for the resistor dividing string was not at constant voltage, so when the pot changes the value, the trip point also change, he must maintain the RHI and RLO at solid constant voltage, that is why the APP notes uses the Vref out for feeding the resistor string. Your first circuit should work, and with added cap in the second circuit will damp the response time also if he needs it.
                                    Last edited by budm; 07-06-2012, 02:55 PM.
                                    Never stop learning
                                    Basic LCD TV and Monitor troubleshooting guides.
                                    http://www.badcaps.net/forum/showthr...956#post305956

                                    Voltage Regulator (LDO) testing:
                                    http://www.badcaps.net/forum/showthr...999#post300999

                                    Inverter testing using old CFL:
                                    http://www.badcaps.net/forum/showthr...er+testing+cfl

                                    Tear down pictures : Hit the ">" Show Albums and stories" on the left side
                                    http://s807.photobucket.com/user/budm/library/

                                    TV Factory reset codes listing:
                                    http://www.badcaps.net/forum/showthread.php?t=24809

                                    Comment


                                      #19
                                      Re: smoothing out voltage spikes and dips?

                                      The max reference load current is 10mA!

                                      Scampo, you should use a 25k-100k potentiometer, not a 100 ohm one.
                                      Muh-soggy-knee

                                      Comment


                                        #20
                                        Re: smoothing out voltage spikes and dips?

                                        thank you very much Ben7!! ok i am trying to rebuild this now, i see that in my new diagram i have 9.35v. do i need to make a new voltage divider to get this new voltage?

                                        i put in a new C1 it is 10uF 50v i put it right at the output leg of my LM317.

                                        the D1 i have lots of questions.

                                        i have a 1N4148 here and installed but dont i need a resistor to ground with this? originally i wanted to just use a zener to get my 10v but i was told on this forum that it is an inexact way to start off. so i started with a LM317 regulator instead. i have one and will install it i just want to make sure it was understood that this is already a regulated power source.

                                        C3 seems to make no difference at all using a 4.7uF cap i dont have anything smaller here i will need to go out and get one on monday. all i have smaller is SMD stuff i dont know if i could solder legs onto these things to give them a try?

                                        i have no choice but to use a 100 ohm pot, it is what the tank comes with.

                                        i have measured both ref-hi and ref-lo with the full swing of the pot and there is no change in either volatges.

                                        Comment

                                        Working...
                                        X