Sunday, 10 May 2026

CH32V203 Big Round Button

Having successfully uploaded the Blink code to the CH32V203, the next task is to try the HID button demo.


The circuit I’m using has two buttons, connected to A2 and A3 of the CH32V203. 

The code for this can be viewed on my GitHub page. Right now I’m getting the chip to send a number 2 or a number 3 to the keyboard buffer. I’ll change that to the keyboard codes for CTRL+C and CTRL +V later on.

The circuit is mounted in to the case, with the two buttons fitted to the inner support.



The pusher and outer shell are assembled. There are holes for screws in the bottom, but for now the push-fit is enough.


There will be a couple of adjustments for the production version. I’ll need to move the hole in the shell up a bit to match exactly where the USB C socket is. I’ll also try widening the pusher by 1mm to reduce wiggle.

The last thing will be to gut some vinyl stickers for the top. I have these already from the BeetleBoard version of this button I made before. 


Adafruit QT Py CH32V203 Blink

I am working on a new project to make a big round COPY/PASTE button but this time with a USB C connector.

I previously made one of these using a BeetleBoard. But this time I need a cheaper microcontroller that has a USB C connector. When looking around, I came across the Adafruit QT Py CH32V203.

This is in a similar size to the BeetleBoard as well as the QT Py ESP32, which I've used for other projects. But the CH32V203 is much cheaper and has the ability to work as an HID and emulate a keyboard.


This a a really new product for Adafruit and subsequently support for the Arduino IDE is basic at the moment. I have eventually managed to get the IDE to accept the board and appropriate libraries to get a test program to compile. But it won't download directly from the IDE.

To upload code I needed to use the WCHISP Tool. The CH32V203 has a neopixel built in, and this comes with a default colour cycling program. But I want to do a traditional BLINK program, so I need to connect an LED as shown.

Here the shot-leg cathode is connected to GND, while the long-leg anode is connected to PA6, which is labelled MI on the board top and A5 underneath.

The code for blink is simple as normal, but needs to include the Adafruit_TinyUSB library.

To get the compiled code to upload, the CH32V203 needs to be put into bootloader mode. This is achieved by holding the BOOT button and the rolling over to the RESET Button for a moment, then letting go of RESET and then BOOT.


The WCHISP tool can then be used to flash the binary exported from the Arduino sketch to the CH32V203.






Monday, 6 April 2026

Exploring the PCA9685

I'm playing around with this  PCA9685 16-channel PWM driver from Adafruit.


I used one before in my FlatCat project, and I'd like to use one again in the new little robot I'm building which uses a QT-Py S3.

Power

I want to run the whole robot from a single battery pack, so I need to figure out how to do that right. FlatCat needed two separate power supplies - a set of four AAA cells for the servos and a separate USB Phone charger for the Arduino.

The image above shows the PCA9685 connected to an Arduino UNO - and it appears to be running the servos and the UNO of the same power from the V+ terminal, with power for the UNO being provided through the VCC terminal.

I have connected my 4.5v battery pack to the PCA9685 for a test

I have 4.5v across the screw terminals, and between GND and  V+ on the edge, but nothing on the VCC - so there's no power regulator on the PCS9685, so I can't use that pin to send power out from the PCS9685.

Here is an option using the built-in STEMMA connector on the QT-PY S3.

This runs a V+ power output from the PCS9685 to the QT-PY's +5V pin - or, even better, to the BAT pin on the rear of the QT-PY, which DOES have a voltage regulator.

The STEMMA interface cable includes GND, SCL, SDA and VCC, which can be connected to the corresponding terminals on the PCS9685.So this OUGHT to work.

What I don't have is the STEMMA cable - So I could make the connection like this instead.



PCB

Here's the PCB I designed for this.



Tuesday, 27 January 2026

Animated SVG Images

I have been revising my very basic understanding of web design recently - apparently I have to deliver a course on Web Development to some BTEC students - so it will be me one page ahead of them, or a quantum leap behind those who actually know what they are doing.

Anyhow, I was reading up about SVG vector files and how to embed them directly into the HTML code. The SVG format is XML text, and it's possible to generate simple images directly in the web code, or make more complex images in Inkscape or Adobe Illustrator and then open the file in a text editor to copy the code into the web page.

I have been using SVG Viewer to work directly with the code created in Inkscape, and I have found the the native Inkscape format includes additional code that's not required in the web page.

I drew a little cute red robot in Inkscape that looks like this as a PNG;

I thought it would look good with some moving gears behind, so I used the Gears extension to create some behind the image

Animated SVG

The trick is to identify the group of a particular object in the code - usually beginning with "<g id="qt1"

<animatetransform additive="sum"
attributename="transform" attributetype="XML"
dur="10s"
from="0"
repeatcount="indefinite"
to="360"
type="rotate">"

 

Handy Box

I have built a small robot using the Adafruit QT Py ESP32-S2. The project is called HandyBox as originally I had laser-cut some cartoon hands for the robot to wave, but I realised having it peep open and shut quickly would be more fun.




The box broadcasts its own WiFi SSID that can be found with a mobile phone. I have printed a sticker for the top that has a QR code to scan to specifically lock onto its SSID.

Once locked on, the web browser can be directed to 192.168.4.1 to see a web page.


Closed screen

When the green button is pressed, the servo slowly raises the lid. The web page changes as shown below.


Open screen

Circuit

The circuit is shown below.
The servo is connected to A3, while the LED is connected to A1.
The battery provided power to the 5V line, and the internal power regulator set that to the required 3V. The battery also directly powers the servo.




The battery and servo fit inside the lower section of the box, while the ESP32 and LED are fitted in the top, along with the power switch.


It's not the most tidy wiring I've ever done, but it does the job.

Video

Here's a video of the robot in action. It has a pleasing snap when closing.



Source Code

The Arduino Source Code for this project can be found at https://github.com/Bibbleycheese/handy-box/blob/main/Handy_Box_3.ino




Monday, 19 January 2026

Animating SVG embedded in HTML

 I'm learning how to embed SVG into HTML code - So I've created the following..


Welcome to The Internet

The Internet is online

DO NOT DROP THE INTERNET

Tuesday, 13 January 2026

Raspberry Pi Web Server

I need a local web server for some students to try building some of their own websites on. The college network is well locked down, so I'm building a local server which should work inside the college network.

I've dug out one of my very old Model A Raspberry Pi machines. It has only a 4gb SD card, so I need to install a very minimal 32-bit OS on it.



Following the instructions at https://www.raspberrypi.com/documentation/computers/getting-started.html, I have installed Raspberry Pi Imager to my PC and run that, choosing to install the legacy 32-bit command line version.

Having set up the SD card, I have booted the Raspberry Pi and used ifconfig to see the IP address of the device, which on my network is 192.168.1.198.

This R-Pi is too old for the new RPi Connect software to work. But I should be able to open a command line on my PC and use SSH to connect.

First, I need to follow the instructions at https://www.raspberrypi.com/documentation/computers/remote-access.html#enable-the-ssh-server to enable the SSH server.

Next, in my command prompt, I type ssh <username>@192.168.1.198. That allows me to connect to the Pi through the terminal.

Now, in the terminal,

sudo apt-get update

Now change to the etc folder - cd /etc

Install Apache

and use Nano to edit the name of the server - in this case, I'm following the instructions at https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/raspberry-pi-as-a-lamp-server, and the host is named lamppi

sudo nano hostname

Add a localhost entry for my IP address (e.g. 192.168.1.198 localhost)

Add an entry for my chosen server (e.g. 192.168.1.198   lamppi)


Now I restart the Apache web server with ...

sudo service apache2 restart

Now on my PC web browser, I go to 192.168.1.198, and the following displays.




CH32V203 Big Round Button

Having successfully uploaded the Blink code to the  CH32V203 , the next task is to try the HID button demo. The circuit I’m using has two bu...