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

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.
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.
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.
First clap → Relay ON → Load ON
Second clap → Relay OFF → Load OFF
Third clap → Relay ON → Load ON againThis project was designed as a mini electronics project using KiCad for schematic design, PCB layout, and 3D visualization.
The circuit is divided into four main sections:
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.
Clap sound
↓
Microphone
↓
Q1 amplifier stage
↓
Q2 amplifier stageThe resistor and capacitor network around the microphone and amplifier stages helps the circuit respond better to sharp sounds such as claps.
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.
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.
State 1:
Q4 ON
Q5 OFF
Relay OFF
State 2:
Q4 OFF
Q5 ON
Relay ONEach 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.
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.
Bistable output
↓
Q6 relay driver
↓
Relay coil
↓
Load switchingThe relay allows the low-voltage transistor circuit to control a separate external load.
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.
Relay OFF
↓
Reverse voltage spike generated
↓
D4 absorbs the spike
↓
Q6 protected| Reference | Component | Purpose |
|---|---|---|
| MIC1 | Electret Microphone | Detects clap sound |
| Q1 | BC547 | First amplifier stage |
| Q2 | BC547 | Second amplifier stage |
| Q3 | BC547 | Signal / LED driver stage |
| Q4 | BC547 | Bistable latch transistor 1 |
| Q5 | BC547 | Bistable latch transistor 2 |
| Q6 | BC547 | Relay driver transistor |
| K1 | Relay | Switches external load |
| D1 | 1N4148 | Signal steering / trigger shaping |
| D2 | LED | Status indication |
| D3 | 1N4148 | Signal steering / trigger shaping |
| D4 | 1N4148 | Relay flyback protection |
| C1 | 0.1 µF | Signal coupling / filtering |
| C2 | 1 µF | Signal coupling |
| C3 | 0.1 µF | Pulse shaping |
| C4 | 0.1 µF | Pulse shaping |
| R1 - R13 | Resistors | Biasing, feedback, current limiting |
| J1 | Screw Terminal | External load / AC connection |
| BT1 | DC Supply / Battery | Powers the low-voltage circuit |
The control circuit is powered using a low-voltage DC supply.
Recommended supply: 5 V DC to 9 V DCThe relay coil voltage must match the selected supply voltage.
For example:
5 V relay → use 5 V supply
9 V relay → use 9 V supply
12 V relay → use 12 V supply with proper circuit adjustmentDC 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 coilFor AC load switching, the recommended connection is:
AC Live IN → Fuse → Relay COM
Relay NO → Load Live
AC Neutral IN → Load NeutralThe relay should switch the Live line, not only the Neutral line.



| Track Type | Recommended Width |
|---|---|
| Small signal tracks | 0.25 mm - 0.30 mm |
| DC power tracks | 0.60 mm |
| Relay coil tracks | 0.80 mm - 1.00 mm |
| AC load tracks | 2.50 mm minimum |
| AC tracks with 5 A fuse | 3.50 mm - 5.00 mm |
For a mini-project demonstration, use a low-current load and a smaller fuse.
Recommended demo fuse: 500 mA - 1 A
Recommended AC track width: 2.5 mm minimumSince this PCB can switch AC loads, safety is very important.
The board separates the circuit into two main sections:
High-voltage section:
Relay contact, fuse, AC terminal, load connection
Low-voltage section:
Microphone, transistors, resistors, capacitors, DC supplySafety improvements included in the PCB design:
This project may involve 230 V AC, which is dangerous.
Incorrect handling can cause:
Follow these safety rules:
For demonstration, it is safer to use:
Relay contact → 12 V DC bulbinstead of directly switching 230 V AC.
Before powering the circuit, check:
Power only the DC control side first.
Apply 5 V or 9 V DC
Check current consumption
Check LED response
Check relay operationDo not connect 230 V AC during the first test.
Clap near the microphone and observe the output.
Expected operation:
First clap → Relay ON
Second clap → Relay OFF
Third clap → Relay ON againStart with a safe low-voltage load.
Relay contact → 12 V DC bulb / LED loadAfter successful low-voltage testing and proper safety verification, AC load testing may be considered.
https://github.com/user-attachments/assets/e8813ca4-ab43-4996-b2c6-18d73fab9b31
▶️ Watch YouTube Reference Video
Designed by:
FERNANDO S.M.H.G.This project is licensed under the MIT License.
If you found this project useful, consider starring the repository.
Clap once to turn ON.
Clap again to turn OFF.
Simple idea, clean PCB, solid mini project.| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | BC547 | Package_TO_SOT_THT:TO-92_Inline | Q1, Q2, Q3, Q4, Q5, Q6 |
| 5 | 1k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R4, R6, R8, R11, R12 |
| 4 | 10k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1, R3, R9, R10 |
| 3 | 0.1 uF | Capacitor_THT:C_Radial_D8.0mm_H11.5mm_P3.50mm | C1, C3, C4 |
| 3 | 1M | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R2, R7, R13 |
| 3 | 1N4148 | Diode_THT:D_DO-35_SOD27_P7.62mm_Horizontal | D1, D3, D4 |
| 1 | 1 uF | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C2 |
| 1 | 220 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R5 |
| 1 | 230V AC | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J1 |
| 1 | 230V Bulb | LED_THT:LED_VCCLite_5381H7_6.35x6.35mm | LA1 |
| 1 | 5V DC | Battery:BatteryHolder_Seiko_MS621F | BT1 |
| 1 | Fuse_Small | Fuse:Fuse_BelFuse_0ZRE0005FF_L8.3mm_W3.8mm | F1 |
| 1 | G5Q-1 | Relay_THT:Relay_SPDT_StandexMeder_SIL_Form1C | K1 |
| 1 | LED | LED_THT:LED_D3.0mm | D2 |
| 1 | Microphone | Sensor_Audio:POM-2244P-C3310-2-R | MK1 |
The 33 most common of 35 parts.

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

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

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

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!



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

It measures 74.2 × 59.5 mm and has 2 copper layers, 1.6 mm thick.
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.
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.
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).