Projects / Sample and hold circuit

Sample and hold circuit

Intermediate1.5 hGuided buildReviewed

Build it step by step

0 of 6 done
  1. Build the clock

    Wire the 555 astable and check pin 3 pulses with an LED and resistor.

  2. Wire the switch

    Connect the CD4066 with its unused control pins to ground.

  3. LM35826.5°C

    Add the hold capacitor and buffer

    Fit the 100 nF capacitor and the LM358 follower.

  4. Turn the pot slowly

    Watch the output on the meter follow the pot in steps.

  5. Look at it on a scope

    If you have one, feed a slow sine and see the staircase.

  6. Change the hold

    Swap the 100 nF for 10 nF and see more droop.

In short

How do you build a sample and hold circuit?

An analog switch and capacitor freeze a changing voltage on a clock, the first stage of an ADC. This is a track-and-hold with a 555 clock. You need CD4066 quad bilateral switch, LM358 Op-Amp, Ceramic Capacitor 100 nF, NE555 Timer IC, Resistor 10 kΩ × 3, Potentiometer 10 kΩ, Electrolytic capacitor 10 µF, Ceramic Capacitor 100 nF, Digital multimeter, Breadboard 830 Tie Points, 9 V battery and 9 V battery snap with DC jack. It takes 6 steps and about 90 minutes.

Level
Intermediate
Time
About 90 min
Parts
12

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
9 V battery ++ railSupply
9 V battery -- railGround
555 pin 8 and pin 4+ railPower and reset high
555 pin 1- railGround
10 kΩ resistor (R1)+ rail and 555 pin 7Clock timing
10 kΩ resistor (R2)555 pin 7 and pin 6Clock timing
555 pins 2 and 6JoinedAstable connection
10 µF capacitor555 pin 6 and - rail, + on pin 6Timing capacitor, about 5 Hz
100 nF capacitor555 pin 5 and - railControl decoupling
555 pin 3CD4066 pin 13 (control A)Clock closes the switch
CD4066 pin 14+ railPower
CD4066 pin 7- railGround
CD4066 unused control pins 5, 6, 12- railUnused switches off
10 kΩ resistor+ rail and 10 kΩ potentiometer topLimits the input to about 4.5 V
Potentiometer bottom- railInput voltage source
Potentiometer wiperCD4066 pin 1Signal in
CD4066 pin 2100 nF capacitor to - rail and LM358 pin 3 (IN+)Hold capacitor and buffer input
LM358 pin 8 and pin 4+ rail, - railPower
LM358 pin 1 (OUT)LM358 pin 2 (IN-)Unity-gain follower
LM358 pin 1MultimeterHeld output

No code needed

No code. CD4066 pins: 1 and 2 are switch A's two ends, 13 is its control, 14 is the supply and 7 is ground. The 555 gives a square-ish clock around 5 Hz that is high for slightly longer than low, so the circuit follows the input while the clock is high and holds it while it is low. This is therefore a track-and-hold, which is how most real sample-and-hold chips behave when not sampling. The LM358 input bias current causes a small droop of tens of millivolts over a 100 ms hold. Keep the input under about 7 V on a 9 V supply because the LM358 output can only swing to about 1.5 V below the rail.

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Clock highOutput follows the pot
Clock lowOutput stays at the last value
Turning the pot while heldOutput does not change until the next clock high
Slow sine inStaircase on the output

If it does not work

Output never changes

Check the clock on pin 13 and the switch pins.

Output follows the input all the time

The control pin is stuck high or the clock is too fast.

Output droops fast

The hold capacitor is too small or leaky.

Output stuck near 0

Check the follower wiring on the LM358.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the sample and hold circuit?

CD4066 quad bilateral switch, LM358 Op-Amp, Ceramic Capacitor 100 nF, NE555 Timer IC, Resistor 10 kΩ × 3, Potentiometer 10 kΩ, Electrolytic capacitor 10 µF, Ceramic Capacitor 100 nF, Digital multimeter, Breadboard 830 Tie Points, 9 V battery and 9 V battery snap with DC jack.

How long does the sample and hold circuit take to build?

About 90 minutes for a intermediate maker, in 6 steps.

How do I know the sample and hold circuit works?

Clock high: Output follows the pot. Clock low: Output stays at the last value. Turning the pot while held: Output does not change until the next clock high.

Output never changes: what should I check?

Check the clock on pin 13 and the switch pins.

Output follows the input all the time: what should I check?

The control pin is stuck high or the clock is too fast.

Output droops fast: what should I check?

The hold capacitor is too small or leaky.

Output stuck near 0: what should I check?

Check the follower wiring on the LM358.