# LM3914 change signal input from an LDR from Spike to Liniar curve

#### q12x

Joined Sep 25, 2015
266
https://www.deviantart.com/q12a/art/dBenzin100-ziud-18-circuit-3914-and-LDR-852390002
In the Right side, you see my custom LDR input to pin 5 of LM3914 IC.
It works, but with very limited range. I understand why is doing it like that, and is not my concern.
All I wish is to transform that black heap of sensibility into a more liniar (green) transition. Pretty much as the POT is doing in the Left side.
And I understand that Pot is in fact a voltage divider. But mine is not really, is a thing of a voltage divider, but not quite.
One solution I can think of, is using a PIC 16F84 MCU. But I left it to be as plan B, since I have to remember all that stuff and assemble everything and is a lot of trouble.
I wish it can be done from discrete components in a classic circuit mode.
I also know my custom "voltage divider" is not really one, but is the best thing i could think of. I have no other ideas.
How will you transform it's ass into a liniar output?
Thank you.
Oh.. my image, view it zoom in mode, its important. It have a lot of tiny details in it that only zoomed in are possible to be seen. When you look it from afar, its just too little. I suggest to download it and open with your image viewer, and zoom in it as much as you please and easy pan it.
Thank you !

#### ronsimpson

Joined Oct 7, 2019
932
It looks like you are happy with the 10LED point and maybe happy with the 0LED point.
I think you adjusted the 10K resistor below the LDR go get the 10LED point right.

Your circuit. The Darlington transistor is doing almost nothing. The LM3914 has a very high input impedance and does not need a buffer. (25nA input current) So all you are doing is dropping 1.3V with the B-E voltage.

Please try removing (1k, transistor 10, 10k) parts. And changing 10K to 22K (or about 20K). The 20K needs to be a value that gets you back to the right 10LED point. Question: Is the 4LED to 10LED point better or worse?

#### q12x

Joined Sep 25, 2015
266
Question: Is the 4LED to 10LED point better or worse?
Thank you for taking the time. Is kind of liniar from 3LED to 10LED. But small to very small distance. Then I have to really darken the ldr to get under 3LED to 2 and 1 is off when is super super dark. That spike from 0 to 2Led is how dark it must be to get the 2led OFF (1led respectively) and then a bit not such extreme dark for 3Led, then it starts to get somewhat into a normal shadow zone, again, on a small distance, like 5cm(2inches). The light is ambient room light, not very bright.
-
Ok I did this and it is not working at all:

Last edited:

#### q12x

Joined Sep 25, 2015
266
YES, I get your point. I did changed divider R2 to 1k, then to 2k then to 1,5K and is optimal now.
Now is working almost as before, but without those other components.

It is having all the 10leds ON and in moderate shadow it goes down to led5 then exponential darker shadow to lit OFF the rest of the leds. Again, the same problem, it goes relatively smooth to led 3, now 4Led. But I have to make a super dark environment for the ldr to triger OFF led 2 and 1. Led1 is almost on all the time, and with considerable effort i can turn off led2. Thats what i mean when i talk about "sensibility" and that is not linear but spiked (or bumped).
Thank you for correcting and simplifying the circuit. I am adapting this led vumeter to an preexisting LDR circuit that is having that ldr structure from my original image, so i was considering that all the time. But I will probably change it, or make a separate one in paralel just for the vumeter. :] (with 2 ldr side by side).
Now is still not incrementing liniar, so I want to buffer UP the sensibility for led1, led2, led3. I played with a electrolitic capacitor around but absolutly no effect. And i dont have an osciloscope to clearly see any change in the curve. I must do it with my cat senses.

Last edited:

#### q12x

Joined Sep 25, 2015
266
I have updated the original image !
Ive added the simplified circuit and also a table with some measured values I did before asking anything here.
It helped me a bit.
I imagine you asked me what voltage was in that point?

So, now take another look on my page since you have there a lot of values for each led.
Thank you again.

#### peterdeco

Joined Oct 8, 2019
222
A while back I went through this with an FSR force sensing resistor. Totally non linear but needed a linear output with gradual pressure applied by a person's finger. I used the ADC on a microcontroller which read the resistance value and compared it to a table. It worked perfectly but took forever to write the table values by trial and error.

#### q12x

Joined Sep 25, 2015
266
I suppose we must search for an IC that is converting everything into linear. A generic IC or something.
Or simple circuit perhaps? Not IC implemented.
I really want to cheat programming a PIC, since its a world in itself there and ...ghhh. I will do it in the end, but im trying my luck here first.
In a way... is working ok 70%. The first 3 leds are ON all the time, if I casually interrupt the light. Only the rest of 7 leds are working very close to a linear functionality and doing what I want them. In a way im happy with this as it is. But...IF I can make it 100% good? :] That is my real problem i come with.
And indeed , if we find a discrete solution, we can use any non-linear component and make it behave civilized.
And cheap if possible. :]
I have an interesting idea... for each led output from the LM3914, to insert a feedback circuit that will "tell" when the light is on, or how many are on and switch to another "reader/interpreter" of the LDR, making it more sensible from counting how many leds are ON or OFF. You get my idea? Its around and complicated but... it might do the trick. No ADC needed. Purely analog. Im imagining using optocuplor PC817 ? It even doesnt need to read EACH led, but groups like 2 or 3 at once. When group 1 is on, change the sensibility of the pot to X value. Like 2 or 3 switches. Its what i imagine. I cant get into much more details, im only brain storming now. You are welcomed to jump with any ideas.

Last edited:

#### q12x

Joined Sep 25, 2015
266
I just observed something interesting:

Im thinking, maybe LDR is reading correct everything. Maybe that spike curve is really how my hand leave the shadow over LDR. And leds are getting OFF accordingly. But that very dark shadow I want to gray it out, to lighten it. Basically to change the sensibility of the LDR in a way. Not to sense that absolute dark but a much white dark gray than that.

#### peterdeco

Joined Oct 8, 2019
222
You might want to try different LDR's. We moved to a 5528 and it outperformed the previous one we were using (don't know the number). There's also 5537 5506 5516 5539. You'll also probably have to experiment with your R2 for a different one.

#### q12x

Joined Sep 25, 2015
266
I read the pdf, and it is very interesting indeed. It is showing exactly what I asked !
Very good job finding this pdf ! You are awesome. And quite easy to read, straight to the point indications.
Basically this is the Linearization circuit they show: (they call it hyperbolic most probably because of the X input) But the Y output is straight as it can get and is very sexy to me. :] Very !

Now, Im looking on those specific IC's from the circuit they present. I dont have them in my poor IC colection that I swear someday I will enlarge it. To be honest I never heard of them. They are new. But is good, I learn something new from you.
for TL071: (im not very sure i find the correct pdf for this one, but i get it is a family (that im not familiar very much) )
I think, from this AD633 pdf, this circuit is the closest to what they discuss in the liniarity pdf.

If you read AD633 description, it says "can be used as a linear amplitude modulator with no external components"... hmmmm.
So, maybe no need of the OPAMP? Your thoughts?

From the Hyperbolic circuit, I dont understand what that [ K ] stands for. And that [ W ] far right. And only 1 R (called R2; very dubious) and the rest only IC to IC conections? That is very interesting. Im probably mistaken. They say in the liniarization description that : "The designed circuit is based on the principle, described in applications notes of multiplier circuits manufacturers" and that is full of adjacent components. There are a couple of circuits for AD633 in the pdf. I choosed 1 from them but im not super sure if will fit with Hyperbolic circuit. Hmmm.... I dont know what to think. But it is very appealing to me.
I just look into my very limited IC colection and I find this one UA741
My best guess is I can use UA741 instead of TL071, right? If not... then tell me.
And thank you for this finding. Fantastic indeed, you made me exited of the potential result from it.

Last edited:

#### sghioto

Joined Dec 31, 2017
1,453
My best guess is I can use UA741 instead of TL071
Strongly suggest you do not! The 741 is kind of obsolete these days. Better to stay with the original parts.
The parts listed are easily available.
SG

#### q12x

Joined Sep 25, 2015
266
Strongly suggest you do not! The 741 is kind of obsolete these days. Better to stay with the original parts.The parts listed are easily available.

#### sghioto

Joined Dec 31, 2017
1,453
And only 1 R and the rest only IC to IC conections
Obviously they are not showing the full schematic. The photo of the board shows 5 chips plus additional caps and resistors. I suspect they are part of the constant current source for the LDR and reference voltage for U3. The final simulation has K=2 so that maybe the gain setting of U3.
The circuit is also powered by a dual polarity 15 volt supply.
SG

#### q12x

Joined Sep 25, 2015
266
Obviously they are not showing the full schematic.
- Hmmm, im not that inventive to make the circuit from my head... But i took the hint from it. That AD633 may be able to do the entire job alone from its one of circuit pdf description. See that I updated the last answer, where I put an img with this case.
- Its pretty expensive this AD633. I find the cheapest on ebay at 1pcs = 1.71$, but the rest of findings are way beyond. Oh + 1.18$ Shipping tax. That is 4.6$x2pcs including transport tax. Im not sure how is for other countries but for me is killing me with those Shipping taxes. Here is it's link: https://www.ebay.com/itm/1pcs-AD633JN-AD633-Low-Cost-Analog-Multiplier-DIP-8/400985227094?hash=item5d5c94ff56:g:9r0AAOSwjVVVwLsv&LH_BIN=1 Last edited: #### sghioto Joined Dec 31, 2017 1,453 I find the cheapest on ebay at 1pcs = 1.71$,
I wary of anything coming from a Chinese vendor these days.
SG

#### q12x

Joined Sep 25, 2015
266
I wary of anything coming from a Chinese vendor these days.
- I know. To be fair, from anywhere is not safe anymore. So be it chinese or romanian, russian or german, american or irakian, we are all in the same situation with the renown chinese virus. Its how i see it.
- I point it for it's high price, nothing else. I just looked over TL071 and I find them at very good price and good quantity. Though, again, the transport tax is making me so mad. You happen to know why they insert that stupid tax for transport immediately after the epidemic ? I dont believe it was for preventing buying. :]
Here is the cheapest link I find:
10PCS TL071 = 2.40$incl transport tax (~good price) (before the virus, it was 10pcs 0.98$ without that stupid transport tax, I truly hated it)
https://www.ebay.com/itm/143341492203

#### ronsimpson

Joined Oct 7, 2019
932
I added a diode(s) below R2. I think the green line will move up closer to the black line. Red lines show two and three diodes in series. Please check to see if I am on the right track. If we can get the right 3/4 of the graph close I know how to fix the left 1/4.

#### sghioto

Joined Dec 31, 2017
1,453
Another thought is to use a photodiode for the sensor.
Photodiodes have a linear output, might be worth investigating.
SG

#### q12x

Joined Sep 25, 2015
266

- I put 1 diode as you suggested and it diminished its sensibility. Meaning that the normal shadow I put over LDR, now is keeping ON the first 4 leds, instead of 2, almost 3 as it was before. All 4 fully lit now in this format.
I put the diode exactly as you show me, in series with the resistor. I even changed the resistor value a bit, but still, bad result. The diode i used is 1n4148.
- I put 2 diodes in series as you suggested and it diminished more its sensibility. Now 8 leds remain ON, and working only LED9 and LED10 (the last 2). But it is a very interesting experiment. That tell us that the remaining 3 ON leds in normal operation, before inserting the diodes, are affected as the rest here with the diodes in series. Yes.
I used 1n4001 diode as the second diode. Also I tested it as single and same result as with 1n4148, though a bit not so strong, but still interfering.

- Im thinking about the POT. When the rotating needle is on 1 side lower, it is heightening the opposing side. And viceversa, when 1 side is higher, it lowers the opposing side. This is not happening at all with our LDR. When LDR is lowering, the oposing side is the same, and when LDR is high, the oposing side is the same. That is the difference I can observe. If we can lower the opposing side while the LDR is getting high, make it interactive somehow.... you get my point? Mimicking the POT but from LDR and some feedback circuit.