Devlog 01: Designing the 6-Key Macropad Schematic
Project Goal
The goal of this project is to build a small and compact 2x3 macropad with hardware media controls, an OLED display and RGB lighting.
Hardware & Components
For the main controller, I decided to use the Seeeduino XIAO because it is very small and has enough GPIO pins for this project.
The main components I am using are:
- Microcontroller: Seeeduino XIAO
- Switches: 6 mechanical switches in a 2x3 layout
- Media Control: 1 rotary encoder
- Display: I2C OLED display
- Lighting: 4 WS2812B RGB LEDs connected in a chain
KiCad Schematic
For the first stage, I started working on the schematic in KiCad.
The main idea was to first decide how all the components should be connected and which GPIO pins I should use before moving to the PCB design.
Switch Matrix
The 6 switches are arranged in a 2-row and 3-column matrix. This helps reduce the number of GPIO pins required.
Each switch is connected with a diode so that multiple keys can be pressed at the same time without causing key ghosting.
Overall, the switch matrix uses 5 GPIO pins from the XIAO.
OLED Display
The OLED is connected using I2C.
I connected the OLED to the XIAO’s:
SDASCL3.3VGND
This allows the microcontroller to communicate with the display using the I2C protocol.
Rotary Encoder
For the rotary encoder, I am using two signal pins:
ENCAENCB
These will be used to detect the direction in which the encoder is rotated.
The common pin of the encoder is connected to GND.
RGB LEDs
For the RGB lighting, I am using 4 WS2812B LEDs connected in a daisy chain.
Instead of using separate GPIO pins for every LED, I am using one data line called LED_DATA to control all four LEDs.
The LEDs are powered using the 5V line.
Something I Just Found Out
While working on this project, I just found out that there is a plugin that can connect Hackatime with KiCad.
This is actually pretty useful because I can track the time I spend working on the KiCad part of the project through Hackatime as well.
I am going to try setting this up and see how well it works with the project.
What’s Next?
Now that the basic connections are done in the schematic, the next part is to move towards the actual PCB design.
PCB Layout
I will assign the required footprints to all the components and then start positioning the 2x3 switch layout.
After that, I will route the copper traces and complete the PCB layout.
Enclosure
Once the PCB is ready, I plan to export it as a STEP model and use it in a 3D CAD workspace to design a custom enclosure for the macropad.
Firmware
After the hardware side is ready, I will start working on the firmware using the KMK framework in Python.
The firmware will handle:
- Switch matrix scanning
- Rotary encoder input
- OLED display
- RGB lighting and animations
This is the first stage of the project. Right now, my main focus is getting the schematic and hardware connections right before moving to the PCB.
Comments 2
Awesome project and what is the plugin for Hackatime
@anasluqman089 its a plugin i found in github, wakatime for kicad
Sign in to join the conversation.