-
1PCB Assembly
The assembling process was not too difficult because this PCB is a through-hole board without any SMD components.
First, we installed two CON7 header pin sockets in their place, and after that, we added the CON3 UC203 connector to the PCB.
Next, we use a soldering iron to solder the CON7 and CON3 pads.
Next, we align the XIAO with the two CON7 header pins and connect the potentiometer's wire harness to the CON3. -
2CODE
Here's the sketch that we used in this project to control the PC's volume, and it utilizes the HID protocol using an XIAO microcontroller. This was because of the microchip's SAMD21G18 inside the XIAO SAMD21.
#include <HID-Project.h> //include HID_Project library #include <HID-Settings.h> #define REVERSED false int val = 0; int previousval = 0; int val2 = 0; void setup() { Consumer.begin(); //initialize computer connection delay(1000); //wait for computer to connect for(int a = 0; a < 52; a++) { Consumer.write(MEDIA_VOLUME_DOWN); //set the volume to 0 delay(2); } } void loop() { val = analogRead(D0); //read potentiometer value val = map(val, 0, 1023, 0, 101); //map it to 102 steps if(REVERSED) { val = 101 - val; } if(abs(val - previousval) > 1) { //check if potentiometer value has changed previousval = val; val /= 2; //divide it by 2 to get 51 steps while(val2 < val) { Consumer.write(MEDIA_VOLUME_UP); //turn volume up to appropiate level val2++; delay(2); } while(val2 > val) { Consumer.write(MEDIA_VOLUME_DOWN); //turn volume down to appropiate level val2--; delay(2); } } delay(301); }
-
3Frame Assembly
Prior to beginning the assembly process, we connected the two frames together and joined them from the input side using the Pi1000 logo.
Four M2 screws are used to fasten the Pi1000 logo to the frame.
We added an additional logo piece from the other side and used M2 screws to fasten the frame together.
Here, the Two Logo has two purposes: one, it joins the two frame sections to form a single, large frame; second, it just looks good.
-
4Keyboard Breakdown
We bought a small membrane keyboard for our project. It was the most affordable we could find, and the size was also adequate.
Some keyboards contain membranes, in which the keys are pressure pads rather than discrete moving parts.
These pressure pads are added to a flexible PCB, which contains tracks that link to the driver board of this keyboard.
There's a "black dot epoxy-like portion" that incorporates a tiny wafer—also known as a circuit on board, or COB—on the main driver PCB.
- We removed the keyboard's top cover, which contains the plastic keys, the middle motherboard layer, which is made up of three flexible PCBs, and the bottom cover.
- We only used the membrane-flexible PCB and the top cover in this build.
-
5Keyboard Assembly
The Flex PCB Holder is first placed on the back of the keyboard to start the keyboard assembly process.
Here, three holders that step down the membrane PCB layer and hold it in place when the key is pressed have been modeled and 3D printed.
M2 screws are used to secure all three holders.
With the addition of the Flex PCB holder, the keyboard may now function without the use of its back cover, which was designed to hold the membrane in place. The new configuration is more streamlined than the one with the back cover.
-
6Frame-Keyboard Assembly
- The keyboard is positioned in its proper location after it's set into the inside of the frame.
- We use hot glue to attach the keyboard to the frame body so that it cannot move. Hot glue is used around the keyboard's perimeter to securely attach it to the frame.
-
7Raspberry Pi 5
In this project, we are utilizing the 4GB version of the Raspberry Pi 5, which has a new Broadcom BCM2712 2.4GHz quad-core 64-bit Arm Cortex-A76 CPU with LPDDR4X-4267 SDRAM available in 1GB to 8GB models.
It also features a VideoCore VII GPU, which is great if we are watching 4K videos or emulating anything on the Pi5. It can also run 4K videos on two monitors.
The exciting part is here: the new Raspberry Pi 5 has a PCIe 2.0 x1 interface, so we can finally use custom adapters to connect devices to the Pi, such as SSDs or even GPUs.
-
8Raspberry Pi 5- M.2 HAT- OS Setup
We got an official Raspberry Pi M.2 Hat in addition to the Raspberry Pi 5, and it supports M Key SSDs in the 2230 and 2242 form factors. But since we already had a full-sized 2280 SSD, we created an adapter that mounts to the existing hat and extends it so that the 2280 SSD can be attached.
We added an Ant Esports 690 Neo Pro M.2 NVMe PCIe 3.0 x4 SSD, which is a Gen 3 SSD and can provide read and write speeds of 1600 to 1100 MB/s.
Raspberry Pi OS was installed on the NVME by following the wonderful getting started guide by Jeff Geerling, which you can checkout at the below link.
https://www.jeffgeerling.com/blog/2023/nvme-ssd-boot-raspberry-pi-5
The simplest method is to use an SSD adaptor to connect the SSD to the PC so that we can use a Raspberry Pi imager to burn the operating system directly onto the SSD. Alternatively, we may use the SD card to store the operating system first and then clone it onto the SSD.
In our case, we use the clone method as we first need to enable the external PCIe port on the Raspberry Pi 5, which can be done by editing the config.txt file and adding the below lines at the bottom of the config file.
# Add to bottom of /boot/firmware/config.txtdtparam=pciex1# Note: You could also just add the following (it is an alias to the above line)# dtparam=nvme# Optionally, you can control the PCIe lane speed using this parameter# dtparam=pciex1_gen=3
To clone the SD Card into the SSD, we first check if the Raspberry Pi is reading the SSD, which can be done by running
lsblk
Next, we run rpi-clone, which is a shell script for cloning a Raspberry Pi booted source disk developed by Jeff Geerling.
# Install rpi-clone.git clone https://github.com/geerlingguy/rpi-clone.gitcd rpi-clonesudo cp rpi-clone rpi-clone-setup /usr/local/sbin# Clone to the NVMe drive (usually nvme0n1, but check with `lsblk`).sudo rpi-clone nvme0n1
-
9Pi Holder
- The Pi is now ready for the Pi Holder Assembly, which is assembled by first placing the Pi on top of the 3D-printed holder and then fastening it there using four M3 bolts paired to four M3 PCB standoffs.
- The M.2 Shield is then positioned over the Raspberry Pi and fastened with four M3 bolts.
- Finally, we connected the PCIE Flex cable to the PCIE connector on the Raspberry Pi and then to the PCIE connector on the M.2 hat.
-
10Adding Pi Holder to Keyboard-Frame Assembly
- After putting the Pi Holder Assembly above the mounting screws and adding it inside the Keyboard-Frame Assembly, we tightened the Keyboard Frame with the Pi Holder using four M2 screws.
- Next, plug the keyboard's USB into the Raspberry Pi's USB 2.0 port.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.