ESim/C2/Simulating-an-Astable-Multivibrator/English
Simulating Astable Multivibrator
Author: Saurabh Bansode
Keywords: video tutorial, eSim, EDA, schematic, simulation, Design, Spice models, ngspice, kicad, analysis, transient
Visual cue | Narration |
Show Slide:
Opening Slide
|
Welcome to the spoken tutorial on “Simulating Astable Multivibrator in eSim”. |
Show Slide:
Learning Objectives |
In this tutorial, we will -
|
Show Slide:
Systems Requirements |
To record this tutorial, we will use-* Ubuntu Linux OS 16.04
|
Show Slide:
Prerequisites |
To practice this tutorial, basic knowledge of electronics is required. |
Show Slide:
Circuit Diagram |
Earlier, we learnt how to create a schematic for an RC circuit.
|
<<FAST-FORWARD>> | A considerable part of this activity has been fast forwarded.
|
Show Slide:
Download Code File |
The partially made circuit schematic is available in the Code files link.
|
eSim Main Window: | Launch eSim on your machine.
|
Click on Open Project >>Browse To Desktop >>click on AstableMultivibrator>>click on Open | Click on Open Project on the left toolbar.
|
eSim Main Window:
Click on Open Schematic |
Click on the Open Schematic button on the left toolbar. |
Schematic Editor Window:
Press F1 to zoom in.
|
Press the F1 key to zoom into the schematic.
|
Point to the connections | Several connections are already made. |
Let us connect the remaining components. | |
eSim Schematic Window:
Hover the mouse over the end points of eSim_LED and eSim_R present on the right hand side of the schematic. |
The wires should be connected end-to-end for the components, not external outlines. |
I will demonstrate a common mistake now. | |
eSim Schematic Editor:
Select the Place Wire tool from right toolbar.
|
Select the Place Wire tool from right toolbar.
|
eSim Schematic Editor:
Zoom and point to the empty square block.
|
The empty green box shows that the connection is not proper.
|
Let us properly connect the eSim_LED present on the right side of the schematic. | |
Schematic Editor Window:
Click on Place Wire: |
Click on Place Wire tool on the right toolbar. |
Click on unconnected node of the resistor
>> Drag cursor till the Node 1 of eSim_LED>> |
Click on the unconnected node of the resistor.
Then drag the cursor till node 1 of eSim_LED |
click once on the eSim_R node
|
Click once on the eSim_LED node to place the wire.
Press Esc key. |
Schematic Editor Window:
Click on Place Wire: >>Click on Node 2 of eSim_LED >> Drag the cursor till the wire connecting adjacent transistor and capacitor>>Click once on the existing wire >> press the Esc key |
Select the Place Wire tool and click on the node 2 of eSim_LED.
Drag the cursor till the wire connecting the adjacent transistor and capacitor.
Now press the Esc key. |
Schematic Editor:
Zoom into the junction and hover the mouse over it. |
If the wires are placed properly, you will see a green dot where the wires intersect.
This is called a junction. |
Schematic Editor:
Right click on plot_v1 >>Select Copy Component >> Click once on the editor. |
Right-click on plot_v1 and select the Copy component option.
Plot_v1 will be tied to the cursor. |
Drag the cursor near the LED on the right side>>click once to Place it next to the LED | Drag the cursor near the LED on the right side.
Place it next to the LED by clicking once on the editor. |
Schematic Editor:
Select Place Global Label option from the right toolbar >>click once on editor>> Enter LED2>>Click OK>> |
Click on Place Global Label on the right toolbar to place a global label.
Click once on the editor. Type the text LED2 and click on OK. LED2 global label will be tied to the cursor. |
Click once near the LED. | Place the LED2 global label near the LED on the right side by clicking on the editor once.
Rotate the Global label if required. |
Schematic Editor:
Right click on eSim_CP1>> Choose Edit Component>> choose Value >> erase eSim_CP1 and type 22u >>Click on OK |
Right-click on eSim_CP1.
|
Schematic Editor:
Place cursor on eSim_R>> Press the key V >> erase eSim_R and type 1k >> Click on OK |
Right-click on eSim_R.
|
Schematic Editor:
Hover mouse over DC source |
We will assign a value to the DC source later. |
Schematic Editor:
Select Place wire tool>> Click on plot_v1, drag till junction>>click once>>click once on LED2>>drag till junction and click once
|
Connect plot_v1 and LED2 global label to the junction as shown. |
Schematic Editor:
Click on Annotate Schematic>> Click on Annotate >> Click OK>> Press Ctrl and S keys simultaneously
|
Click on Annotate Schematic tool on the top toolbar.
|
Schematic Editor:
Click on Perform electrical Rules check >>Click on Run |
Click on Perform electrical Rules check on the top toolbar.
|
ERC Window:
Click Delete markers>> Click Close |
We can see three warnings regarding Global label, which can be ignored.
|
Schematic Editor WIndow:
Click Generate netlist >> |
Click on Generate Netlist on the top toolbar. |
Generate Netlist WIndow:
spice tab >> check Default >> click on Generate >> Click Save. |
Click on Spice tab, and check the Default Format option.
|
Now I will switch back to eSim main window. | |
eSim Main window:
Double click on AstableMultivibrator>> Click on KicadtoNgspice |
Double-click on AstableMultivibrator.
|
Kicad to Ngspice Converter:
Analysis Tab Show:
Highlight the values entered.
Start Time 0 Step Time 10 milliseconds Stop Time 12 |
Type the values for transient parameters as shown. |
Kicad to ngspice convertor
Window: Click on source details tab |
Click on source details tab. |
Kicad to ngspice convertor
Window: Source Details Tab |
Type the value of DC source as 9.
|
Kicad to Ngspice Converter:
Device Modeling tab:
|
Click on Device Modeling tab.
|
Similarly add the library files for d2:esim_led | |
Kicad to Ngspice Converter:
Device Modeling tab: Click on Add >> Double click on Transistor folder >> select BC547B.lib >> click on Open |
Click on the Add button under q1:esim_npn.
|
Similarly add the library files for q2:esim_npn | |
Kicad to Ngspice Converter:
Device Modeling tab: Click on Convert >> Click OK |
Now press the Convert button to convert the KiCad netlist to Ngspice netlist.
|
eSim Main Window:
Click on Simulation. |
Click on simulation on the eSim toolbar to simulate the example. |
Ngspice Terminal:
|
Ngspice terminal and plot windows open along with a python plot window.
|
Type plot v(LED1)+v(LED2) >> press Enter. |
Ngspice commands can be entered to see plots in this terminal.
|
Hover the mouse over LED1+LED2 voltage plots. | We can see the voltage at nodes LED1 and LED2 combined in a single plot. |
Any error will be displayed on the terminal or the value will be replaced with a question mark. | |
I will switch to Python Plot window now. | |
Python Plot Window:
Click on LED1, LED2 and IN. >>Click on plot. |
Click on LED1, LED2 and IN checkboxes in the python plot window.
|
If analysis time parameters are not set properly, Python Plotting error will be generated.
| |
eSim Main Window:
|
Right click on AstableMultivibrator and select the refresh option
|
eSim Main Window:
Double click on AstableMultivibrator.cir.out
|
The cir.out file is passed to ngspice for running simulations.
|
Let us summarize. | |
Show Slide:
Summary |
In this tutorial, we learnt to-* Create and simulate an Astable Multivibrator.
|
Show Slide:
Forum |
Please post your timed queries in this forum. |
Show Slide:
FOSSEE Forum |
Please post your general queries on eSim in this forum. |
Show Slide:
Lab Migration |
FOSSEE team coordinates the Lab Migration project. |
Show Slide:
Circuit Simulation Project |
FOSSEE team coordinates the Circuit Simulation Project. |
Show Slide:
Acknowledgment |
Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India.
|
Previous slide
|
This is Saurabh from IIT Bombay, signing off.
Thank you. |