Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Light Controlled Resistor Simulation

Status
Not open for further replies.

bacterozoid

New Member
I'm using SPICE to simulate a circuit with a fair amount of complexity. The actual circuit has a light controlled resistor in it which is crucial for correct operation.

The light that controls the LCR is not simply on or off. The voltage drop will change dynamically and thus vary the resistance of the LCR. I need some way to simulate this in SPICE. I realize it's senseless to use light, but I can certainly use a voltage controlled resistor. Problem is that I don't have a library or part for that and I don't know where I can find one.

Does anyone know how I can simulate this - LCR or other method? The variable resistance is essential to the circuit operation.

I hope I find a great amount of help and expertise around here. Thanks!
 
The Light Controlled Resistor is just a resistor, unless the light changes. What changes the applied light? Does something in the circuit change the light, and the resistance? If so, you should be able to write an equation describing the relationship.
 
I use LTSpice. I don't know whether you can use its models directly in your spice program, but if so, then join the LTSpice Yahoo! group at http://groups.yahoo.com/group/LTspice/ and check out the files in the Files section (oddly enough), in the Lib directory. There is at least one LDR model in there which you may be able to use.

If that doesn't work out, perhaps you can use a FET as a voltage-controlled resistor: **broken link removed**

No way you can rework that part of the circuit to use an optocoupler?


Torben
 
There's an envelope detection circuit who's output drives a LED that controls a LCR.

I'm using Orcad PSpice. I'll look into the FET implementation and then if that doesn't work, give some of those libraries a try.

As far as an optocoupler goes, I'm really not sure. I've seen similar circuits that use one, but I've never had any experience with them nor do I see a spice model for one.

Thanks for the suggestions. I'll see what I can do with them.

Let me try to be midly more effective - here's a link to the circuit I'm working on. There are 3 main parts...you can see them most of the way down this page:
http://www.geofex.com/Article_Folders/ECFtech/ecftech.htm
 
Last edited:
bacterozoid said:
There's an envelope detection circuit who's output drives a LED that controls a LCR.

I'm using Orcad PSpice. I'll look into the FET implementation and then if that doesn't work, give some of those libraries a try.

Gotcha. As far as I know part of the allure of the LDRs in that kind of thing is the fact that they are quite slow, which is part of what gives them their sound. A FET might be too fast.

As far as an optocoupler goes, I'm really not sure. I've seen similar circuits that use one, but I've never had any experience with them nor do I see a spice model for one.

Again, an optocoupler might be too fast since usually it's just an LED and a phototransistor bunged into one package. I don't think in this case it would be worth redesigning just to make an optocoupler work in the sim.

I'm surprised that Orcad spice wouldn't include optocouplers or LDRs in its library, or at least for customers to download. LTSpice is free and has a whole whack of 'em included by default.

Thanks for the suggestions. I'll see what I can do with them.

Let me try to be midly more effective - here's a link to the circuit I'm working on. There are 3 main parts...you can see them most of the way down this page:
http://www.geofex.com/Article_Folders/ECFtech/ecftech.htm

Cool. Are you simming it for any particular reason, or just to make sure the thing works?


Torben
 
You might be right about those speeds. Would a dependent source work for something like this?

I've got PSpice because I'm a student and get things like this for free. :) It's a great tool and worked perfect for anything I've ever done...until now.

As for why simulating it...there are a bunch of reasons. I'll understand the circuit better, make sure it's going to work before I buy all the parts to build it, and have my own schematic to follow.

I'll try to post my schematic as well as a waveform soon. If I can't get a way to simulate the LCR I'll just hack something in and see what the output says. If you guys think it looks about like it should I'll just go for it on the breadboard.

...which brings me to another question. Is there some way I can mimic an audio signal in spice...or at least vary the amplitude of my input. The filters work best in dynamic environments (That's how it knows when to wah) and so using a 60Hz sine wave doesn't give me much of that.
 
bacterozoid said:
You might be right about those speeds. Would a dependent source work for something like this?

I'm not sure what you mean by "dependent source". A voltage-controlled current source?

I've got PSpice because I'm a student and get things like this for free. :) It's a great tool and worked perfect for anything I've ever done...until now.

Cool. Never tried it, but I downloaded part of it today since it appears that Cadence has folded it into the main package and end-of-lifed the standalone version, but I would still need to get the whole package to install it. :(

I'll try to post my schematic as well as a waveform soon. If I can't get a way to simulate the LCR I'll just hack something in and see what the output says. If you guys think it looks about like it should I'll just go for it on the breadboard.

I'd try the VAR_LDR model from the LTSpice group and see if you can import that and use it. It works for me.

Just a side note: I think 'LCR' is usually used as a variant on 'RLC', i.e. a resistor-capacitor-inductor oscillator. At any rate, I almost always see the term 'LDR' used to refer to a voltage-dependent resistor. Not important except it might make google searches return more relevant results.

...which brings me to another question. Is there some way I can mimic an audio signal in spice...or at least vary the amplitude of my input. The filters work best in dynamic environments (That's how it knows when to wah) and so using a 60Hz sine wave doesn't give me much of that.

Again, I don't know about your spice, but LTSpice lets you import a .WAV file to use as a signal source. I would presume Orcad's does as well. Check the help file.

Oh wait. A couple of forum posts I found mentioned that the Pspice student version does not include the ability to use a .WAV file as a signal source.

Have you considered downloading and trying LTSpice? It might not have all the bells and whistles of Pspice (well, it has at least one bell Pspice doesn't have: the .WAV file thing). Bonus features: you aren't cut off when you graduate and more people here are likely to have it installed and be familiar with it.


Torben
 
You might be able to replace an LDR with a FET. Just put an RC on the gate to slow down its response.

I recall making an audio limiter this way when I was in college, but I no longer have the schematic.
 
You sold me - LTSpice rocks. I can put a guitar sample in and get the filtered signal out...and listen to it! This is super exciting - I'm glad you suggested it.

I'm still having some difficulty with the LDR, though. I don't have the VAR_LDR part in LTSpice - just a part called a varistor...which I don't know how to use.

The actual circuit component is an LDR 0805, which I can't find any datasheets for...I'll continue to look in hopes that something useful pops up.

Anyways - here's a waveform I got without using LDRs (attached). I hooked it up to a band pass filter on the output. The sound really doesn't change that much, so there's still something missing. The det_out is the voltage that controls the LDRs.

Edit: I'll go the FET route if I have to I guess. :)
 

Attachments

  • waveform.gif
    waveform.gif
    43.7 KB · Views: 682
Cool! Yeah, the original document even mentions the "mystery LDR" so it might be hard to find. Normally I just cheat and test a few from a Radio Shack grab bag, find one that's fairly close to what I want, and rejigger things to work with it.

The fun thing (for me) is that you've got me back working on one of my long-term on-again-off-again projects, which is an audio preamp with optical limiting.

Good luck and be sure to keep us posted on how the DIY Mutron works!


Torben
 
Looks like I had some small issues with my circuit before - I think I've ironed most of them out.

I originally thought the control for the LDRs was a very much varying signal based on the envelope. If I've done things right, it's actually more like a digital signal (except from about 1V to -9V or from 1V to 9V, depending on whether you want a "wah" or an "ow").

I attached both the waveform and my circuit to this post. I think I'm still just having problems with the silly resistors. What do you guys recommend. I'm just trying to use the varistor part in LTSpice - did I hook them up wrong?

Glad I inspired you Torben! Thanks for all the help on this. Once I get past simulation I'll be fine for building the circuit and box. I just hate to skip this step and end up frustrated when my circuit doesn't work.
 

Attachments

  • waveform2.gif
    waveform2.gif
    54.3 KB · Views: 763
  • schematic.gif
    schematic.gif
    41.8 KB · Views: 1,141
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top