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.

Model won't run properly

Status
Not open for further replies.

b.james

Member
I am trying to get this model to show me when the schmidt trigger turns the LED on but I am not getting the command right . Can anyone tell me how to make it step through varying settings on both R8 the LDR (2K to 100K Dark)and and U1 the 100K trimpot
 

Attachments

  • LightSensorSchmidtTriggerDraft1.asc
    2 KB · Views: 261
I had to do a lot to make this run on my installation. Your transistors were screwed up??? I had to delete them and replace them with the standard NPNs from the standard LTSpice library. You were missing a ground symbol on the schematic.

I show how to make the LDR be a function of a voltage which is a function of time. V2 varies "lux"; lux varies R8. The primary simulation is a function of time, controlled by the .TRAN 200 statement

I show how to model a 100K pot, which is really nothing but two resistors that vary in-step. Note that the upper resistor R9 varies as (1-x), while the lower resistor R10 varies as x, where allowed range of x is from 0.001 to 0.999. The .step param x 0.1 0.9 0.1 steps the pot wiper from the 10% up from the bottom to 90% position in steps of 10%. This reruns the time-based simulation 9 times, and generates a plot for each run.

Since the Schmitt Trigger didn't trip for most positions of the pot in your original circuit, I reconfigured it such that now it works for most potential positions of the pot wiper.
 

Attachments

  • FixedLightSensorSchmidtTrigger.asc
    2.8 KB · Views: 223
Thanks again Mike. This circuit is from the page you gave me on Transistor Amplifiers from Talking Electronics.So i am trying to understand how it works . Ideally I want to develop it further to make a light sensor for 24V but trying to model these things in LTSpice is proving difficult . The Tutes I have found so far are not very good . Probably good enough if you have done 3 years of Electrical Engineering at Uni but I only did the first year so I find it difficult to follow.
There will be better explanations of PWL ,.step parameter ,and other commands I am sure but I haven't found them yet .
 
Thanks again Mike. This circuit is from the page you gave me on Transistor Amplifiers from Talking Electronics.So i am trying to understand how it works . Ideally I want to develop it further to make a light sensor for 24V but trying to model these things in LTSpice is proving difficult . The Tutes I have found so far are not very good . Probably good enough if you have done 3 years of Electrical Engineering at Uni but I only did the first year so I find it difficult to follow.
There will be better explanations of PWL ,.step parameter ,and other commands I am sure but I haven't found them yet .

Hi

There are some good LTspice tutorials here:

http://www.simonbramble.co.uk/lt_spice/ltspice_lt_spice.htm

LTspice really takes a good understanding of spice simulation to use it. It produces very accurate results (its actually the best), but it doesn't have the graphical bells and whistles other spice programs have.

eT
 
Thanks I have that and its very "dive in the deep end and stay deep"
Easier ones are too shallow.

Mike I've thrown your sim around and around but I still can't see what its telling me . I cant really even tell if the LED is on or off . So I am having trouble visualising whats going on in the circuit and I want to vary stuff to see the result. Getting a bit fed up with it now . I just want a working circuit the same as the other thread that stays on in daylight and goes off in the dark . Then I have the complement to the first one.
Think I'll go kick the cows.
 
The way I tell if a simulated LED is lit or not is to plot the current through it. After a sim run, just move the mouse cursor over the component (resistor, diode, transistor lead, etc) and the cursor changes to an amprobe icon. Right click the mouse button, and the current plot appears in the plot window. A LED used as an indicator should have close to zero current through it when it is off, and ~10 to 20mA when it is lit...

I find that the LTSpice Help file answers a lot of questions...
 
Last edited:
I knew I had seen that somewhere
I am familiar with command line tools but it is the syntax required that I could not find
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top