• Terminal
    Terminal
    An electrical connector acting as reusable interface to a conductor and creating a point where external circuits can be connected.
  • Ground
    A common return path for electric current. Commonly known as ground.
  • Net Portal
    A net identifier used to create connectivity to other Net Portal with the same designator. #portal
  • Power Net Portal
    Power net portal is a special schematic object used to define a power or ground net. Power ports allow you to conveniently indicate a power net at any location in the design. Power nets of the same designator automatically connect throughout your design #portal #power
  • Generic Resistor
    A generic fixed resistor for rapid developing circuit topology. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard resistor values: 1.0Ω 10Ω 100Ω 1.0kΩ 10kΩ 100kΩ 1.0MΩ 1.1Ω 11Ω 110Ω 1.1kΩ 11kΩ 110kΩ 1.1MΩ 1.2Ω 12Ω 120Ω 1.2kΩ 12kΩ 120kΩ 1.2MΩ 1.3Ω 13Ω 130Ω 1.3kΩ 13kΩ 130kΩ 1.3MΩ 1.5Ω 15Ω 150Ω 1.5kΩ 15kΩ 150kΩ 1.5MΩ 1.6Ω 16Ω 160Ω 1.6kΩ 16kΩ 160kΩ 1.6MΩ 1.8Ω 18Ω 180Ω 1.8KΩ 18kΩ 180kΩ 1.8MΩ 2.0Ω 20Ω 200Ω 2.0kΩ 20kΩ 200kΩ 2.0MΩ 2.2Ω 22Ω 220Ω 2.2kΩ 22kΩ 220kΩ 2.2MΩ 2.4Ω 24Ω 240Ω 2.4kΩ 24kΩ 240kΩ 2.4MΩ 2.7Ω 27Ω 270Ω 2.7kΩ 27kΩ 270kΩ 2.7MΩ 3.0Ω 30Ω 300Ω 3.0KΩ 30KΩ 300KΩ 3.0MΩ 3.3Ω 33Ω 330Ω 3.3kΩ 33kΩ 330kΩ 3.3MΩ 3.6Ω 36Ω 360Ω 3.6kΩ 36kΩ 360kΩ 3.6MΩ 3.9Ω 39Ω 390Ω 3.9kΩ 39kΩ 390kΩ 3.9MΩ 4.3Ω 43Ω 430Ω 4.3kΩ 43KΩ 430KΩ 4.3MΩ 4.7Ω 47Ω 470Ω 4.7kΩ 47kΩ 470kΩ 4.7MΩ 5.1Ω 51Ω 510Ω 5.1kΩ 51kΩ 510kΩ 5.1MΩ 5.6Ω 56Ω 560Ω 5.6kΩ 56kΩ 560kΩ 5.6MΩ 6.2Ω 62Ω 620Ω 6.2kΩ 62KΩ 620KΩ 6.2MΩ 6.8Ω 68Ω 680Ω 6.8kΩ 68kΩ 680kΩ 6.8MΩ 7.5Ω 75Ω 750Ω 7.5kΩ 75kΩ 750kΩ 7.5MΩ 8.2Ω 82Ω 820Ω 8.2kΩ 82kΩ 820kΩ 8.2MΩ 9.1Ω 91Ω 910Ω 9.1kΩ 91kΩ 910kΩ 9.1MΩ #generics #CommonPartsLibrary
  • Generic Capacitor
    A generic fixed capacitor for rapid developing circuit topology. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard capacitor values: 1.0pF 10pF 100pF 1000pF 0.01uF 0.1uF 1.0uF 10uF 100uF 1000uF 10,000uF 1.1pF 11pF 110pF 1100pF 1.2pF 12pF 120pF 1200pF 1.3pF 13pF 130pF 1300pF 1.5pF 15pF 150pF 1500pF 0.015uF 0.15uF 1.5uF 15uF 150uF 1500uF 1.6pF 16pF 160pF 1600pF 1.8pF 18pF 180pF 1800pF 2.0pF 20pF 200pF 2000pF 2.2pF 22pF 20pF 2200pF 0.022uF 0.22uF 2.2uF 22uF 220uF 2200uF 2.4pF 24pF 240pF 2400pF 2.7pF 27pF 270pF 2700pF 3.0pF 30pF 300pF 3000pF 3.3pF 33pF 330pF 3300pF 0.033uF 0.33uF 3.3uF 33uF 330uF 3300uF 3.6pF 36pF 360pF 3600pF 3.9pF 39pF 390pF 3900pF 4.3pF 43pF 430pF 4300pF 4.7pF 47pF 470pF 4700pF 0.047uF 0.47uF 4.7uF 47uF 470uF 4700uF 5.1pF 51pF 510pF 5100pF 5.6pF 56pF 560pF 5600pF 6.2pF 62pF 620pF 6200pF 6.8pF 68pF 680pF 6800pF 0.068uF 0.68uF 6.8uF 68uF 680uF 6800uF 7.5pF 75pF 750pF 7500pF 8.2pF 82pF 820pF 8200pF 9.1pF 91pF 910pF 9100pF #generics #CommonPartsLibrary
  • Generic Inductor
    A generic fixed inductor for rapid developing circuit topology. *You can now change the footprint and 3D model at the top level anytime you want. This is the power of #generics
  • 875105359001
    10uF Capacitor Aluminum Polymer 20% 16V SMD 5x5.3mm #forLedBlink #commonpartslibrary #capacitor #aluminumpolymer #radialcan
  • CTL1206FYW1T
    Yellow 595nm LED Indication - Discrete 1.7V 1206 (3216 Metric) #forLedBlink
  • 1070TR
    Battery Holder (Open) Coin, 20.0mm 1 Cell SMD (SMT) Tab bate or batt #forLedBlink
B5
B8
MicroAmp
B3
B2
B4
Display
B1
B7
B6
The display has its own regulator + level shifter. For this reason we give it 5V...

The display has its own regulator + level shifter. For this reason we give it 5V supply. The digital I/O should use 3.3v thanks to the level shifter. We use its regulator output to power the LEDs, to avoid stressing the Pico regulator.
1y
VCC5v
VCC3v3_LCD
PICO
SIPO_LATCH
R8
Resistance
1k Ω
B2
ENCBtn
B6
B8
B6
R1
Resistance
1k Ω
L8
B1
ENCA
B2
ENCODER
B3
ENCB
B4
SIPO_TX
R2
Resistance
1k Ω
B8
B5
R3
Resistance
1k Ω
R7
Resistance
1k Ω
R5
Resistance
1k Ω
R6
Resistance
1k Ω
R9
Resistance
1k Ω
B7
RESET
B4
SIPO_SCK
SIPO1
B7
L8
B5
R4
Resistance
1k Ω
B3

PiStrument

PiStrument
Description

Created
September 28th 2023
Last updated by brooks
8 months ago
3 Contributor(s)
nico
natarius
brooks

Controls

Properties

Availability & Pricing

DistributorQty 1
Digi-Key$3.30
LCSC$7.78
Mouser$3.55

Assets

    DefaultThumbnail
  • thumbnail
    pistrument-PCB-g-IMG_1316 (1).svg

    id=pistrument-PCB-g-IMG_1316 (1)

Simulation

µs

Simulation Speed

tell me about this project
@copilot tell me about this project
7mo
Certainly! You're working on a project called PiStrument. It's a Raspberry Pi Pico-based sampler, sequencer, and drum machine with an embedded speaker, an Adafruit I2S amplifier, and momentary step switches, reminiscent of the classic TR-808 synthesizer.
Key Project Components:

  1. Raspberry Pi Pico (PICO)

    • Acts as the main microcontroller for the project.
    • Uses various GPIO pins for interfacing with other components.
  2. Adafruit I2S Amplifier (DAC AMP)

    • Amplifies the audio signals.
    • Has specific pins for data input BCLK, DIN\text{BCLK, DIN}, ground, power, and speaker output S+, S-\text{S+, S-}.
  3. Momentary Step Switches (Various designators like B0, B1, B2, etc.)

    • These are used as input buttons and have built-in LEDs for indication.
    • Each switch has pins for common, normally closed DefClosed\text{DefClosed}, normally open DefOpen\text{DefOpen}, and LED terminals.
  4. Shift Register (SIPO1) - SN74HC595N

    • Used for expanding the GPIO capabilities by controlling multiple outputs with fewer GPIO pins.
    • Interfaces with the Raspberry Pi Pico using serial communication.
  5. Adafruit Display (Display)

    • Acts as the visual interface.
    • Connects to the Raspberry Pi Pico via SPI connection using pins like MISO, MOSI, SCK\text{MISO, MOSI, SCK}, etc.
  6. Various Resistors (R1, R2, R3, etc.)

    • These are mainly 1kΩ resistors used throughout the circuit for current limiting and as pull-up/pull-down resistors.
Power Supplies:

  • VCC5v and VCC3v3_LCD are power nets used in the project to provide appropriate voltage levels to different components.
Nets:
Nets are connections that interlink various components in the circuit. Some of the important nets in the project are:

  • GND for ground connections.
  • Net (MicroAmp - Vdd)\text{(MicroAmp - Vdd)} connecting power to the I2S amplifier.
  • Net (PICO - GPIO3)\text{(PICO - GPIO3)}, etc.
Project Goals:

  • Sampler/Sequencer/Drum Machine Functionality: Mimics the TR-808 functionality.
  • Embedded Speaker: For audio output.
  • Visual Feedback: Provided by the Adafruit Display and LEDs on momentary switches.
  • Control Interface: Momentary step switches to input controls.
Connecting Components (Examples):
Here are a few connections to highlight:

  • Connect R1:1 to SIPO1:Q0.
  • Connect R1:2 to B0:LED +.
  • Connect PICO:GPIO0 to DAC AMP:BCLK.
  • Connect PICO:GPIO12 to Display:MISO.
Assumptions:

  • The values for resistors are typical 1kΩ unless specified otherwise.
  • Power supply nets like VCC5v and VCC3v3_LCD are managed properly to provide stable voltages.
  • Standard pin convention for components is assumed unless specified differently.
Feel free to ask more specific questions or for detailed connection instructions!
7mo
How could I improve this project?
7mo
Improving an electronics project like the PiStrument can involve several aspects, including hardware, software, and usability enhancements. Here are some suggestions:
Hardware Improvements:

  1. Adding More Inputs/Outputs:

    • Use additional shift registers (like SN74HC595N) to expand the number of inputs/outputs.
    • Use multiplexers or decoders to handle more switches or LEDs.
  2. Power Management:

    • Implement a more robust power supply design, possibly including a power management IC to handle different voltage rails efficiently.
    • Add battery support with charging circuits for portability.
  3. Enhanced Audio Output:

    • Consider using a higher-quality DAC and amplifier for improved sound quality.
    • Add a headphone jack for private listening.
  4. Input Feedback:

    • Use RGB LEDs for the switches instead of single-color LEDs to provide more visual feedback.
    • Add capacitive touch sensors for a modern, touch-sensitive interface.
  5. Expand Display Capabilities:

    • Use a larger or higher resolution display.
    • Integrate touchscreen capabilities for more interactive control.
  6. Connectivity:

    • Add Bluetooth or Wi-Fi modules for wireless connectivity and remote control.
    • Incorporate MIDI input/output for interfacing with other musical equipment.
Software Improvements:

  1. User Interface:

    • Develop a more intuitive and visually appealing user interface on the display.
    • Implement multi-language support for broader accessibility.
  2. Firmware Enhancements:

    • Optimize the firmware for better performance and lower latency.
    • Add advanced features like sampling, looping, effects processing, and more.
  3. Custom Configuration:

    • Allow users to customize the functionality of the buttons, knobs, and other inputs through a configuration interface.
  4. Open-Source Collaboration:

    • Make the firmware open-source to allow the community to contribute improvements and new features.
    • Provide detailed documentation to help others modify and enhance the project.
Usability Improvements:

  1. Ergonomics:

    • Ergonomically redesign the layout to make it more comfortable and intuitive to use.
    • Use better tactile or mechanical switches for a more satisfying user experience.
  2. Enclosure Design:

    • Design a custom enclosure to house all the components neatly and protect them from external damage.
    • Ensure the enclosure has proper ventilation to prevent overheating.
  3. Expandability:

    • Design the project to be modular, allowing easy addition of new functionalities or components.
    • Provide connectors/interfaces for easily expanding the hardware.
Example Implementations:

  • RGB LED Control: Connect common, R, G, B pins of RGB LEDs to PWM-capable GPIOs on the Raspberry Pi Pico.
  • Wi-Fi Module: Use an ESP8266 or ESP32 module. Connect its RX/TX to the Raspberry Pi Pico’s UART pins for communication.
  • Touch Display: Use a capacitive touchscreen display module and interface it with the SPI pins of the Raspberry Pi Pico.
Example Connections for Improved Audio:

  • Connect DAC AMP:BCLK to PICO:GPIO0 (BitClock)\text(Bit Clock).
  • Connect DAC AMP:DIN to PICO:GPIO2 (DataIn)\text(Data In).
  • Connect DAC AMP:LRC to PICO:GPIO1 (Left/RightClock)\text(Left/Right Clock).
  • Use a higher-quality DAC/Amp module, maybe one with an on-board audio jack.
By implementing these improvements, you can make the PiStrument more versatile, user-friendly, and powerful. Let me know if you need detailed instructions or specific recommendations for any of these enhancements!
7mo
Can you generate a .step file for the enclosure?
Also, some code for the Rpi?
7mo
Currently, I don't have the capability to generate .step files directly. However, I can provide a basic outline for designing an enclosure which you can then convert into a .step file using CAD software like Fusion 360, SolidWorks, or even simpler tools like Tinkercad. Here's a basic outline for the enclosure:
Enclosure Design Outline:

  1. Dimensions:

    • Base dimensions should accommodate the PCB with some extra space for wiring. For example, if your PCB is 100mm x 60mm, consider a base of 120mm x 80mm.
    • Height should be sufficient to house components like the GPIO pins, connectors, etc. A typical height might be 30mm.
  2. Component Cutouts:

    • Cutouts for the USB port, display, buttons, and any other external connectors (e.g., headphone jack, power supply).
  3. Mounting Holes:

    • Holes for securing the PCB inside the enclosure using standoffs.
    • Holes for ventilation if necessary.
Enclosure Parts:

  • Base: Rectangular base with necessary mounting holes.
  • Top: Clear or vented top cover with cutouts for the display and buttons.
  • Sides: Sides with cutouts for connectors (e.g., USB, audio).
Example CAD Configuration:

  • Material: Use a durable plastic like ABS or PLA for 3D printing.
  • Thickness: 2-3mm wall thickness.
Steps to create in CAD:

  1. Create base rectangle with mounting holes.
  2. Extrude base to form walls.
  3. Add cutouts for the display, buttons, and connectors.
  4. Create top cover with openings for buttons and display.
  5. Export as .step file.
You can refer to any standard CAD software's documentation for the specifics on creating these shapes and exporting them as a .step file.
Sample Code for Raspberry Pi Pico:
Here’s a simple code example for the Raspberry Pi Pico to control a few aspects of your project, such as reading button presses and controlling LEDs.

Python


# Import necessary modules
from machine import Pin, I2S
import utime

# Pin definitions
button_pins = [4, 5, 6]  # GPIO pins for buttons
led_pins = [14, 15, 16]  # GPIO pins for LEDs
audio_out_pin = 18       # GPIO pin for I2S audio out

# Initialize buttons as inputs
buttons = [Pin(pin, Pin.IN, Pin.PULL_UP) for pin in button_pins]

# Initialize LEDs as outputs
leds = [Pin(pin, Pin.OUT) for pin in led_pins]

# Initialize I2S for audio output
audio = I2S(0, sck=Pin(audio_out_pin), ws=Pin(audio_out_pin+1), sd=Pin(audio_out_pin+2))

def read_buttons():
    states = [not button.value() for button in buttons]
    return states

def set_leds(states):
    for led, state in zip(leds, states):
        led.value(state)

def main():
    while True:
        button_states = read_buttons()
        set_leds(button_states)
        # Add more functionality as needed
        utime.sleep(0.1)

if __name__ == "__main__":
    main()
Explanation:

  • Pin Initialization:

    • Buttons are connected to GPIO pins 4, 5, and 6 with pull-up resistors.
    • LEDs are connected to GPIO pins 14, 15, and 16.
    • I2S for audio output is initialized with an example pin (you should update according to your actual pin configuration).
  • Functions:

    • read_buttons() reads and returns states of buttons.
    • set_leds(states) sets LEDs based on the button states.
  • Main Loop:

    • Continuously reads button states and updates LEDs accordingly.
Feel free to modify and extend this code according to your specific requirements and the additional functionalities you plan to implement for your project. If you need more specific functionality or integration, let me know!
7mo
Hey, I’m Copilot, your AI design assistant. I can help you brainstorm ideas, deb...
Hey, I’m Copilot, your AI design assistant. I can help you brainstorm ideas, debug problems, research components, and even make wiring connections for you. Ask me questions like:

  • @copilot I'm designing a PCB for a medical device that measures heart rate and temperature. Can you give me the list of components I will need?
  • @copilot How would I connect these parts to make the LED flash at 1kHz?
  • @copilot can you choose 4 digital pins on the ATMega328P-AU that I have here to use as GPIO given that I am already using some pins for reset, the external clock, UART, and I2C.
Chat with me by tagging @copilot on comments or in the chat.
1y
Someone is typing...
Checks that the power traveling across a given resistor is under its rating with 50% headroom.
Learn more
Checks that IC pins that require pull up or pull down resistors have them.
Learn more
Checks that capacitors have appropriate voltage ratings to prevent overheating and ensure reliable circuit operation.
Checks that all parts have a part number and are available from distributors.
Des
Net
Des
Net
LED +
Trace 9848
R1-LED1+
Common
Trace 3836
B0 Common
GPIO7
Trace 2fce
B4 Common
GPIO26_ADC0
Trace 679a
MIC Analog Out
GPIO22
Trace ba9c
Encoder BTN
GPIO6
Trace 8131
B3 Common
GPIO28_ADC2
Trace 30cd
Encoder A
GPIO2
Trace 93d9
DAC DIN
GPIO3
Trace bf58
B0 Common
GPIO1
Trace bb3f
DAC LRC
Trace 0564
LCD MISO
GPIO12
GPIO0
Trace fad8
DAC BCLK
GPIO8
Trace b6f5
B5 Common
RUN
Trace df71
~RESET
GPIO16
Trace d1a5
B8 Common
AGND
Trace f960
MIC Analog GND
GPIO19
Trace 5670
ShiftOut DS
GPIO9
Trace 1ab4
B6 Common
GPIO17
Trace 74c9
SD CS
GPIO15
Trace 6fa9
LCD MOSI
GPIO5
Trace 25c4
B2 Common
GPIO10
Trace b0e5
B7 Common
GPIO4
Trace c76f
B1 Common
GPIO13
Trace 6fd4
LCD TCS
GPIO20
Trace 3193
ShiftOut ST_CP
GPIO27_ADC1
Trace 4ef4
Encoder B
GPIO11
Trace f6ca
LCD DC
VBUS
Trace c6bd
VCC USB 5V
GPIO18
Trace a9ea
ShiftOut SH_CP
GPIO14
Trace f54c
LCD SCK
GPIO21
Trace a68f
R9-LED8+
3V3
Trace ec8b
VCC3v3_PI
LED +
Trace 20d0
R5-LED5+
Common
Trace 12d3
B5 Common
P2
Trace 8e79
R8-LED6+
P1
Trace b8ce
LED ShiftOut 6
LED +
Trace 8409
R9-LED8+
Common
Trace d878
B8 Common
P2
Trace 6ddf
R1-LED1+
P1
Trace d686
LED ShiftOut 0
Out
Trace 8230
MIC Analog Out
Vdd
Trace d5e5
VCC3v3_PI
GND
Trace e4f0
MIC Analog GND
Trace 5724
R6-LED3+
LED +
Common
Trace f60b
B3 Common
Trace 62bd
R2-LED2+
LED +
Trace 5cb1
B2 Common
Common
Trace b684
Encoder BTN
Trace 3ebf
Encoder B
B
Trace 07e1
Encoder A
A
LED +
Trace c49b
R3-LED4+
Common
Trace 9aa3
B4 Common
Trace 1a0d
Speaker NC 1
S+
Trace 7f46
DAC LRC
LRC
Trace 684e
VCC USB 5V
Vin
DIN
Trace c561
DAC DIN
Trace 48eb
DAC BCLK
BCLK
S-
Trace 8c55
Speaker NC 2
Trace 0fd3
LCD SCK
SCK
SDCS
Trace e99b
SD CS
MOSI
Trace effa
LCD MOSI
Trace 80ad
LCD DC
DC
Trace 7851
VCC USB 5V
Vin
Vin
Trace abe7
VCC USB 5V
MISO
Trace cff2
LCD MISO
3V
Trace a576
VCC3v3_LCD
Trace 7cdf
LCD TCS
TCS
S+
Trace afd4
Speaker NC 1
Trace 6225
Speaker NC 2
S-
S-
Trace f4d8
Speaker NC 2
LED +
Trace b74b
R7-LED1+
Trace 2dd1
B1 Common
Common
Trace 7e20
R2-LED2+
P2
Trace 1797
LED ShiftOut 2
P1
Trace 5730
R3-LED4+
P2
P1
Trace ab8e
LED ShiftOut 4
P2
Trace c913
R7-LED1+
Trace 223e
LED ShiftOut 1
P1
P1
Trace cfd3
LED ShiftOut 1
Trace 2dc4
R5-LED5+
P2
P1
Trace c381
LED ShiftOut 5
Trace 93a9
R6-LED3+
P2
Trace 41e3
LED ShiftOut 3
P1
Trace 20c1
R9-LED8+
P2
P1
Trace c6aa
R9-LED8+
Trace 9a42
R4-LED7+
LED +
Trace 82fb
B7 Common
Common
Trace 1a72
B7 Common
Common
Trace 6bfd
~RESET
1
Trace b147
~RESET
1
Trace 1fd6
R8-LED6+
LED +
Trace 30bf
B6 Common
Common
Trace 345c
ShiftOut ST_CP
ST_CP
Trace 5f55
ShiftOut ST_CP
ST_CP
Trace 08ab
LED ShiftOut 5
Q5
Q1
Trace de98
LED ShiftOut 1
Trace dc58
LED ShiftOut 2
Q2
Trace 3f89
LED ShiftOut 2
Q2
Trace dc27
LED ShiftOut 0
Q0
Trace 5259
LED ShiftOut 0
Q0
Trace 04ae
LED ShiftOut 7
Q7
Trace 4fae
LED ShiftOut 7
Q7
Trace 9e4d
LED ShiftOut 7
Q7
Trace 2a02
VCC3v3_LCD
VCC
Trace 5045
VCC3v3_LCD
VCC
Trace 1ce2
VCC3v3_LCD
VCC
Trace ca3f
LED ShiftOut 4
Q4
Q4
Trace e657
LED ShiftOut 4
Trace 6e71
ShiftOut SH_CP
SH_CP
Trace ba76
ShiftOut SH_CP
SH_CP
Trace cdd7
LED ShiftOut 6
Q6
Trace 949f
LED ShiftOut 3
Q3
Trace c2ed
LED ShiftOut 3
Q3
Trace d228
ShiftOut DS
DS
Trace 133b
VCC3v3_LCD
~MR
Trace 167b
R4-LED7+
P2
Trace 9192
LED ShiftOut 7
P1
Trace 49f7
VCC USB 5V
P1
Reports parts that have no footprint.
Reports nodes that are assigned to a layer that doesn't exist in the layout stackup.
Designator
Ruleset
Pad
LCD M2
Pads
Force pico TH
Pad
LCD M1
Reports terminals that are not connected properly. NOTE: Only connections to the center of pads are considered valid.
Reports nodes that are using rules that are not supported anymore.
Reports layers that have multiple copper fills of different nets. Make sure the Connected Layers rule value of nets with fills is valid.
Name
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via
Via