A week ago we received the acrylic enclosures for ANAVI Macro Pad 2. We contracted a trusted local company in a near-by town in Bulgaria to make them using laser cutting of 2 mm transparent clear acrylic sheets. There are blue protective films on both sides of each acrylic enclosure which you will need to remove when you receive your ANAVI Macro Pad 2 kit.
ANAVI Macro Pad 2 acrylic enclosures with blue protective films on both sides
The design of the acrylic enclosures has been done with the popular open source software OpenSCAD. It is a simple and lightweight application that runs on MS Windows, MacOS and Linux. I am using it on Ubuntu. OpenSCAD is a script-only based modeller that uses its own description language to create solid 3D CAD objects. The .scad files for ANAVI Macro Pad 2 are available in GitHub. OpenSCAD supports exporting to various different file formats, including svg and pdf.
The acrylic enclosures were designed using a script in OpenSCAD
Before the launch of the crowdfunding campaign at Crowd Supply we experimented with several different designs but finally settled on a very simple design with is easy to manufacture. Furthermore, if in future you need a spare part and have a 3D printed, you can also export stl file from OpenSCAD and print it. By the way, there is a line in the source code that you need to uncomment to covert the enclosure parts from 2D to 3D for 3D printing. The OpenSCAD files and schematics for the acrylic enclosures of ANAVI Macro Pad 2 are available in GitHub.
Raspberry Pi is a famous series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in cooperation with Broadcom. This is a step by step tutorial for using Raspberry Pi and capacitive soil moisture sensor with Microchip MCP3002 analog-to-digital converter (ADC) and a Python script for detecting the soil moisture in percentage.
Capacitive Soil Moisture Sensor
Capacitive Soil Moisture Sensor v1.2 and v2.0 measures the volumetric content of water inside the soil and retrieves the moisture level by capacitive sensing rather than resistive sensing like other sensors. The benefit of using a capacitive soil moisture sensor is the lack of corrosion and longer lifespan.
Wiring
Unlike Raspberry Pi Pico, the recently released microcontroller, all versions and models of the Raspberry Pi single-board computers do not include an analog-to-digital converter (ADC). This tutorial explains how to use Microchip MCP3002 with Raspberry Pi.
Microchip MCP3002 is a 10-bit resolution, dual channel ADC with SPI hardware bus. It can be connected to any Raspberry Pi single board computer version and model, including Raspberry Pi 4 and Raspberry Pi 0. However, this tutorial is not for Raspberry Pi Pico microcontroller. For more details about the wiring of Microchip MCP3002 a Raspberry Pi single-board computer have a look at my previous tutorial.
Prototypes for Raspberry Pi add-on boards
Alternatively, the easier option without a breadboard an a bunch of cables, is to use a dedicated Raspberry Pi add-on board with built-in ADC. Using the free and open source tool KiCad we designed ANAVI Gardening uHAT exactly for this purpose. It has dedicated pins for connecting a couple of capacitive soil moisture sensors. The prototype has been created thanks to PCBWay. This is a lead-free prototype printed circuit board with 2 layers, green solder mask and white silkscreen. PCBway offers a huge variety of colors and even flexible PCB.
Software
Flash Raspberry Pi OS, the official Debian based GNU Linux distribution by the Raspberry Pi, on microSD card and boot it. On the Raspberry Pi, open a terminal and using the raspi-config tool enable SPI as shown in the video. Reboot the Raspberry Pi.
Python3 script for reading data from a couple of capacitive soil moisture sensors through Microchip MCP3002 ADC is available at the anavi-examples repository in GitHub. The script relies on popular Python libraries spidev and RPi.GPIO. Open a terminal and run the following commands to clone anavi-examples and run the script:
git clone https://github.com/AnaviTechnology/anavi-examples.git
cd anavi-examples/anavi-gardening-uhat/soil-moistore-sensors/python/
python3 soil-moistore-sensors.py
ANAVI Macro Pad 2 with all stickers which are part of the crowdfunding campaign stretch goals.
Having met the stretch goals means all kits will include 32 awesome transparent Emoji stickers. You can put them on any side of the translucent keycaps. It is entirely up to you to decide whether to use the stickers and on which keys to put them. This way you can customize your ANAVI Macro Pad 2 with its own unique look!
These transparent Emoji stickers feature icons from Font Awesome, available under CC BY 4.0 License in GitHub. Thank to our trusted local supplier in Plovdiv, Bulgaria they are printed on a glossy transparent foil and laser-cut in rectangular or square shapes, depending on the icon dimensions and proportions. We already have experience with the same stickers because they are also part of the ANAVI Macro Pad 8 kits.
In addition, ANAVI Macro Pad 2 includes logo stickers for ANAVI Technology and KiCad, the free and open source CAD software we used to design the printed circuit board for ANAVI Macro Pad 2.
If you are reading this blog post, I am sure you are familiar with Raspberry Pi, the a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in cooperation with Broadcom. Unlike the recently released microcontroller Raspberry Pi Pico, all versions and models of the Raspberry Pi Linux computers do not include an analog-to-digital converter (ADC). If you need to read data from an analog device such as a potentiometer, sound or soil moisture sensor the solution is to use an external ADC, for example Microchip MCP3002.
Prototyping on a breadboard with Raspberry Pi 4, 10K potentiometer and Microchip MCP3002 ADC
Microchip MCP3002 ADC
Microchip MCP3002 is a 10-bit resolution dual channel ADC with SPI hardware interface for connecting to embedded devices such as Raspberry Pi. MCP3002 operates over a broad voltage range, from 2.7V to 5.5V. It is offered in 8-pin MSOP, PDIP, TSSOP and 150 mil SOIC packages. MCP3002 PDIP package is appropriate for prototyping on a breadboard.
Raspberry Pi and Microchip MCP3002 Wiring
Microchip MCP3002 has to be connected to the dedicated SPI pins (MISO, MOSI, SCL and SS) on the Raspberry Pi GPIO header. In the video a 10K potentiometer is connected to one of the two channels of the ADC for testing purposes. The potentiometer as well as Microchip MCP3002 are powered with 5V from the Raspberry Pi.
Microchip MCP3002 attached to Raspberry Pi 4 over SPI
Enable SPI
Boot Raspberry Pi OS, the official Debian based GNU Linux distribution by the Raspberry Pi, from a microSD card. Open a terminal and using the raspi-config tool enable SPI as shown in the video. After that reboot the Raspberry Pi and proceed to the next step.
Reading Data with Python
Python3 script for reading data from analog devices through MCP3002 is available at the rpi-examples repository in GitHub. The script relies on popular Python package RPi.GPIO. Open a terminal and run the following commands to clone rpi-example and run the script:
git clone https://github.com/leon-anavi/rpi-examples.git
cd rpi-examples/MCP3002/python
python3 adc.py
The potentiometer acts like a variable resistor. Rotate it and observe the output of the Python script. You will notice a change of the voltage between 0V and 5V depending on the position of the potentiometer.
ANAVI Garderning uHAT
Thanks to PCBway, the sponsor of this video, we can go to the next level and use a prototype of ANAVI Gardening uHAT as a Raspberry Pi add-on board with SOIC package of Microchip MCP3002. ANAVI Gardening uHAT follows the specifications of Raspberry Pi Foundation for HAT (hardware attached on top), including for an EEPROM with device-tree binary overlay configurations.
Prototypes of the new Raspberry Pi add-on board with Microchip MCP3002 ADC from PCBWay
Meet ANAVI Macro Pad 2! It is an open source, programmable two-key mechanical keypad with backlighting. Each of the keys on ANAVI Macro Pad 2 can be reprogrammed for use as a macro or even as a dedicated shortcut key, making it perfect for a number of applications across various industries.
ANAVI Macro Pad 2
ANAVI Macro Pad 2 runs on a Microchip ATtiny85, which is a reliable, low-cost, 8-bit AVR RISC-based microcontroller. It has a gold-plated printed circuit board, Gateron red mechanical switches, 3mm red LEDs and translucent keycaps.
Gateron red mechanical switches with 3mm LEDs on ANAVI Macro Pad 2
Only free and open source software tools like KiCad, OpenSCAD, and Inkscape were used to design ANAVI Macro Pad 2. Quantum Mechanical Keyboard (QMK) with V-USB is the default open source firmware. Source code and schematics are available on GitHub.
ANAVI Macro Pad 2 with stickers on the translucent keycaps of the mechanical switches
Recently, we added a brand new keymap for ANAVI Macro Pad 8 for Git users. Git is a free and open source distributed version control system started by the famous Linus Torvalds, the creator of Linux kernel. Nowadays, there are many offerings of Git repositories as a service by GitHub, GitLab, Bitbucket, etc.
The Keys
The Git keymap for ANAVI Macro Pad 8 contains the following shortcuts for Git. On the first row from left to right:
git status
git log
git pull
git push
On the second row from left to right:
git diff
git add
git commit
FN key to switch to the 2nd layout and control lights
ANAVI Macro Pad 8
How It Works?
From technical point of view for developers this Git keymap demonstrates a couple of interesting features of QMK firmware:
Using SEND_STRING in the Git keymap increases the total firmware size. This is dangerous because Microchip ATmega32U4, the microcontroller on ANAVI Macro Pad 8, may not have enough free space for it. If the firmware exceeds the size limit any attempts to flash it will fail with a similar error message:
The firmware is too large! 28866/28672 (194 bytes over)
If you run in such a use case, the easiest way to reduce the size of QMK firmware in a keymap for ANAVI Macro Pad 8 is to cut some of the default RGB lighting animations and effects. For example, as in the Git keymap, you can create config.h file in the keymap directory that overwrites the main config.h with a reduced number of supported RGB lighting animations and effects:
We have already covered in details how to install QMK firmware and how to flash a keymap from the command line in a previous blog post and in the user’s manual. Here is it in a nutshell for the Git keymap. Connect ANAVI Macro Pad 8 to a computer with USB to microUSB cable follow the steps below:
Execute the following command to compile QMK and the Git keymap for ANAVI Macro Pad 8:
qmk compile -kb anavi/macropad8 -km git
Execute the following command in a terminal to flash the git keymap:
qmk flash -kb anavi/macropad8 -km git
Press the RESET button on ANAVI Macro Pad 8 when asked:
Detecting USB port, reset your controller now.....
Wait until the firmware flashes successfully:
avrdude done. Thank you.
ANAVI Macro Pad 8 is available at our distributors Crowd Supply and Mouser. We are constantly trying to improve this open source project and we are interested in finding more distributors around the world. If you have any questions please do not hesitate to contact us.
In a previous update we shared the exact steps how to assemble ANAVI Macro Pad 8 Developer Kit. Now let’s have a look at the Maker Kit.
ANAVI Macro Pad 8 Maker Kit Soldering and Assembly Video Tutorial
The maker kit provides the printed circuit board (PCB) and an addressable LED strip. There are also some nice stickers. Other accessories have to be purchased separately. You can use any mechanical switches compatible with Cherry MX plate footprint and 3mm LEDs.
ANAVI Macro Pad 8 Maker Kit Unboxing
Furthermore with the maker kit you can perform a hot-swap upgrade of ANAVI Macro 8. It requires a very specific procedure which was explained in a previous article. If you have this in mind don’t solder anything and have a look at the other video tutorial.
Required tools for soldering of ANAVI Macro Pad 8 Maker Kit
The assembly of ANAVI Macro Pad 8 Maker Kit requires soldering and advanced skills. The following tools are required:
Soldering iron
Scissors
Optionally: screwdriver, tweezers and a keycap puller
It is also a good idea to stay safe and get a smoke absorber while soldering, for example our open source ANAVI Fume Extractor.
Please have a look at the video and follow the steps below if you have ANAVI Macro Pad 8 Maker Kit.
Solder mechanical switches to the PCB
Any type of mechanical switch compatible with Cherry MX plate footprint is suitable for ANAVI Macro Pad 8. The developer kit comes with Gateron mechanical switches. The maker kit allow you to use different brand and color.
Choosing the most appropriate switch for your needs and taste is a matter of personal preference. There are many different brands and colors. For example, the blue mechanical switches are more noisy which could be sometimes fun but also annoying during daily work. The red switches are fast and not very noisy therefore they are often proffered by gamers.
There are two pins on each mechanical switch that must be soldered to the printed circuit board. That makes 16 pins in total. The position of the each pin is very specific and the switch goes into the PCB. One of the pins is for the signal coming from the Microchip ATmega32U4 microcontroller, the other pin is for ground.
Solder 3mm LED
This step is actually optional depending on the the type of the mechanical switch. Some mechanical switches may not have a hole in the plastic enclosure for a 3mm LED.
Each 3mm LED for through-hole soldering has 2 legs. The longer leg is the positive terminal, also known as anode. The shorter leg is negative and also known as cathode.
The shorter leg that indicates the negative terminal must go into the square hole of the PCB. ANAVI Macro Pad 8 has 8 mechanical switches therefore 8 LEDs are required. If you want you can use different color of the LEDs. You can even mix colors.
Solder WS2812B addressable LED strip to the back of the PCB
Using scissors cut a little bit from both ends of the LED strip to make sure it will stretched when placed on the board. However it is tricky, be careful and make sure enough from the pads are available to make a good contact after soldering them.
It is very important to properly set the direction of the WS2812B LED strip. On the LED strip you will notice small arrows indicating the direction. They should point from the microUSB connector towards the other end of the PCB as shown in the video.
If you have successfully completed these 3 steps your ANAVI Macro Pad 8 should look just like a developer kit having all accessories soldered. Therefore the next steps are the same as for both the developer and the maker kit. Explore them at our previous blog post as well as in the user’s manual.
Thank you for using ANAVI Macro Pad 8 and for supporting this entirely open source project!
Out of the box, all kits of ANAVI Macro Pad 8 are powered by the popular open source QMK firmware.
ANAVI Macro Pad 8
QMK stands for Quantum Mechanical Keyboard and it is an open source community centered around developing various computer input devices. The project is hosted in GitHub. More than 1700 developers contributed to this open source firmware over the years. QMK supports more than 2000 keyboards and keypads brands.
Although QMK is very powerful and flexible, it might be a challenge to get used to it if you haven’t used it before. Over the next weeks and months, as part of efforts for increasing the documentation related to ANAVI Macro Pad 8, we will be rolling out updates related to QMK.
QMK Configurator loaded in a web browser with the default keymap for ANAVI Macro Pad 8
QMK offers several options to select, customize and flash a keymap for your keyboard:
Command-line interface – advanced but not very user friendly
QMK Toolbox – application for MacOS and Windows users
QMK Configurator – an online tool used for easily creating firmware files for keyboards supported by QMK.
You can use QMK on MS Windows, MacOS and GNU/Linux distributions. To get started with the QMK firmware please explore this tutorial from the official documentation and install all required software suitable for the operating system on your PC.
KiCad – free software suite for electronic design automation which as used to design ANAVI Macro Pad 8,
Kodi – for the free and open source media player application,
OBS – for the popular open source video recording and live streaming software,
Zoom – for the popular video communication software.
Over the time we plan to extend the list with keymaps for other popular software applications. Please feel free to submit your favorite keymaps for ANAVI Macro Pad 8 to the QMK repository in GitHub!
Compile QMK for ANAVI Macro Pad 8
After installing QMK software on your computer, from the command line you can compile QMK firmware with the default keymap for ANAVI Macro Pad 8 using the following command:
qmk compile -kb anavi/macropad8 -km default
Flash QMK on ANAVI Macro Pad 8
Follow the steps below to flash the compiled QMK firmware to ANAVI Macro Pad 8:
Connect ANAVI Macro Pad 8 to your personal computer with USB to micro USB cable
Execute the following command in a terminal to flash the default keymap:
qmk flash -kb anavi/macropad8 -km default
Press the RESET button on ANAVI Macro Pad 8 when asked:
Detecting USB port, reset your controller now.....
Wait until the firmware flashes successfully:
avrdude done. Thank you.
The heart of ANAVI Macro Pad 8 is Microchip ATmega32U4. It is an 8-bit microcontroller part of the AVR family. QMK relies on avrdude as the utility to download, upload and manipulate the firmware of these microcontroller.
Microchip ATmega32u4 on ANAVI Macro Pad 8
ANAVI Macro Pad 8 is available at our distributors Crowd Supply and Mouser. Please contact us if you are interested in wholesale orders or if you prefer shipping directly from the EU.
Please have a look at the video and follow the steps below to assemble ANAVI Macro Pad 8 Developer kit. Although you can do it with your bare hands, simple tools like a screwdriver, tweezers and a keycap puller might be useful.
ANAVI Macro Pad 8 developer kit comes with 8 Gateron mechanical switches and red leds. If you prefer another type of switches or color of the LEDs, please have a look at the Maker kit which requires soldering but allows to use different Cherry MX compatible switches or even make a hot-swap upgrade.
Step 1: Stickers
The first step optional. Each kit includes a set stickers. Feel free to add them to the translucent keycaps included in ANAVI Macro Pad 8 developer kit. You can do it with your bare hand or eventually with the help of tweezers.
You can place a sticker on the top or on the side of the keycap. If you like retro electronics you may find some similarities in this approach to the famous keyboard of the best selling personal computer of the 20th century Commodore 64.
ANAVI Macro Pad 8 is powered by the popular open source firmware QMK which allows you to create various layouts. You can make a keymap with 2 or more layouts. A sticker on the side of the keycap might be useful as a visual aid to indicate the additional function of the key.
Step 2: Keycaps
Place all keycaps on 8 mechanical switches of ANAVI Macro Pad 8. You can easily do this with your bare hands. It takes just a few seconds.
As you can see in the video a keycap puller might be useful if you make a mistake and want to pull off a keycap and place it on another location.
Step 3: Peel Off Protective Films from the Acrylic Enclosure
Peel off the protective films from both sides of the two laser cut transparent acrylic parts. The removal of the protective films is quite annoying but once you get rid of them, the acrylic enclosure will be crystal clear and fully transparent.
Step 4: Assemble the Acrylic Enclosure
Assemble the acrylic enclosures. In the cardboard box you also will find M3 black plastic screws, nuts and standoffs. Although you can assemble them with your bare hands a screw driver might be handy.
First place 4 of stand-offs with screws to the bottom acrylic part. After that place ANAVI Macro Pad 8 on top of them. The printed circuit board has 4 mounting holes for this purpose.
Add the rest of stand-offs on top of ANAVI Macro Pad 8 to secure the printed circuit board to the bottom part as shown in the video. Place the top acrylic part and fasten it with the 4 M3 nuts. Finally add the silicon protective pads on the screws on the bottom.
Step 5: Mini OLED Display
Step number 5 is optional. The default open source QMK firmware for ANAVI Macro Pad 8 support mini OLED display connected over the communication bus I2C.
By default mini display in yellow-blue 0.96″ I2C OLED. It comes with 4 jumper wires which might be useful for debugging purposes or if you plan to make a custom 3D printed case. However for the default acrylic enclosure the wires are not needed.
Peel off the protected film and place the mini OLED display as shown in the video to ANAVI Macro Pad 8. Pay attention to the labels that indicated the pin connectors of the display. They must match the labels on the keyboard.
Step 6: Turn On ANAVI Macro Pad 8
Gently plug a USB to microUSB cable to connect ANAVI Macro Pad 8 to a personal computer. Please be careful with the microUSB connector because a harsh bending of the USB cable may damage the microUSB connector.
Thanks to the QMK firmware ANAVI Macro Pad 8 will be detected as human interface device and should work out of the box. Furthermore with QMK you have the freedom to fully customize each key.
ANAVI Macro Pad 8
Please note that a USB to microUSB cable is not included in any of the kits. Reuse a cable from an old electronic device or purchase a cable according to your taste. Make sure that the cable supports both power and data transfer over USB.
Thank you for supporting and using our open source kits. Stay tuned for more updates, including details for soldering ANAVI Macro Pad 8 Maker kit.
Home Assistant is a popular open source platform for home automation. The installation is still tricky and a bit annoying but the nowadays updates are straight-forward and super easy. This article and short video tutorial provide the exact steps how to update Home Assistant operating system and core following the best practices.
How to update Home Assistant?
Updates bring new features, bug fixes and security improvements. Home Assistant is a platform focused on privacy. There are regular updates. If are following the blog posts and the social media accounts you can often read news about critical security updates. It is recommended to install them as soon as possible.
Step 1: backup the existing Home Assistant installation by creating a snapshot of the whole system. From the left menu go to Supervisor. Click the Snapshots tab. Select full snapshot for type and optionally set a name. Click the CREATE button. Wait for a moment until the snapshot is ready.
Step 2: read the releases notes for breaking changes coming with the latest stable version. From the left menu go to Supervisor. Click RELEASE NOTES for any available updates. Check all release notes between the version you are running at the moment and the one you are upgrading to. Use the search function in your web browser to locate the chapter for Breaking Changes.
Step 3: check your configuration. This can be done with Check Home Assistant Configuration add-on. If you don’t have it please first install as shown in the video.
From the left menu go to Supervisor. Select tab Add-on Store. Search for Check Home Assistant configuration. It is an official add-on. Click INSTALL.
After successful installation, click START. Go to tab Log, periodically click the REFRESH button and observe the log output. On Raspberry Pi the check takes about 10 minutes so don’t hold your breath and patiently wait the check to finish. If there are no errors proceed to the next step.
Step 4: Apply an update for the operating system if such is available. From the left menu go to Supervisor. Click UPDATE.
The Home Assistant Operating System is a minimal image that runs containers and comes with Supervisor to manage Home Assistant Core and add-ons. Once you hit the update button in the web interface, depending on your system and Internet connection speed, it will take a while until the update downloads and installs. Just wait patiently. As part of the update Home Assistant will restart so you will temporary lose connection to it.
Step 5: Update Home Assistant Core. After ensuring that you are running the latest stable version of Home Assistant Operating System proceed with updating Home Assistant Core. From the web interface hit the update button and patiently wait. It will again take a while depending on your system’s hardware and Internet connection. As part of the update Home Assistant will restart so you will temporary lose connection to it. After that you will be asked to login again. Congratulations, this the whole update procedure from the user interface. As promised is straight-forward and easy!
One more thing, if are an advanced user and for one reason or another you don’t like graphical user interfaces, it is also possible to update Home Assistant through the command-line interface. Just run in a terminal: ha core update.