GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Emirsw/bc237-astable-multivibrator: A discrete BC237 astable multivibrator with Arduino-based waveform sampling and a custom Python signal analyzer.

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
firmware/arduino/astable_reader
firmware/arduino/astable_reader
 
 
hardware/kicad
hardware/kicad
 
 
images
images
 
 
software/analyzer
software/analyzer
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Discrete Transistor Astable Multivibrator

An electronics experiment by Mustafa Emir Çebi exploring a free-running oscillator built from two BC237 NPN transistors and passive components. A breadboard implementation provides the physical oscillator; an Arduino Uno samples its collector voltages, and a Python desktop analyzer displays and estimates properties of the sampled signals.

The discrete transistor/RC circuit generates the oscillation. The Arduino supplies 5 V and acquires measurements. The firmware does not drive the transistor bases or generate a clock.

Overview

Discrete BC237 oscillator
        |
        | Q1 and Q2 collector voltages
        v
Arduino Uno ADC (A0 / A1)
        |
        | USB serial, 115200 baud
        v
Python analyzer: voltage plots and switching estimates

The engineering focus is transistor switching, positive feedback, RC cross-coupling, and the relationship between physical circuit behavior and sampled waveforms.

Circuit

The documented circuit uses a common ground and a nominal 5 V supply. Each transistor emitter is connected directly to ground.

References Schematic values Function
Q1, Q2 BC237 NPN Alternating switching elements
R1, R2 220 Ω LED collector-load current limiting
D1, D2 Red LED, blue LED Indicate transistor conduction
RV1, RV2 100 kΩ potentiometers Adjustable base-bias resistance
C1, C2 10 µF electrolytic Cross-couple each collector to the opposite base
R3, R4 4.7 kΩ Fixed minimum base resistance in the documented schematic

Each collector branch is +5V → 220Ω → LED anode → LED cathode → collector. A conducting transistor pulls its collector low and turns its LED on.

The potentiometers are rheostats: the wiper (terminal 2) is tied to outer terminal 3, on the supply side. Terminal 1 connects through a fixed base resistor to the base. A lost wiper contact leaves the full resistance track in the bias path.

Schematic versus breadboard: R3 and R4 were added when preparing the schematic to prevent an approximately zero-ohm potentiometer setting from connecting a base directly to 5 V. Their installation on the existing breadboard has not been independently confirmed. Verify the assembled circuit against the schematic before comparing results. No actual potentiometer settings, component tolerances, or transistor gains have been measured for this repository.

Capacitor connections are:

  • C1 positive terminal: Q1 collector; negative terminal: Q2 base.
  • C2 positive terminal: Q2 collector; negative terminal: Q1 base.

These are the conventional electrolytic orientations for this topology. Base voltages change dynamically, so capacitor polarity should also be checked against actual operating voltages if the circuit is modified.

The KiCad BC237 symbol uses 1 = collector, 2 = base, 3 = emitter. The builder reports an observed physical arrangement of E–B–C from left to right, viewed from the flat/labeled face with leads downward, identified using diode-mode and hFE tests. Check the actual manufacturer's datasheet before selecting a footprint; symbol numbering does not establish the lead orientation of every physical part. No footprints or PCB layout are assigned.

How It Works

  1. Small differences in transistor characteristics or initial capacitor charge cause one transistor to conduct slightly more at startup.
  2. Its falling collector voltage couples through a capacitor to the opposite base, reducing that transistor's conduction. The opposite collector rises and reinforces the initial imbalance through the other capacitor: positive feedback.
  3. One transistor conducts while the other is off. The conducting transistor's LED is illuminated.
  4. The off transistor's base voltage evolves as its cross-coupled capacitor charges through the base-bias resistance.
  5. When that transistor begins to conduct, feedback rapidly reverses the transistor states.
  6. The process repeats with the roles exchanged.

The circuit combines slow RC voltage evolution with fast regenerative switching. Neither switching state is permanently stable, which makes it astable.

The analyzer observes collector voltages. It does not directly measure capacitor or base voltages, and it does not simulate the RC network. Collector waveforms show the consequences of charging and switching; separate base-voltage measurements would be needed to observe the full RC evolution directly.

Clock Generation

A collector waveform can be interpreted as a low-frequency clock signal. Its levels, edge shape, and ability to drive another circuit depend on the LED loads, transistor bias, and added loading. It is not assumed to be compatible with arbitrary modern logic inputs without buffering or level conditioning.

This experiment provides a starting point for studying bistable circuits, latches, flip-flops, counters, and discrete-transistor logic.

Measurement Setup

Circuit connection Arduino Uno connection
Q1 collector A0
Q2 collector A1
Circuit +5V 5V
Common circuit ground GND

Connect the Uno to the computer over USB. Use its 5 V supply for this setup, and check wiring before powering it. Collector measurements must stay within the ADC input range. A0 and A1 are read sequentially, not simultaneously.

The firmware sends one newline-terminated record per pair of samples:

timestamp_us,q1_raw,q2_raw

This notation describes the fields; the firmware sends numeric records without a header. The timestamp comes from micros() immediately before the ADC reads. Each loop finishes with delay(30), so the interval is approximately 30 ms plus acquisition and serial overhead, rather than an exact 33.3 Hz sampling clock.

Arduino Firmware

The existing measurement firmware is stored in firmware/arduino/astable_reader/astable_reader.ino. Its A0/A1 assignments, serial format, baud rate, and 30 ms delay are preserved. Comments describe the measurement role.

To upload:

  1. Open firmware/arduino/astable_reader/astable_reader.ino in Arduino IDE.
  2. Install/select Arduino AVR Boards → Arduino Uno and select the connected board's port.
  3. Verify, then upload the sketch.
  4. Close Arduino Serial Monitor and Serial Plotter before connecting the Python analyzer; it needs exclusive access to the port.

The additional astable_reader/ directory is intentional: Arduino requires the primary .ino file to match the sketch folder name. See the Arduino sketch specification.

With Arduino CLI and the Uno core installed, compile from the repository root:

arduino-cli compile --fqbn arduino:avr:uno firmware/arduino/astable_reader

Python Analyzer

The desktop analyzer implements:

  • Two collector-voltage curves: Q1 in blue and Q2 in orange.
  • Serial-port selection, refresh, connect/disconnect, and pause/resume controls.
  • Conversion from raw ADC values to voltage using a configurable nominal 5.0 V reference.
  • Current voltage, minimum, and maximum for each channel.
  • An adaptive midpoint threshold and software hysteresis for switching detection.
  • Frequency from the median rising-edge interval, period, and estimated collector-high duty cycle.
  • A three-second display/analysis window and a bounded sample buffer.

Duty cycle refers to collector-high time, which corresponds approximately to that transistor being off and its LED being off. It is not the LED-on duty cycle. Estimates need at least 20 visible samples and two detected rising edges. Small signal spans below 0.15 V do not produce switching estimates. A slowly oscillating circuit may need a larger DISPLAY_SECONDS setting before enough edges fit in the analysis window.

Pause freezes the plot and measurement updates; serial acquisition continues. No measurement-file export or calibration interface is implemented.

Installation

Use Python 3.10 or newer and run these commands from the repository root:

python -m venv .venv

Windows Command Prompt:

.venv\Scripts\activate.bat

Windows PowerShell:

.\.venv\Scripts\Activate.ps1

Linux/macOS:

source .venv/bin/activate

Install and run:

python -m pip install -r software/analyzer/requirements.txt
python software/analyzer/astable_analyzer.py

Select the Uno's serial port and click Connect. Opening the port can reset the Uno; the application waits briefly before reading. Reconnect if the board is reset during acquisition.

The dependency list contains only the packages imported by the program: PySide6, pyqtgraph, pyserial, and NumPy. The application retains its original plotting and analysis structure. Repository preparation adds complete-line buffering, malformed-record rejection, incremental timestamp rollover handling, and cleanup on serial errors and window close.

KiCad Schematic

Open hardware/kicad/bc237_astable_multivibrator.kicad_pro in KiCad. The project and schematic are preserved from the existing project, including the author credit. Matching net labels implement the capacitor cross-coupling.

BC237 astable multivibrator schematic

The repository contains a schematic only. KiCad ERC and exported-netlist validation are software checks; they do not establish that the breadboard matches the schematic. Results and tool versions are documented in docs/validation/README.md.

Experimental Results

The builder reports that the oscillator has been assembled on a breadboard. No breadboard photographs, analyzer screenshots, or recorded measurement datasets were found in the supplied project locations. Consequently, this repository does not report measured frequency, duty cycle, component settings, or accuracy.

docs/measurements/README.md describes what to record in a future measurement session. Software tests use explicitly synthetic inputs, not experimental results.

Gallery

The schematic above is the available project image. Photograph and real measurement screenshot slots are prepared below; their links remain commented out until the files exist.

What I Learned

The experiment connects several concrete engineering concepts:

  • BJT conduction pulls a collector low; the associated LED indicates conduction rather than a collector-high state.
  • Cross-coupling converts a small imbalance into regenerative switching through positive feedback.
  • Base-bias resistance and capacitance influence dwell time, while the switching transition occurs on a different timescale.
  • Sampling interval, ADC reference, and threshold selection influence the displayed waveform and derived timing estimates.
  • A visualization can help interpret physical behavior, but it cannot restore transitions missed by the ADC or establish unmeasured capacitor voltages.

Limitations

  • The Uno's ADC provides 10-bit readings, and the firmware's approximately 30 ms sampling interval limits useful bandwidth. The interval is intended for this low-frequency experiment. The Uno R3 datasheet documents its analog inputs.
  • This measurement setup is not a replacement for an oscilloscope or a characterized laboratory instrument. Fast transitions and narrow pulses can occur between samples; interpolation does not recover them.
  • The software assumes ADC_REFERENCE = 5.0 V unless manually adjusted after measuring/calibrating the reference. USB supply variation affects reported voltages.
  • Channel reads are sequential and share a timestamp taken before both conversions. They should not be treated as simultaneous acquisition.
  • Breadboard wiring, transistor variation, capacitor tolerance/leakage, potentiometer settings, LED forward voltages, and measurement loading affect behavior. The LED loads also make unloaded textbook collector-level assumptions less reliable.
  • Adaptive thresholds and a short analysis window can give incomplete or unstable estimates when few cycles are visible. Collector-high duty cycle is not transistor-on duty cycle.
  • A board reset during acquisition requires reconnecting the analyzer to establish a new timestamp origin.
  • Physical installation of the schematic's added fixed base resistors remains to be confirmed.

Future Work

  • Compare measured timing with an RC estimate after recording the actual resistor settings and operating voltages.
  • Build a bistable multivibrator as a one-bit memory experiment.
  • Explore transistor logic gates and a conditioned clock output.
  • Progress to flip-flops and a small binary counter.

Repository Layout

.
├── README.md
├── LICENSE
├── .gitignore
├── firmware/arduino/astable_reader/astable_reader.ino
├── software/analyzer/
│   ├── astable_analyzer.py
│   ├── requirements.txt
│   └── tests/test_analyzer.py
├── hardware/kicad/
│   ├── bc237_astable_multivibrator.kicad_pro
│   └── bc237_astable_multivibrator.kicad_sch
├── images/
│   ├── README.md
│   ├── kicad-schematic.png
│   └── kicad-schematic.svg
└── docs/
    ├── measurements/README.md
    └── validation/
        ├── README.md
        ├── erc-report.txt
        └── source-inventory.json

License

MIT License. See LICENSE.

About

A discrete BC237 astable multivibrator with Arduino-based waveform sampling and a custom Python signal analyzer.

Topics

arduinoastable-multivibratorbjtdigital-electronicselectronicsembedded-systemskicadoscillatorpythontransistors

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.