Skip to content

Session 2: Analog Basics

Link to class

What I learned this week

All MOSFETs look the same to me at first sight. It took me a while to catch the symbols and to figure out where source and drain are depending on the type. I really enjoyed SimulIDE simuation environement

Project homework:

Modify the AND gate netlist to create an OR gate instead

Here is the original AND gate, in SimulIDE

This is when A is LOW and B is HIGH

Here is the OR gate for this assignment, with A and B low. This was mainly a question ou rearraging the pull-down and pull-up networks.

Here is the OR gate, with A and B high

Here is the OR gate, with A low and B high

Here is the OR gate, with A high and B low

Schmitt trigger analysis: Look up a CMOS Schmitt trigger schematic and identify which transistors set the upper vs lower threshold

Here is a simulation. - On the left, there are two ways to feed the signal. One is simply a fixed voltage, the other one allows to load a real or synthetic wave recording that reflect the bouncing that happens when someone press on a switch - In the middle, I reproduced the design presented during the course. I added an inverter to make it easier to compare input and output signals - On the right, we can see both input and output signal

I think the low and high thresholds depend on the two feed-back loops.

I tried to set two thresholds (1.3v and 3.7v) and here is the simulation. At startup, signal is LOW and output as well

Let’s ramp up and cross the first threshold (1,3v). Output remains low.

Let’s continue the ramp-up and cross the second threshold at 3.7v. Output turns to HIGH and locks.

Let’s bounce for a while but never bellow the bottom threshold. Output remains HIGH

Let’s ramp down and cross the lower limit. Output turns LOW and is locked.

Here is what happens when bouncing too much, crossing both lower and upper limit. We could make this better by decreasing the lower limit and increasing the upper limit a little bit

Optional: Build a simple circuit (LED + resistor + button) in TinkerCAD and observe current flow

With button idle

With button pressed. While electrons actually flow from negative to positive, conventional current is historically defined as flowing from positive to negative. (Franklin, oups! )

Bonus: a project I reproduced in SimulIDE. Original idea belongs to Giovanni Carrera and was published in Elektor magazine

Link

The 4-20 mA current loop is the standard analog signal for industrial process control, representing 0–100% of a measurement (e.g., pressure, flow) using 4 mA for the lower limit and 20 mA for the upper limit. It offers high noise immunity and enables long-distance transmission, using a “live zero” (4 mA) to detect loop failures.

The purpose of this project is to provide a 4…20 mA output from a PWM signal generated by an ATmega328 microcontroller (and numerous other chips, such as the PICs). One of the more interesting applications of this circuit would be to replace or to realize a smart sensor with Arduino.

  • Step 1: generate a 5V PWM
  • Step 2: convert to a 1.5V PWM
  • Step 3: use a 2nd order low-pass filter to cut the noise
  • Step 4: convert voltage to current

I ran this in a simulator to get a better undestanding of what part does what, where the current flows and when…