ENGR337 Lab 2018 Spring
Lab 2 Use LTSpice for circuit simulation.
Due Jan 22, Monday 10 pm. 

Outcome of this lab:
1. Be familiar with LTSpice.
2. Be able to do DC, AC, and trancient analysis.


1. Create a text file and code the following circuit in Spice (not in schematic). Use transient analysis to simulate the voltages at all voltage nodes. Compare the simulation results to your calculation (use mesh current method to solve it). Build the circuit on your bread board and measure the node voltages. Put all your calculation, simulation, and experimental data in a single table in your report.
** hint: '.tran 0 1 .01' means 'transient analysis, starting from time 0, ending at 1 second, step size is 0.01 second. This can be simplified as '.tran 1', which only shows the ending point at 1s.

2. Code the following ciruit in Spice (not in schematic). Use transient analysis to acquire the simulation results. Display the input and the output signal in one plot, and measure the time-delay, and the amplitude attenuation of the output signal compare to the input. The following figure shows you the time-delay. Compare your calculation to the simulation results.

3. DC sweep.
In DC analysis, the X axis will be a DC voltage other than 'time' in transient analysis.
In the following schematic, the circuit ran a DC sweep for the input voltage from -2 V to 5 V. The X axis will be the 'sweep' of the DV values for Vin, the Y axis is the voltages that affected by the input.
Implement this circuit using Spice code, and then show your simulation results in your report.

4. AC analysis (AC sweep)
In Ac analysis, the X axis will be 'frequency', the Y axis will be the amplitude. This is very powerful. Think about that, you can use this analysis to test the bandwidth of the circuit.
'.ac dec 1000 1 1MEG' means the axis units are in decades of increment, starting from 1 Hz to 1MEG Hz.
Implement this circuit in Spice code, and report your results.
** hint: the AC source here can be coded as: 'Vin Vin 0 ac 1'

5. DC pulses
Now let's use DC pulses as the input voltage source to drive a capacitor.
Use the Spice code to implement the following circuit and then measure the time-delay of the circuit. Compare it to your calculation.
**hint: the pulse function means PULSE (LowVoltage   HighVoltage   Delay   RisingTime   FallingTime   OnTime   Period). The reason that the period is a little longer than the 'On' time is the rising edge and the falling edge of the pulse are also taking time even though they are short. 

Build this cicuit on a breadboard, and compare the measured time-delay to your calculations and simulations.

Follow the lab report guidelines to avoid losing points.