Skip to the content
2 layers74.2 × 59.5 mmTransistor Based Bi Stable Clap Switch, the printed circuit board in 3D

Transistor Based Bi Stable Clap Switch

Hirusha785/BiStable-Clap-Switch-Transistor-PCB

A transistor-based bi-stable clap switch PCB designed in KiCad. It detects clap sounds through a microphone amplifier stage and toggles a relay output to control a load.

Size
74.2 × 59.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
35
Nets
23
Pads
75
Tracks, vias
185, 2
Pours
4
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
4 Jul 2026
Updated
4 Jul 2026

Overview

Transistor Based Bi Stable Clap Switch is an open-source printed circuit board by Hirusha785, from the Hirusha785/BiStable-Clap-Switch-Transistor-PCB repository on GitHub, published under the MIT licence. It is a 2-layer board of 74.2 × 59.5 mm with 35 parts on 23 nets, routed with 185 tracks and 2 vias.

It is built around the BC547. Its parts include 13 resistors, 6 transistors, 4 capacitors, 4 diodes and 1 connector. It belongs with the audio and music boards of this library.

Main components

1

README

README.md

👏 Bi-Stable Clap Switch Circuit Using Transistors

KiCad PCB Electronics License: MIT


📖 Project Overview

This project is a Bi-Stable Clap Switch Circuit Using Transistors.
It uses a microphone to detect clap sounds, amplifies the signal using BC547 transistor stages, and sends the amplified pulse to a transistor-based bistable latch. The bistable circuit toggles its output state on every clap.

The output stage drives a relay, allowing the circuit to switch an external load.

text
First clap  → Relay ON  → Load ON
Second clap → Relay OFF → Load OFF
Third clap  → Relay ON  → Load ON again

This project was designed as a mini electronics project using KiCad for schematic design, PCB layout, and 3D visualization.


✨ Features

  • Clap-controlled ON/OFF switching
  • Fully transistor-based circuit
  • No microcontroller required
  • Microphone sound detection
  • Two-stage transistor amplification
  • Bi-stable latch using transistors
  • Relay output control
  • LED indication
  • Flyback diode protection
  • Custom PCB designed in KiCad
  • 2-layer PCB layout
  • AC and DC section separation
  • Isolation slot between high-voltage and low-voltage areas
  • MIT licensed open-source project

🧠 Working Principle

The circuit is divided into four main sections:

  1. Microphone and amplifier stage
  2. Pulse shaping / signal conditioning stage
  3. Bi-stable switching stage
  4. Relay driver and load control stage

1. 🎤 Microphone and Amplifier Stage

The microphone detects the clap sound and converts it into a small electrical signal.

The microphone signal is very weak, so it is passed through a coupling capacitor to the base of transistor Q1.
Transistor Q1 amplifies this small signal.

The amplified signal is then passed to transistor Q2 for further amplification.

text
Clap sound
    ↓
Microphone
    ↓
Q1 amplifier stage
    ↓
Q2 amplifier stage

The resistor and capacitor network around the microphone and amplifier stages helps the circuit respond better to sharp sounds such as claps.


2. 🔁 Pulse Conditioning Stage

After amplification, the clap signal becomes a stronger pulse.

This pulse is passed to the bistable switching section.
The diode and capacitor network helps shape the signal and provides a cleaner trigger pulse for the bistable latch.

The LED gives visual feedback when the circuit responds to the clap signal.


3. ⚡ Bi-Stable Switching Stage

The bistable stage is built using transistors Q4 and Q5.

These transistors are cross-coupled so that when one transistor is ON, the other transistor is OFF.

text
State 1:
Q4 ON
Q5 OFF
Relay OFF

State 2:
Q4 OFF
Q5 ON
Relay ON

Each valid clap pulse changes the latch from one state to the other.

Because the circuit has two stable states, it is called a bi-stable switch.


4. 🔌 Relay Driver and Output Control Stage

The output from the bistable stage controls transistor Q6.

When Q6 receives base current, it turns ON and allows current to flow through the relay coil.

When the relay coil is energized, the relay contact switches the connected load.

text
Bistable output
    ↓
Q6 relay driver
    ↓
Relay coil
    ↓
Load switching

The relay allows the low-voltage transistor circuit to control a separate external load.


5. 🛡️ Flyback Diode Protection

The relay coil is an inductive load.
When the relay switches OFF, the coil can generate a reverse voltage spike.

Diode D4 is connected across the relay coil as a flyback diode.

The purpose of D4 is to protect transistor Q6 from high-voltage spikes generated by the relay coil.

text
Relay OFF
    ↓
Reverse voltage spike generated
    ↓
D4 absorbs the spike
    ↓
Q6 protected

🧩 Main Components

ReferenceComponentPurpose
MIC1Electret MicrophoneDetects clap sound
Q1BC547First amplifier stage
Q2BC547Second amplifier stage
Q3BC547Signal / LED driver stage
Q4BC547Bistable latch transistor 1
Q5BC547Bistable latch transistor 2
Q6BC547Relay driver transistor
K1RelaySwitches external load
D11N4148Signal steering / trigger shaping
D2LEDStatus indication
D31N4148Signal steering / trigger shaping
D41N4148Relay flyback protection
C10.1 µFSignal coupling / filtering
C21 µFSignal coupling
C30.1 µFPulse shaping
C40.1 µFPulse shaping
R1 - R13ResistorsBiasing, feedback, current limiting
J1Screw TerminalExternal load / AC connection
BT1DC Supply / BatteryPowers the low-voltage circuit

🔋 Power Supply

The control circuit is powered using a low-voltage DC supply.

text
Recommended supply: 5 V DC to 9 V DC

The relay coil voltage must match the selected supply voltage.

For example:

text
5 V relay  → use 5 V supply
9 V relay  → use 9 V supply
12 V relay → use 12 V supply with proper circuit adjustment

🔗 Connection Overview

Low-Voltage DC Side

text
DC Positive → VCC rail
DC Negative → GND rail

Microphone output → Q1 base through coupling capacitor
Q1 output → Q2 amplifier stage
Q2 output → Bistable trigger network
Bistable output → Q6 base
Q6 collector → Relay coil
Relay coil other side → VCC
D4 → Across relay coil

Relay / Load Side

For AC load switching, the recommended connection is:

text
AC Live IN → Fuse → Relay COM
Relay NO → Load Live
AC Neutral IN → Load Neutral

The relay should switch the Live line, not only the Neutral line.


📷 Preview

Schematic

image

Schematic

PCB Layout

image

PCB Layout

3D View

image image image image image

PCB 3D View


📏 Suggested PCB Track Widths

Track TypeRecommended Width
Small signal tracks0.25 mm - 0.30 mm
DC power tracks0.60 mm
Relay coil tracks0.80 mm - 1.00 mm
AC load tracks2.50 mm minimum
AC tracks with 5 A fuse3.50 mm - 5.00 mm

For a mini-project demonstration, use a low-current load and a smaller fuse.

text
Recommended demo fuse: 500 mA - 1 A
Recommended AC track width: 2.5 mm minimum

🛡️ PCB Safety Design Notes

Since this PCB can switch AC loads, safety is very important.

The board separates the circuit into two main sections:

text
High-voltage section:
Relay contact, fuse, AC terminal, load connection

Low-voltage section:
Microphone, transistors, resistors, capacitors, DC supply

Safety improvements included in the PCB design:

  • AC and DC sections are separated
  • Isolation slot added between AC and DC areas
  • No GND copper pour under the AC section
  • Wider tracks used for AC load routing
  • Relay used for electrical separation
  • Fuse added on the AC input side
  • Screw terminal used for load connection

⚠️ High Voltage Warning

This project may involve 230 V AC, which is dangerous.

Incorrect handling can cause:

  • Electric shock
  • Fire
  • Component damage
  • PCB damage
  • Serious injury
  • Death

Follow these safety rules:

  • Do not touch the PCB while powered
  • Do not test AC mains without supervision
  • Use a proper fuse on the Live line
  • Keep AC and DC wiring separated
  • Use insulated screw terminals
  • Use an enclosure before real-world use
  • Use plastic standoffs for mounting
  • Keep enough clearance between AC and DC copper
  • Test first using a low-voltage DC load
  • Do not use this as a permanent mains installation without professional validation

For demonstration, it is safer to use:

text
Relay contact → 12 V DC bulb

instead of directly switching 230 V AC.


🧪 Testing Procedure

Step 1: Visual Inspection

Before powering the circuit, check:

  • Component values
  • Diode direction
  • LED polarity
  • Electrolytic capacitor polarity
  • Transistor pin orientation
  • Relay coil pins
  • Solder bridges
  • PCB track shorts
  • AC/DC isolation gap
  • Screw terminal connections

Step 2: Low-Voltage Power Test

Power only the DC control side first.

text
Apply 5 V or 9 V DC
Check current consumption
Check LED response
Check relay operation

Do not connect 230 V AC during the first test.


Step 3: Clap Detection Test

Clap near the microphone and observe the output.

Expected operation:

text
First clap  → Relay ON
Second clap → Relay OFF
Third clap  → Relay ON again

Step 4: Relay Load Test

Start with a safe low-voltage load.

text
Relay contact → 12 V DC bulb / LED load

After successful low-voltage testing and proper safety verification, AC load testing may be considered.


🧰 Tools Used

  • KiCad Schematic Editor
  • KiCad PCB Editor
  • KiCad 3D Viewer
  • Through-hole electronic components
  • Custom PCB design workflow

📹 Demo / Reference Video

Project Demo YouTube Video

https://github.com/user-attachments/assets/e8813ca4-ab43-4996-b2c6-18d73fab9b31

▶️ Watch YouTube Reference Video


📚 Reference Links


👨‍💻 Author

Designed by:

text
FERNANDO S.M.H.G.

📜 License

This project is licensed under the MIT License.


⭐ Support

If you found this project useful, consider starring the repository.

text
Clap once to turn ON.
Clap again to turn OFF.
Simple idea, clean PCB, solid mini project.

Parts

35
QtyValueFootprintReferences
6BC547Package_TO_SOT_THT:TO-92_InlineQ1, Q2, Q3, Q4, Q5, Q6
51kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR4, R6, R8, R11, R12
410kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R3, R9, R10
30.1 uFCapacitor_THT:C_Radial_D8.0mm_H11.5mm_P3.50mmC1, C3, C4
31MResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2, R7, R13
31N4148Diode_THT:D_DO-35_SOD27_P7.62mm_HorizontalD1, D3, D4
11 uFCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC2
1220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR5
1230V ACTerminalBlock:TerminalBlock_bornier-2_P5.08mmJ1
1230V BulbLED_THT:LED_VCCLite_5381H7_6.35x6.35mmLA1
15V DCBattery:BatteryHolder_Seiko_MS621FBT1
1Fuse_SmallFuse:Fuse_BelFuse_0ZRE0005FF_L8.3mm_W3.8mmF1
1G5Q-1Relay_THT:Relay_SPDT_StandexMeder_SIL_Form1CK1
1LEDLED_THT:LED_D3.0mmD2
1MicrophoneSensor_Audio:POM-2244P-C3310-2-RMK1

The 33 most common of 35 parts.

Similar boards

  • 2 layers83.3 × 65.3 mmSimonShield, the printed circuit board in 3D

    SimonShield

    github-linguist/linguist

    Language Savant. If your repository's language is being reported incorrectly, send us a pull request!

    46 parts14kMIT
  • 2 layers56 × 65 mmSeaTalk1, the printed circuit board in 3D

    SeaTalk1

    dotnet/iot

    This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.

    24 parts2.4kMIT
  • 2 layers132.1 × 45.7 mmIPoS, the printed circuit board in 3D

    IPoS

    peterheinrich/InternetOverSpaghetti

    Transmitting IP packages over a pair of spaghetti thus demonstrating how media independent IP really is.

    42 parts342
  • 2 layers99.1 × 99.7 mmRC6502 General Video Adapter, the printed circuit board in 3D

    RC6502 General Video Adapter

    tebl/RC6502-Apple-1-Replica

    An expandable SBC-version of the Apple 1 computer, easy to get started with and lot of cool stuff that can be added to it!

    80 parts193GPL-3.0
  • 2 layers55.9 × 38.6 mmMega Amp, the printed circuit board in 3D

    Mega Amp

    theacodes/genesynth

    A Sega Genesis inspired synthesizer

    40 parts178Apache-2.0
  • 2 layers40 × 100 mmBack pcb, the printed circuit board in 3D

    Back pcb

    ZeroPhone/ZeroPhone-PCBs

    PCB files for ZeroPhone - for gerbers and schematics, go to "Releases" tab!

    118 parts148GPL-3.0
  • 2 layers100 × 100 mmCANBuster, the printed circuit board in 3D

    CANBuster

    GBert/misc

    miscellaneous stuff / unsorted

    182 parts99

Questions

How big is the Transistor Based Bi Stable Clap Switch PCB?

It measures 74.2 × 59.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Transistor Based Bi Stable Clap Switch use?

35 parts, built around the BC547. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Transistor Based Bi Stable Clap Switch KiCad files?

From the Hirusha785/BiStable-Clap-Switch-Transistor-PCB repository on GitHub, at the commit this page was made from: the board is Transistor-Based Bi-Stable Clap Switch.kicad_pcb and its schematic Transistor-Based Bi-Stable Clap Switch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Transistor Based Bi Stable Clap Switch design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).