3
\$\begingroup\$

I just recently started to study circuits. I have a homework assignment and I need to simulate some circuits, but I don't know what simulator should I use. I was using CircuitLab but as I don't know how to configure it I don't know what to expect in the plots and if they are correct or not.

This is one of the circuits I'm doing but I have no idea of what the plots mean and if I'm using it right, I just want to know how to configure it to know if the LED is turning on or is not or to know how to interpret the plots.

enter image description here

These are the parameters I put in:

enter image description here

This is the plot:

enter image description here

\$\endgroup\$
5
  • 10
    \$\begingroup\$ I cannot say this with enough emphasis, do not use a simulator with "hunt and peck" poking of part values in a hope that you will learn anything. I had much to learn when Spice finally became available to me and I'm as guilty as anyone thinking I could learn by poking around with a simulator. Stupid me. Doesn't work that way. Study theory. Study ways people put stuff together to achieve goals. Develop your imagination. Use a simulator to test your imagination, part vagaries, temp impacts, etc. But not as a way to learn theory through random poking around. \$\endgroup\$ Mar 2 at 7:01
  • 1
    \$\begingroup\$ I strongly support every single word of the previous comment. \$\endgroup\$
    – LvW
    Mar 2 at 8:53
  • 1
    \$\begingroup\$ This is right, SPICE in its many variants is for simulation (analysis). Synthesis is an entirely different animal. You can 'design' a biasing circuit by fiddling with resistor values in LTspice but you'll never get finished with something like synthesizing a 6 pole passive filter because there are too many interacting variables. Simulating is a more like building the circuit and testing it. \$\endgroup\$ Mar 2 at 12:24
  • \$\begingroup\$ What do you want the simulator to do for you? \$\endgroup\$
    – user253751
    Mar 2 at 16:19
  • \$\begingroup\$ Does your homework assignment tell you to use a simulator? If so, does it not tell you which one to use? \$\endgroup\$
    – Joel Keene
    Mar 2 at 20:16

6 Answers 6

5
\$\begingroup\$

The voltage and current source symbols in the simulator each have two terminals, but only one wire is connected to each one in your circuit. Both terminals need to be connected for the circuit to work meaningfully.

\$\endgroup\$
3
\$\begingroup\$

I'd recommend LTSpice for simulations.

Also, be mindful of unit suffixes... for example, current sources I6 and I7 on your schematics seem to be sourcing 10 Amps of current which does not make sense in usage with respect to the rest of the circuit schematics.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ The UX of LTspice is repulsive even to professionals. Suggesting it to someone who can just about put a circuit together in CircuitLab is not very helpful. \$\endgroup\$ Mar 2 at 5:33
  • 2
    \$\begingroup\$ @Kubahasn'tforgottenMonica, thousands of people learned to use simulators when the UX was a stack of punch cards, or a text file representing a stack of punch cards. A pretty UX that obscures what's going on in the model is no help to learning. \$\endgroup\$
    – The Photon
    Mar 3 at 7:11
3
\$\begingroup\$

I have a homework and I need to simulate some circuits

I doubt very much that your homework expects you to drive 10A into the bases of small signal transistors.

Here is a list of changes needed to get your circuit to work:

  1. Current sources need to be referenced to some node. If no 2nd node is obvious, they must be referenced to ground (node 0 in SPICE parlance).

  2. The supply voltage source must be referenced to ground.

  3. The supply voltage of 1V is too low to do anything useful in this circuit. 5V is a good starting point.

  4. The current sources should be driving a small current, perhaps microamps (suffix u in CircuitLab) or milliamps (suffix m in CircuitLab).

    There are not all that many transistors that will survive having 10A driven into their bases for long. Note that the current sources don't care about resistors in their paths: if you tell a current source to drive 10A into a transistor through a 10kΩ base resistance, it will drive that current, developing 100kV across the resistor. The resistors used in such circuits will break down (turn into short circuits) with just a couple hundred volts applied across them. With 100kV, small parasitic capacitances of a long piece of wire for example will hold enough charge to vaporize the resistor and the transistor's silicon chip. Don't drive amps through kilo-ohms unless you're designing high-voltage circuits and the resistors are physically huge due to insulation lengths needed.

And... that's it. Make those changes and the circuit will do something useful like turn on the LED. To make it visible, add an amp meter into the circuit. CircuitLab performs DC analysis of simple circuits on-the-fly, so adding meter like ammeters and voltmeters will display the DC values immediately.

CircuitLab is built into this site, so that makes things even easier.

schematic

simulate this circuit – Schematic created using CircuitLab

In CircuitLab, you can save a bit of time by, instead of using a voltage source, using a net label that specifies the voltage on that node. E.g. in your circuit, the +5V supply can be provided as follows:

schematic

simulate this circuit

The syntax of supply voltage nodes is important: node name must start with either a + or a -, then a number with optional decimal point, then the V suffix. The sign, at least one digit, and the suffix must be always present. Additional digits, and decimal point, are optional.

i just want to know how do i configure it to know if the led is turning on or is not or to know how to interpret the plots.

What are you trying to plot? All you need to know is the DC LED current. It's just one number, nothing to plot.

  • Hover the mouse pointer over the LED to know what current flows through it. That's all, as long as the little green circle appears in the bottom-right of the simulator.

    Or do as I have done and add necessary DC voltage and/or current meters to see what's going on without the need to hover mouse cursor over anything.

  • If that circle is yellow, the DC values won't be available instantly and you need to use the DC simulation to compute them. Then hover the mouse cursor that will turn into a little probe icon over one of the wires going to/from the LED, and read the current.

  • If the circle is red, there is a mistake in the circuit or component values or parameters, and no analysis is possible until the mistake is fixed.

\$\endgroup\$
3
  • \$\begingroup\$ Very good explanation; it was a pleasure for me to read it. Do you happen to know how to suppress (graph) autoscaling? It's causing me a lot of trouble. \$\endgroup\$ Mar 2 at 6:56
  • 1
    \$\begingroup\$ @Circuitfantasist No way to do it other than editing the javascript and then getting a greasemonkey script to do the editing every time CircuitLab is opened. As a community of electrical engineers and hobbyists, we do need an open source web-based circuit editor and simulator. I won't have time to work on it for another year or so but it is not an absurdly complex project. ngspice runs in the browser just fine via emscripten, even multi-threaded. An editor and some interfacing glue is needed. \$\endgroup\$ Mar 2 at 14:02
  • \$\begingroup\$ I am far from these software tricks. For now, I'm doing it by adding a fake output quantity that's bigger but close to the main one. Then I delete its graph with a graphic editor. \$\endgroup\$ Mar 2 at 15:41
2
\$\begingroup\$

I don’t much care for CircuitLab. It’s very limited and kind of clunky to use.

If you want to do regular Spice style sims, LTSpice or Micro-Cap are probably the best.

If you just want to learn how circuits work, Falstad is a great way to do that. It works interactively and visualizes current and voltage directly within the schematic.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ The schematic editor of CircuitLab handily beats every other "native" SPICE front-end out there (LTspice, MicroCap, Tina-TI, Proteus) in terms of user experience. It is a joy to use, even with the few bugs still present. The presumably jscircuit simulation engine behind it is trash, of course, but that was a silly choice anyway. NGspice runs just fine in web browsers via emscripten. Why they didn't use that baffles me to this day. Falstad is not a bad suggestion either. \$\endgroup\$ Mar 2 at 5:36
  • 1
    \$\begingroup\$ @Kubahasn'tforgottenMonica I can't even use CircuitLab here on this site for simulation purposes. Doesn't work. I do pay them their due, each year, because I use it here and I think they deserve the support regardless of my difficulties using it here. I would ask you for help -- seems you can get it working fine and perhaps you could tell me what's wrong with my attempts -- but since I only use it for documentation I don't suppose it matters. Each of us finds the tools that work for us, I guess. There's no panacea that works for all, would be my summary. \$\endgroup\$ Mar 2 at 6:52
1
\$\begingroup\$

In addition to @Kuba's perfect explanations, I would add a few more:

  • V(D2.nK) means the LED's cathode voltage (referenced to ground) which is actually ground here ("n" means "node"). So it should be V(D2.nA) which is the anode voltage.

  • The step of simulation should be smaller (e. g. 0.1 or less) since the LED graph is non-linear and needs more points.

  • You can change the meter's internal resistance in the parameters window. This way you can use them as "resistors" with visualized voltages across and currents through them. This trick is considered by some to be misleading, but it greatly simplifies schematics.

See also My CircuitLab bag of tricks.

\$\endgroup\$
1
\$\begingroup\$

I would suggest LTspice for simulation. There is a solid support community out there (an active mailing list and a wiki) and a vast number of components in libraries available from such sources. Александр Бордодынов (Alexander Bordodynov) in particular, but there are others so you don't often need to add new parts by hand.

You can also look at Qorvo's QSPICE by Mike Engelhardt (creator of LTspice) which has a gorgeous modern interface and some other improvements.

Sometimes the component manufacturers don't supply unencrypted models and you are forced to use their simulator such as TI's Tina.

And many of the EDA suppliers try to bundle some form of SPICE in their offering, which I've never found useful. It's an afterthought for them and you'd almost never want to simulate an entire design, usually just some small corner where potentially troublesome analog things are going on. Switching between different schematic editors with different hot keys occupies a few brain cells, but that's what they are there for.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I used to think TINA-TI was hot garbage, until they introduced PSpice for TI. \$\endgroup\$
    – The Photon
    Mar 3 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.