🚀 C# ile Programlamaya Giriş: Kodlamaya İlk Adımını At, Kendi Projelerini Geliştirmeye Başla!
00HOME
07GLOSSARY 08TAGS ♡MY LIST ⌕SEARCH
TRENG

Oscilloscope and signal generator: sine, square wave, frequency and period

Generate sine and square waves in Proteus and view them on the oscilloscope. Calculate period, frequency, peak and RMS values from the screen divisions; examine a transformer output with a half-wave rectifier.

A voltmeter gives you a single number. But many field problems don't show up in that number: the noise from a motor drive, the ripple of a rectifier, the distorted edges of a square wave on a microcontroller pin. To see them you need an instrument that draws how the voltage changes over time: the oscilloscope. A real oscilloscope is expensive and dangerous if connected wrongly (especially on mains). The virtual oscilloscope in Proteus is free and risk-free; a perfect place to learn how to read one.

Theory: period, frequency, peak and RMS

The time of one full cycle of a repeating signal is the period (T). The number of cycles per second is the frequency (f). For a sine wave, the peak value (Vp), the peak-to-peak value (Vpp) and the RMS value (Vrms) have fixed relationships:

f = 1 / T          T = 1 / f
Vpp  = 2 x Vp
Vrms = Vp / 1.414   (sine only)

Mains: Vrms = 230 V, f = 50 Hz
Vp = 230 x 1.414 = 325 V
T  = 1 / 50 = 0.020 s = 20 ms

The "230 V" at the socket is an RMS value; the voltage actually swings between +325 V and -325 V every cycle. That is why we use the peak value when choosing the voltage rating of capacitors and diodes.

Generating signals in Proteus

There are two ways to generate signals in Proteus. The first is Generator Mode on the left toolbar: it lists generators such as DC, SINE and PULSE (square wave). You connect one to a wire and enter amplitude, frequency and so on in its properties. The second is the SIGNAL GENERATOR in virtual instruments mode: a generator with knobs, whose frequency and amplitude you can turn during the simulation. For beginners Generator Mode is clearer, because the values stay written down.

  1. Switch to Generator Mode on the left toolbar and choose SINE. Drop it in the editing area and connect a short wire to its terminal.
  2. Double-click the generator. Set the amplitude to 2 V and the frequency to 1000 Hz. Leave the offset (DC shift) at 0.
  3. Place an OSCILLOSCOPE from virtual instruments mode. Connect the generator output to channel A. The generator and the oscilloscope must share ground as reference; put a GROUND in the drawing.
  4. Start the simulation. The oscilloscope window opens. If you close it, you can reopen it from the debug menu while the simulation is running (the name depends on the version).
  5. Set channel A to 1 V per division and the horizontal time base to 0.5 ms per division.
Expected on screen:
Peak: 2 divisions above centre, 2 below  -> Vp = 2 V, Vpp = 4 V
One period: 2 divisions x 0.5 ms = 1 ms  -> f = 1 kHz

Square wave: the PULSE generator

Microcontrollers, clock signals and PWM all run on square waves. Choose PULSE in Generator Mode and enter in its properties: low level 0 V, high level 5 V, period 1 ms (or frequency 1 kHz), pulse width 0.5 ms. Keep the rise and fall times very small. Connect it to channel B of the oscilloscope and view both signals together.

The ratio pulse width / period is called the duty cycle. 0.5 ms / 1 ms = 50%. This idea will be the main character of the PWM lesson; keep it in mind.

If the signal keeps sliding across the oscilloscope screen, check the trigger setting. Setting the trigger source to the channel carrying the signal makes the picture stand still.

Field example: transformer and half-wave rectifier

The secondary of a control transformer gives a 12 V RMS sine. Let's rectify it with a diode:

  1. Set the SINE generator to an amplitude of 17 V (12 x 1.414 = 16.97) and a frequency of 50 Hz.
  2. Add a 1N4007 diode and a 1 kOhm RES from Pick Devices. Wire generator → diode (anode) → diode (cathode) → resistor → ground.
  3. Connect channel A to the generator and channel B to the top of the resistor. Set the time base to 5 ms per division.
Channel A: full sine between +17 V and -17 V, period 20 ms
Channel B: positive half-cycles only, peak about 16.3 V
           (about 0.7 V drops across the diode), 0 V on the negative half

What you see is the first stage of every DC power supply. The next stage is smoothing this pulsating voltage with a capacitor; we will get there in the RC lesson.

Common mistakes

Confusing amplitude with RMS: in the Proteus SINE generator, amplitude is the peak value. For 12 V RMS you must enter 17 V, not 12.

Choosing an unsuitable time base: look at a 50 Hz signal at 1 µs per division and you will see a flat line. Calculate the period first and pick a setting that fits 2-3 periods on screen.

Counting divisions wrongly: count the peak from the centre line and the peak-to-peak from the bottom peak to the top peak.

Exercise

A friend describes an oscilloscope screen to you: 5 ms per division, one full period spans 4 divisions; 5 V per division, the top of the sine is 3.4 divisions above centre. Find the frequency, the peak value and the RMS value. Then generate this signal in Proteus and check the screen.

Hint: find T first, then f. For RMS, divide the peak by 1.414.

Solution

T    = 4 x 5 ms = 20 ms
f    = 1 / 0.020 = 50 Hz
Vp   = 3.4 x 5 = 17 V
Vrms = 17 / 1.414 = 12.0 V
Result: 12 V RMS, 50 Hz -> control transformer secondary

In Proteus set the SINE generator to 17 V amplitude and 50 Hz; set the oscilloscope to 5 V and 5 ms per division. You will see exactly the screen that was described.

In short: the oscilloscope shows how voltage changes over time; you read period, frequency and peak values from the divisions. In the next lesson you will use a transistor as a switch to drive an LED and a relay.

// Spot the bug +10 XP

Exactly one line below is wrong. Click the faulty line.

// Mini quiz

Click an option; you will see right away, with the reason, whether it is correct or not.

1. On the oscilloscope one period spans 5 divisions at 0.2 ms per division. What is the frequency?
2. What amplitude should you enter in the Proteus SINE generator for a sine with 12 V RMS?
3. What is the duty cycle of a square wave with a 1 ms period and a 0.25 ms pulse width?

Mark it when you finish: your progress is saved and you earn +20 XP.

Tip: ← → keys let you move between lessons.