<b>Narration</b>

1
00:00:01 --> 00:00:07
Welcome to the spoken tutorial on “<b>Schematic Creation </b>and <b>Simulation </b>using<b> eSim</b>”

2
00:00:08 --> 00:00:25
In this tutorial, using <b>eSim,</b> we will learn to-
<p>Create <b>circuit schematic</b>
</p><p>Generate <b>spice netlist</b>
</p><p>Convert spice <b>netlist </b>to <b>ngspice </b>format
</p><p>Simulate the <b>netlist</b>
</p>

3
00:00:26 --> 00:00:37
To record this tutorial, we will use-
<p><b>Ubuntu Linux OS </b>16.04 
</p><p><b>eSim </b>version 1.1.2.
</p>

4
00:00:38 --> 00:00:46
To practice this tutorial, basic knowledge of <b>analog </b>and<b> digital electronics</b> is required.

5
00:00:47 --> 00:00:54
To launch <b>eSim</b>, double-click on the <b>eSim</b> icon on your desktop.

6
00:00:55 --> 00:01:00
Alternately, you can also open <b>eSim</b> from the <b>terminal.</b>

7
00:01:01 --> 00:01:10
To do so, press <b>Ctrl, Alt </b>and <b>T</b> keys together. Now, type <b>esim</b> and press <b>Enter.</b>

8
00:01:11 --> 00:01:13
<b>eSim </b>window opens up.

9
00:01:14 --> 00:01:26
Note that the project files created will be saved in the<b> eSim-Workspace</b> directory, by default. Press “<b>Ok</b>” in the dialog box.

10
00:01:27 --> 00:01:32
Let us now create an <b>RC circuit schematic </b>and simulate it.

11
00:01:33 --> 00:01:46
Click on the <b>New Project button</b>, to create a new project. In the “<b>Enter Project name</b>” field, type <b>RC </b>and click on <b>OK</b>.

12
00:01:47 --> 00:01:52
Please note that spaces are not allowed in the Project name.

13
00:01:53 --> 00:01:58
Our new project <b>RC</b> will now appear under <b>Projects.</b>

14
00:01:59 --> 00:02:03
<b>Double-click</b> on <b>RC </b>to select the project.

15
00:02:04 --> 00:02:11
To create the <b>circuit schematic</b>, click<b> Open Schematic</b> button on the left toolbar.

16
00:02:12 --> 00:02:16
Click on <b>Yes in</b> the<b> confirmation </b>dialog box.

17
00:02:17 --> 00:02:21
Ignore the <b>eeschema error</b> by clicking <b>OK</b>.

18
00:02:22 --> 00:02:25
The <b>Schematic editor </b>window opens up.

19
00:02:26 --> 00:02:30
Let us now add <b>components</b> to the <b>schematic</b>.

20
00:02:31 --> 00:02:39
Click on <b>Place component </b>tool from the right toolbar. Now click anywhere on the <b>editor</b>.

21
00:02:40 --> 00:02:48
Type <b>eSim_Devices</b> in the <b>Filter</b> field.

22
00:02:49 --> 00:02:59
Then select <b>R</b> and click on <b>OK</b>. Now click anywhere on the <b>editor</b>.

23
00:03:00 --> 00:03:06
Place the <b>resistor R </b>on the <b>editor, </b>by clicking on the <b>editor </b>once.

24
00:03:07 --> 00:03:10
Zoom in by pressing <b>F1.</b>

25
00:03:11 --> 00:03:17
You can also do so, by scrolling the scroll button of your mouse.

26
00:03:18 --> 00:03:21
Click on the <b>editor </b>once again.

27
00:03:22 --> 00:03:32
Type again <b>eSim_Devices</b> in the <b>Filter</b> field.  Then select <b>C</b> and click on <b>OK</b>.

28
00:03:33 --> 00:03:38
Place the <b>capacitor C </b>on the <b>editor </b>as done before.

29
00:03:39 --> 00:03:42
Click again on the <b>editor</b>.

30
00:03:43 --> 00:03:49
Type <b>eSim_Sources</b> in the <b>Filter</b> field,

31
00:03:50 --> 00:03:55
select <b>sine</b> and click on <b>OK</b>.

32
00:03:56 --> 00:04:01
Place the <b>sine </b>on the <b>editor </b>as done before.

33
00:04:02 --> 00:04:11
Similarly, type <b>gnd </b>and place a <b>ground terminal </b>on <b>editor</b>.

34
00:04:12 --> 00:04:25
Similarly, type <b>eSim_Plot, </b>select the<b> plot_v1 </b>and place it on the <b>editor.</b>

35
00:04:26 --> 00:04:29
We need one more plot for output.

36
00:04:30 --> 00:04:44
Place the cursor on <b>plot_v1</b>, right click and select <b>copy component</b>. Now <b>place it </b>on the editor.

37
00:04:45 --> 00:04:51
This is the <b>plot component </b>used to plot <b>voltages </b>at the required <b>nodes.</b>

38
00:04:52 --> 00:04:55
Let us now add <b>labels</b> to the <b>schematic</b>.

39
00:04:56 --> 00:05:01
The <b>labels</b> are used to name the required <b>nodes </b>in the circuit.

40
00:05:02 --> 00:05:08
This will help us understand the <b>netlist</b> and connection of our circuit.

41
00:05:09 --> 00:05:18
Click on <b>Place global label </b>tool from the right toolbar. Now click anywhere on the <b>editor.</b>

42
00:05:19 --> 00:05:26
Type <b>IN </b>in text field and click on <b>OK.</b>

43
00:05:27 --> 00:05:35
Similarly, place one more label <b>OUT </b>in editor.

44
00:05:36 --> 00:05:41
Let us move and arrange the components to create the <b>RC circuit.</b>

45
00:05:42 --> 00:05:49
To move the <b>resistor, </b>place the cursor on it and press the key '<b>m'</b>.

46
00:05:50 --> 00:05:56
Place it at the preferred location, by clicking on editor again.

47
00:05:57 --> 00:06:04
To rotate the <b>resistor, </b>place the cursor on it and press the key '<b>r'.</b>

48
00:06:05 --> 00:06:10
Similarly, move the <b>plot components </b>and <b>labels, </b>as shown.

49
00:06:11 --> 00:06:15
Now, let us connect the various components using wires.

50
00:06:16 --> 00:06:21
Click on <b>Place wire </b>button<b> </b>from the right toolbar

51
00:06:22 --> 00:06:25
Click on one end of the <b>sine source</b>.

52
00:06:26 --> 00:06:32
Move the cursor point to one end of the <b>resistor </b>and click on it.

53
00:06:33 --> 00:06:39
Similarly, connect all the components as demonstrated here.

54
00:06:40 --> 00:06:44
The <b>plot</b> components are placed at the <b>output </b>and <b>input nodes</b>.

55
00:06:45 --> 00:06:52
This helps us to view the corresponding <b>voltage waveforms </b>on simulation.

56
00:06:53 --> 00:07:00
To <b>annotate </b>the <b>schematic components</b>,  Click on <b>Annotate </b>button from the top toolbar.

57
00:07:01 --> 00:07:10
Click on <b>Annotate </b>and then click on <b>OK.</b> The <b>schematic </b>is now <b>annotated</b>.

58
00:07:11 --> 00:07:17
To assign a value to the <b>resistor</b>, right-click on it and choose <b>Edit Component.</b>

59
00:07:18 --> 00:07:25
Click on <b>Value</b>. Type <b>1k </b>and click on <b>OK</b>.

60
00:07:26 --> 00:07:32
Similarly, assign value <b>1u</b> for <b>capacitor.</b>

61
00:07:33 --> 00:07:37
Now let us do <b>electrical rules check </b>for this <b>schematic</b>.

62
00:07:38 --> 00:07:46
Click on <b>Perform electrical rules check </b>button on the <b>top toolbar </b>. Click on <b>Run</b>.

63
00:07:47 --> 00:07:57
We can see the errors -
<p><b>global label not connected</b><i> </i> and<b> a pin is not driven to components</b>
</p>

64
00:07:58 --> 00:08:05
Ignore<b> </b>the <b>global label not connected </b>error, since we have used the <b>labels </b>for naming the <b>nodes </b>only.

65
00:08:06 --> 00:08:08
Close the <b>ERC </b>window.

66
00:08:09 --> 00:08:16
Note that the <b>ground terminal pin is </b>highlighted by a green arrow in the <b>schematic.</b>

67
00:08:17 --> 00:08:21
It means that this <b>pin </b>is not driven by any power source.

68
00:08:22 --> 00:08:25
To prevent this, let us place a <b>power flag.</b>

69
00:08:26 --> 00:08:32
Click on <b>Place component </b>tool. Click on the <b>Schematic editor</b>.

70
00:08:33 --> 00:08:46
Type <b>PWR underscore FLAG and Click OK</b>. Place it on the <b>schematic editor.</b>

71
00:08:47 --> 00:08:52
Connect this <b>power flag </b>to the <b>ground terminal </b>using a wire.

72
00:08:53 --> 00:08:58
This indicates that a power source will be connected here.

73
00:08:59 --> 00:09:03
Now repeat the <b>electrical rules check</b>.

74
00:09:04 --> 00:09:11
There will be only <b>global label not connected</b> errors, which can be <b>ignored.</b>

75
00:09:12 --> 00:09:17
Click on <b>Delete Markers</b> and then click on <b>Close.</b>

76
00:09:18 --> 00:09:22
Now let us generate the<b> netlist </b>of this <b>circuit.</b>

77
00:09:23 --> 00:09:28
Click on <b>Generate netlist </b>button<b> </b>from the top toolbar.

78
00:09:29 --> 00:09:40
Click on the <b>Spice </b>tab. Check the option <b>Default format </b>and then click on <b>Generate.</b> Click on <b>Save.</b>

79
00:09:41 --> 00:09:50
A Kicad<b> netlist </b>of the <b>RC circuit </b>has been generated. Now minimise the <b>schematic editor.</b>

80
00:09:51 --> 00:09:56
Now, let us add simulation parameters to this <b>netlist.</b>

81
00:09:57 --> 00:10:03
Click on <b>Convert Kicad to Ngspice </b>from <b>eSim </b>toolbar.

82
00:10:04 --> 00:10:08
Let us add <b>transient parameters</b> in <b>Analysis tab.</b>

83
00:10:09 --> 00:10:12
By default, <b>Transient</b> is selected.

84
00:10:13 --> 00:10:19
Scroll down to enter values in the <b>Transient analysis</b> fields.

85
00:10:20 --> 00:10:26
Make <b>Start Time </b>equal to <b>0 </b>by doing the following:

86
00:10:27 --> 00:10:31
Type <b>0 </b>in the start textbox.

87
00:10:32 --> 00:10:42
Similarly, make the <b>Step time 5 milliseconds</b> and <b>Stop time 30 milliseconds.</b>

88
00:10:43 --> 00:10:44
Let us add the <b>source details</b>

89
00:10:45 --> 00:10:50
To do so, click on <b>Source details</b> tab.

90
00:10:51 --> 00:10:56
<b>Enter </b>the <b>offset value </b>as <b>0 </b>and press <b>Tab.</b>

91
00:10:57 --> 00:11:09
Type <b>5 </b>for <b>amplitude</b>, <b>50 </b>for <b>frequency </b>and<b> 0 </b>for both <b>delay time </b>and <b>damping factor</b>.

92
00:11:10 --> 00:11:19
We will talk about the <b>Ngspice Model, Device Modelling and subcircuits tab </b>in later tutorials.

93
00:11:20 --> 00:11:27
Press the <b>Convert </b>button to <b>convert the kicad netlist to ngspice netlist</b>

94
00:11:28 --> 00:11:34
A confirmation dialog box appears. Here let's click O<b>k.</b>

95
00:11:35 --> 00:11:42
Close the <b>kicad to ngspice</b> tool by clicking close at the top right corner of the window.

96
00:11:43 --> 00:11:49
Click on <b>simulation </b>from the <b>eSim </b>toolbar to simulate the <b>example.</b>

97
00:11:50 --> 00:11:57
An <b>ngspice terminal </b>and <b>plot </b>windows open along with a <b>python plot</b> window.

98
00:11:58 --> 00:12:03
The plot waveforms show <b>transient analysis </b>of the <b>RC </b>circuit.

99
00:12:04 --> 00:12:08
Close the <b>Ngspice terminal </b>and <b>plot</b> window.

100
00:12:09 --> 00:12:15
Select the python plot window by clicking on <b>Plotting</b> tab in the dock area.

101
00:12:16 --> 00:12:19
Maximize the <b>Python</b> plot window.

102
00:12:20 --> 00:12:27
To plot the output: Check the <b>IN </b>and <b>OUT</b> nodes and click on the <b>plot</b> button.

103
00:12:28 --> 00:12:34
The <b>output plot</b> is shown in <b>blue</b> and <b>input plot </b>in <b>red.</b>

104
00:12:35 --> 00:12:41
To view the <b>rms values</b> of <b>node voltages,</b> click on the <b>multimeter</b> button.

105
00:12:42 --> 00:12:48
The <b>Multimeter</b> window opens up, which will be on top of all other windows.

106
00:12:49 --> 00:12:58
<b>Maximise</b> the <b>schematic </b>and <b>drag</b> the <b>multimeter windows</b> on the corresponding nodes of schematic.

107
00:12:59 --> 00:13:05
Let us see how to <b>simulate</b> a circuit involving <b>semiconductor devices</b> and <b>subcircuits</b>.

108
00:13:06 --> 00:13:15
Let us simulate <b>7805VoltageRegulator</b> circuit, which has <b>diode</b>s and a <b>LM7805 regulator IC</b>.

109
00:13:16 --> 00:13:20
Click on <b>Open Project</b> button from the left toolbar.

110
00:13:21 --> 00:13:26
Click on <b>Desktop.</b> Click on <b>7805VoltageRegulator.</b>

111
00:13:27 --> 00:13:31
And click on the <b>Open button</b> at the bottom right corner.

112
00:13:32 --> 00:13:38
In the <b>Projects </b>window of <b>eSim, </b>double-click on <b>7805VoltageRegulator.</b>

113
00:13:39 --> 00:13:43
Click on <b>Open Schematic</b> button from the left toolbar.

114
00:13:44 --> 00:13:50
I have annotated, performed <b>ERC</b>, and generated the <b>spice netlist</b> for this circuit.

115
00:13:51 --> 00:13:54
I will now switch back to the <b>eSim Main Window</b>

116
00:13:55 --> 00:13:59
Now, let us add <b>simulation parameters</b> to this <b>netlist.</b>

117
00:14:00 --> 00:14:05
Click on <b>Convert Kicad to Ngspice </b>from <b>eSim </b>toolbar.

118
00:14:06 --> 00:14:13
I have already added the parameter values in the <b>Analysis and source details</b> tab.

119
00:14:14 --> 00:14:20
Let us assign <b>device</b> <b>models</b> to the <b>semiconductor </b>components inside the <b>schematic</b>.

120
00:14:21 --> 00:14:25
To do so, click on <b>Device Modelling </b>tab.

121
00:14:26 --> 00:14:32
We will add a <b>device model</b> for <b>Diode 1: esim_diode</b>

122
00:14:33 --> 00:14:37
Click on <b>Add </b>and then double-click on <b>Diode.</b>

123
00:14:38 --> 00:14:43
Click on <b>D.lib</b> Then click on the <b>Open</b> button.

124
00:14:44 --> 00:14:49
We will perform the same steps for the remaining <b>diodes</b> as well.

125
00:14:50 --> 00:15:00
Now let’s add the <b>subcircuit</b> file for <b>LM_7805 subcircuit</b>. To do so, click on <b>Subcircuits </b>tab.

126
00:15:01 --> 00:15:09
Click on <b>Add</b> Double-click on <b>lm7805 </b>folder and then click on the <b>Open</b> button.

127
00:15:10 --> 00:15:15
Press the <b>Convert </b>button to convert the<b> kicad netlist </b>to <b>ngspice netlist</b>.

128
00:15:16 --> 00:15:21
A confirmation dialog box appears. Here let's click <b>Ok.</b>

129
00:15:22 --> 00:15:26
Click on <b>simulation </b>from the left<b> </b>toolbar.

130
00:15:27 --> 00:15:36
An <b>ngspice terminal </b>and ngspice <b>plot </b>windows opens along with a <b>python plot</b> window.

131
00:15:37 --> 00:15:45
Click on<b> in1, in2 </b>and<b> out </b>checkboxes in the <b>python plot</b> window.

132
00:15:46 --> 00:15:50
Scroll down and click on <b>plot</b> button.

133
00:15:51 --> 00:15:53
Now let us summarize.

134
00:15:54 --> 00:16:09
In this tutorial, we learnt how to-
<p>Create <b>circuit schematic </b>
</p><p>Generate spice <b>netlist</b>
</p><p>Convert spice <b>netlist </b>to <b>ngspice </b>format 
</p><p>Simulate the <b>netlist</b>
</p>

135
00:16:10 --> 00:16:13
Please post your timed queries in this forum.

136
00:16:14 --> 00:16:19
Please post your general queries on eSim in this forum.

137
00:16:20 --> 00:16:29
<b>FOSSEE</b> team coordinates the TBC project.

138
00:16:30 --> 00:16:35
Spoken Tutorial Project is funded by <b>NMEICT, MHRD</b>, Govt. of India. For more details, visit this website.

139
00:16:36 --> 00:16:41
This is Usha from IIT Bombay, signing off. Thank you.

