Beginner - Designing an IC to receive current and lighting LEDs

Thread Starter

dltd_za

Joined Sep 17, 2025
3
Hi all.
I am very new with this (Usually using standard breadboard MCUs).
There was a question in my mind if I can build my own boards for a project at home.
Essentially I want to power a board with the electrical charge received from a Piezoelectric Sensor, and light up a few LEDs.
Basically this IC is designed to take the current from the Piezo and light up LEDS based on a 3p switch (Off/1 sec/3 sec) which will determine the state of the LEDs.
I did my research, and used GPT (Excuse my ignorance. LOL) but would always appreciate other people's opinions in this. Am I missing anything or is this over engineered?
I am a software guy, but I would really love to bridge the gap to this, and just trying to get a feel for IC designs and builds.

Items required:
Ref DesQuantityDescriptionKey Specs / NotesEstimated P/N Example
PIEZO11Piezoelectric Disc27mm-35mm diameter, brass plates, pre-wiredMurata 7BB-35-3
BR11Miniature Bridge Rectifier100V, >100mADiodes Inc. DB102S
C11Electrolytic/Tantalum Capacitor220µF, 16V, Low-ESRPanasonic ECE-A1EN221
U11Voltage Reference/ComparatorOpen-drain output, low powerTI TLV3011
U21LED Flasher IC or MicrocontrollerProgrammed for 1/3/5 flash modesMicrochip ATTiny10-TSHR
Q11N-Channel MOSFETSOT-23 package, logic levelON Semi 2N7002
LED15High-Brightness Green LED5mm, 1000+ mcd, 30° viewing angleLite-On L-7113GT
SW11Miniature Slide Switch3-position, through-holeC&K JS202011AQN
R1, R22Resistors0805 or TH, values per circuit10kΩ, 100kΩ
D11Zener Diode5.1V, 500mW

Connections:
Step-by-Step Schematic Connections
We will build the schematic in a logical order. Search for these parts in the EasyEDA library and place them on your canvas.

Stage 1: Power Generation & Storage
Components:
Piezo, Rectifier (DB102S), Storage Capacitor (C1), Zener Diode (D1)
  1. Piezoelectric Disc:
    • Place a Header-Male 1x02 (2-pin header). This represents where you will solder the wires from the piezo disc.
    • Label the first pin PIEZO_IN.
    • Label the second pin TARGET_GND. This pin will connect to the mounting magnets and the steel target.
  2. Bridge Rectifier (DB102S):
    • The rectifier has 4 pins: two ~ (AC input), one +, one -.
    • Connect the PIEZO_IN wire from the header to one of the ~ AC input pins.
    • Connect the TARGET_GND wire to the other ~ AC input pin.
    • The rectifier's - pin is now your circuit's main GND.
    • The rectifier's + pin is the raw, rectified power. Connect this to:
  3. Storage Capacitor (C1 - 100µF-470µF Electrolytic):
    • Connect the POSITIVE (+) leg of C1 to the rectifier's + pin.
    • Connect the NEGATIVE (-) leg of C1 to the rectifier's - pin (GND).
    • This capacitor is your main energy reservoir.
  4. Voltage Clamp/Regulator (Zener Diode D1 - 5.1V):
    • Connect the Cathode (end with the band) to the + side of capacitor C1 (VCC).
    • Connect the Anode to GND.
    • This prevents the capacitor from charging above 5.1V and destroying the ATTiny10.
You now have a power rail called VCC (from C1+) and a ground rail (GND).

Stage 2: The Control Logic (Voltage Trigger)
Components:
Voltage Comparator (TLV3011), Resistors (R1, R2)
  1. Voltage Comparator (U1 - TLV3011):
    • This chip has 3 pins: V+, V-, OUT.
    • V+ Pin (Power): Connect to VCC.
    • V- Pin (Ground): Connect to GND.
    • OUT Pin (Signal): This is our trigger signal. Connect it to:
      • A 10kΩ Pull-up Resistor (R1): Connect between OUT and VCC.
      • The INPUT of the MCU: Connect to Pin 2 (ADC1) of the ATTiny10.
  2. Voltage Reference (Resistors R2, R3):
    • We need to set a threshold voltage for the comparator to trigger at (e.g., ~4.0V). We create this with a "resistor divider".
    • Connect a 100kΩ Resistor (R2) from VCC to the comparator's IN+ pin.
    • Connect a 33kΩ Resistor (R3) from the comparator's IN+ pin to GND.
    • *(This creates about 4.1V at IN+, calculated as VCC * (R3/(R2+R3)) = 5V * (33k/133k) ≈ 4.1V)*.
    • Connect the comparator's IN- pin directly to VCC. The comparator will output a LOW signal when VCC (IN-) falls below ~4.1V (IN+), which is perfect for detecting when a hit has charged the capacitor.

Stage 3: The Microcontroller & Programming
Components:
ATTiny10 (U2), 4-Pin Header (J1)
  1. ATTiny10 (U2):
    • Pin 5 (VCC): Connect to VCC.
    • Pin 3 (GND): Connect to GND.
    • Pin 2 (ADC1): Connect to the OUTPUT of the Voltage Comparator (U1). This is the trigger signal.
    • Pin 1 (~RESET/~ADC0): This will be our mode select input. Connect it to one side of the Mode Switch (SW1).
    • Pin 4 (OC0A): This is our output. Connect it to a 100Ω - 500Ω current-limiting resistor (R4), and then connect the other side of that resistor to the Gate of the MOSFET (Q1).
  2. Programming Header (J1 - Header-Male 1x04):
    • This is only used to program the chip before soldering it to the board.
    • Connect Pin 1 of the header to VCC.
    • Connect Pin 2 of the header to the Gate of the MOSFET (Q1). This is the data line.
    • Connect Pin 3 of the header to Pin 2 (ADC1) of the ATTiny. This is the clock line.
    • Connect Pin 4 of the header to GND.
    • Note: The exact programming pinout depends on your programmer. This is a common setup.

Stage 4: Output & User Interface
Components:
MOSFET (Q1 - 2N7002), LED (LED1), Mode Switch (SW1)
  1. MOSFET (Q1 - 2N7002):
    • Gate (G): Connect to the other side of current-limiting resistor R4 (from MCU Pin 4).
    • Drain (D): Connect to the CATHODE (negative, short leg) of the LED.
    • Source (S): Connect to GND.
  2. LED (LED1):
    • CATHODE: Connected to MOSFET Drain (D).
    • ANODE (positive, long leg): Connect to VCC through a small resistor (R5 - e.g., 10Ω). (Since our driver is on the ground side, this resistor protects the LED from inrush current).
  3. Mode Switch (SW1 - 3-Position Switch):
    • The goal is to connect Pin 1 of the MCU to different voltages to represent different modes.
    • Connect one outer pin of the switch to GND (Mode 1: 1 Flash).
    • Connect the center pin (the wiper) to MCU Pin 1 (~RESET/~ADC0).
    • Connect the other outer pin to VCC (Mode 3: 5 Flashes).
 

Attachments

Thread Starter

dltd_za

Joined Sep 17, 2025
3
Thank you very much for all the feedback. That's where I had my doubts with the whole concept. If I add multiple piezos and run them parallel, and change led from a constant on to, something like 10ms bursts, that might resolve the power issue? Or am I reaching a bit?
@Sensacell just a little bit of sadness!! LOL
 

dl324

Joined Mar 30, 2015
18,220
I am a software guy, but I would really love to bridge the gap to this, and just trying to get a feel for IC designs and builds.
No newbie is going to be designing any IC's. You must mean designing a circuit, not an actual integrated circuit.
 

drjohsmith

Joined Dec 13, 2021
1,549
Great to see your on the hardware journey,
compared to the simply software your into some fun,

id look at this sort of problem in parts.

certainly, one big difference with hw as opposed to sw, is the use of test equipment,
what do you have access to ?

you have some input, some output,

seems the pizo is the first question,
look some more into those,
how much sound at what frequency do you have coming in , and look at what voltage / current you get out.

then look at the outputs, the leds, what sort of volts / current do you need,

lots of reading of data sheets and some simple experiments are called for.
 
Top