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

Thread Starter

q12x

Joined Sep 25, 2015
1,647
This page i made, explains the problem i have, in much detail :
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
2,954
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.
1597757096076.png
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.
1597757138555.png
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?
 

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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.
Im trying your advice on the circuit change now.
-
Ok I did this and it is not working at all:
1597759038461.png
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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.
1597760356185.png
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:

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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?
1597764527933.png
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
484
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.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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:

Thread Starter

q12x

Joined Sep 25, 2015
1,647
I just observed something interesting:
1597768653487.png

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
484
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.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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 !
1597772761891.png
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) )
https://www.ti.com/lit/ds/symlink/tl071.pdf?ts=1597773126611&ref_url=https%3A%2F%2Fwww.ti.com%2Fproduct%2FTL071
for AD633:
https://cdn.datasheetspdf.com/pdf-down/A/D/6/AD633_AnalogDevices.pdf
I think, from this AD633 pdf, this circuit is the closest to what they discuss in the liniarity pdf.
1597774473037.png
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
https://www.ti.com/lit/ds/symlink/ua741.pdf?ts=1597773675849&ref_url=https%3A%2F%2Fwww.ti.com%2Fproduct%2FUA741%3Futm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3Dasc-null-null-GPN_EN-cpc-pf-google-wwe%26utm_content%3DUA741%26ds_k%3DUA741+Datasheet%26DCM%3Dyes%26gclid%3DEAIaIQobChMI3s-p3aql6wIVuyB7Ch1V8g10EAAYASAAEgL0bPD_BwE%26gclsrc%3Daw.ds
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:

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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.
I understand, thank you. I'll go on your advice then. That's why I ask first and buy later. :)
 

sghioto

Joined Dec 31, 2017
5,370
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
 

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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:

Thread Starter

q12x

Joined Sep 25, 2015
1,647
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
2,954
Something to think about:
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.
1597778854320.png
 

Thread Starter

q12x

Joined Sep 25, 2015
1,647
1597780949885.png
- 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.
 
Top