-
Notifications
You must be signed in to change notification settings - Fork 2
07 Hardware
Tip
If you any idea or suggestion about the hardware, share them here: https://github.com/apiel/zicBox/discussions/2
If you need help for building, feel free to create a new discussion.
ZicPad | Zic Pixel |
PCBs are designed with EasyEDA. You can load the copy of the projects using the easyeda json file available in the different folder of the builds.
To order the PCB, you need to send the Gerber file (gerber*.zip) to https://jlcpcb.com/. With slow shipping (about 10 days), it cost around 4€. Just upload the file using the button Add gerber file
and normally there should be nothing to change. You can eventually change the color from green
to black
, it should not impact the price. Finally Save to cart
and proceed to the checkout.
In my builds, I am using PCM5102 a cheap but good quality DAC that can be found on Amazon and Aliexpress. Depending where you buy it, you might need to solder some jumper on the DAC.
Our system will use the Alsa-project software to drive the I2S signal and sound system. This is usually installed by default but we can use the command below to make sure it’s up to date.
sudo apt-get install alsa-utils
We next need to create a configuration file for the Alsa sound system. This will define a number of audio devices and how they should be set up so that the sound system can then use them to generate and output the sound signals.
Paste the following code in /etc/asound.conf
.
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}
This basically sets up a PCM audio device along with a mixer device to allow us to adjust the volume in software.
The final step is to edit the /boot/config.txt
file to load the device tree overlays at start up.
First look for the line
dtparam=audio=on
This turns on the standard headphone outputs so we need to disable it by commenting out this line – just put a # at the start of the line.
Then at the bottom of the file we need to add the I2S overlays.
dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap
Finally reboot the Raspberry Pi to get all the changes loaded.
To test, try playing a simple WAV file.
speaker-test -c2 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav
In order to not interfer with gpio, uart (serial) should be disabled.
In /boot/config.txt
add:
# disables the UART functionality
enable_uart=0
# disables the Bluetooth module, which may otherwise occupy the UART.
dtoverlay=disable-bt
Disable the Serial Service by running the following commands:
sudo systemctl stop [email protected]
sudo systemctl disable [email protected]
Then reboot. Check if serial is gone by running ls -l /dev/serial*
To be able to access GPIO pins for the hardware interface (rotary encoder and buttons) the application need to run as root. In order to void to run zicBox as root, we can run a separate application to access the GPIO and communicate with the main zicBox application through OSC messages.
Everything is in hardware/gpio/
folder.
However this is not mandatory and can instead use EncoderController
and Mpr121Controller
directly in ZicBox, in counter part of running it as root.
sudo apt-get install libpigpio-dev liblo-dev
make build
Note
-
TODO
run zicGpio as a service.
There has been a bunch of prototypes, to try out multiple design till I find something easy to build, not too expensive and with a good workflow.
A version of ZicBox with a big touch screen (800x400), 6 encoders (1 push), a 10 keycap and a DAC.
A small version of ZicBox using capacitive PCB keyboard with MPR121 ICs and smaller display. The goal was to reduce the cost and make ZicBox more affordable but the UX was really not good so I abandoned the idea to use capacitive touch.
ZicPad is an advance hardware version of ZicBox with a big touch screen, 12 encoders and a 4x12 RGB keypad.
Note that this design doesn't have DAC and this might be problematic for some of us. The built-in DAC from RPi4 did improve a little bit but is far from being optimal. When I made this design, I was building it with using USB as audio interface in mind, in my case using my Elektron Digitone or my Behringer Xenyx 302 USB mixer... This is the point, many device today support audio in/out over USB and this is why I prefered to had more encoder instead of using a DAC. Having a DAC would not be so hard, but would require some small change on the PCB to move the encoder on a separate ICs instead to connect them directly to the RPi GPIO.
- 1x Adafruit NeoTrellis M4 Express 37€ on mouser
- 1x Adafruit NeoTrellis 12€ on mouser
- 3x Silicone Elastomer 4x4 Button Keypad 4.60€ on mouser
- 1x 2.8inch Capacitive Touch Display for Raspberry Pi, 480×640, DSI 40€ on Geekbuying, 60€ on Amazon
- 12x encoders wihtout detent PEC12R-4025F-N0024 1.13€ on mouser (but might get expensive with shipping, could use other encoder to reduce cost)
- 1x PCBs at JLCPCB 4€ inlucing shipping
- 1x Raspberry PI about 50€ depending on the model you get (note that RPi5 doesn't have jack output so the only way to get audio output will be using a USB sound card. At some point I might add a DAC but for this I would need to rework the encoder array to use an I2C IC to free the I2S GPIO)
To reduce cost, I would recommend to order everyhting at once on mouser and get free shipping.
About 190€ without enclosure.
For the enclosure, there is 2 options:
- PCB front panel, about 30€ at JLCPCB
- Laser cutted wood and/or acrylic
The rest of the enclosure is hand made out of wood.
The PCB has been created with EasyEDA. You can load the copy of the PCB project using the json file PCB_zicbox_encoders_2024-01-11.json.
To order the PCB, you need to send the Gerber file Gerber_zicbox_encoders_2024-01-11.zip to https://jlcpcb.com/. With slow shipping (about 10 days), it cost around 4€. Just upload the file using the button Add gerber file
and normally there should be nothing to change. You can eventually change the color from green
to black
, it should not impact the price. Finally Save to cart
and proceed to the checkout.
The PCB assembly is quiet easy, it is just few encoder and pins headers to solder to the board.
For the front panel, it is also possible to order it as a PCB. I haven't yet tried myself, as it is more expensive due to the size (around 30€). I am waiting for the graphic design before to order it. So far, I made the front panel using my laser engraver to cut wood and acrylic sheet. To do this, I was converting the gerber file of PCB outline to Gcode, using a small script. For more details about this process, see my notes in the case folder.
The EasyEDA file and the gerber file for the front panel are available here.
The rest of the enclosure has been fully hand made out of wood, using a saw, drill and glue. For this part, it will be up to your own creativity :p till someone come up with 3d model.
Previous: 06-Config-plugins | Next: 90-Music-programming-tutorial