Introduction: Making My Smart Gantlet
Today I will guide you through the process of building a forearm leather armor piece, with a small onboard computer (Raspberry Pi) and a small 1.8 inch display. This project is inspired by sci-fi movie/series or video games, especially the Pip-Boy from Fallout, aswell as the time machine from a French webseries called Le visiteur du Futur.
Mainly what this does is it displays time, and receives notifications from a smartphone via Bluetooth.
I always wanted to try leather working, this is my first leather working project, and it also includes electronics, software development and metal working.
You can also find this project on my blog.
For this project I used the following material :
- Vegetal leather bits, bought at a local shop, ~10€/Kg
- Plumbing copper tubing from the hardware store, ~3€/tubing
- a Raspberry Pi 0 W, (can be found here for instance)
- A 1.8 inch SPI driven TFT display (can be found here )
- some basic electronics components such as LEDs, buttons, wirings, ... (under 15€)
- a 2.5Ah powerbank (~10€)
- Some wood to make a knob
I used some tools, some of which are required, some of which I used out of convenience :
- A sewing machine, I used an old Singer machine. This machine is not meant for leather working, if you decide to use your sewing machine on leather, handcrank it slowly and DO IT AT YOUR OWN RISK, you may bend/destroy needles, or loose machine settings.
- Leather working tools, such as Punch, big needles, waxed thread, ...
- For metal work : pliers, hammer, wise, Drill Press, Dremel
- For electronics : soldering iron, wire, ...
- Camping stove for soldering the copper casing
Step 1: Main Leather Piece
The first step consists in cutting the leather to the appropriate dimension. I started by finding the correct size by trial and error with a piece of paper around my wrist, then reported it on the leather and cut it out.
Then I added buckles by stitching two leather strips to the main leather piece, and adding small pieces of brass as pins. Note that the first brass pins where too short and I ended replacing them with bigger ones.
Step 2: A Rotary Selector
I needed to fit 4 big parts on the main leather piece :
- Raspberry Pi
- Display (on top) (interface OUT)
- A rotary selector (interface IN)
For interacting with the Pi I used a small rotary encoder, with a click. This is very robust and simple, and allows to select an item in a list and then validate by clicking on it. The component itself was a little to high to fit nicely in the gantlet so I offset it by cutting a square hole in the main leather and sewing a small leather patch on top of it ; thus moving it one leather thickness further up.
Step 3: A Pocket for the Pi
I wanted to have no visible wirings, so I put the Raspberry Pi right under the display. I sewed a small leather piece to the main piece, to fit the Pi's size. Because I wanted it to mainly bend on the outside I sewed it pre-bent on the outside.
I did a few tension tests first, since the machine isn't mean for that thick leather. The sewing machine has a foot pedal but I didn't use it and instead hand-cranked it to punch the holes very slowly and avoid breaking the needle.
After that I was already able to connect the rotary encoder (we'll get back to schematics later), and mount it on the gantlet.
Step 4: A Casing for the Display
I wanted to mount the display into a metal casing to be attached on top of the main leather piece. I want it made of copper sheet, but it turns out this is note quite that easy to find at the hardware store, especially in small chunks (I didn't want 1m² of copper). I finally bought some copper tubings, cut, unrolled and flattened them. Because they were too small I hade to make two halves and solder them together, with an angle to match the curvature of the Pi's pocket.
Them I made 3mm holes all around the border to sew later, and them soldered them together. I first soldered the two pieces together, and then cut a hole for the screen. But i broke the solder, and I had to cut the hole out then solder it again.
I first wanted to use a big 100W soldering iron to solder the parts, but it turned out the copper would dissipate more heat than the amount brought by the soldering iron. To solder the parts together I eventually held the parts in place with wire, heated everything with a camping stove and soldered everything in place with soldering tin.
Step 5: Electronics and Wiring
I then developed a super basic testing software to test the screen (we'll get back to software), which allowed me to check that the screen was working. I also added the LEDs, and tested them aswell.
If you check the schematics you'll notice a PNP transistor, which is used as a high-side switch for the screen backlight. The backlight of the TFT display is driven by a 'LED' pin accepting up to 5V and controlling the backlight. I could have connected it to the Pi's 5V rail directly but I wanted to be able to turn the screen off from the Pi to save power. The GPIO pins of the Pi output 3.3V and the current draw (at 5V) on the LED pin of the display was above what the Pi could safely deliver through the GPIO. So I built a high-side switch with a 2N2905A PNP transistor, and since it looked cool, I had it stick out through the casing. Note that the display's backlight supports driving through PWM which allows setting brightness.
Step 6: Stitching the Casing to the Leather
The main problem with the casing was fitting the cables inside the small space. To avoid the mess the best option was to use some IDE cable, and cut a slot to the Pi's pocket. I stitched the casing with thick waxed thread, on the up and bottom sides, but I couldn't stitch the 2 other sides as I initially planned because of the pocket beneath the leather.
You may also noticed that I have the glass window to protect the screen. I didn't want to use acrylic or plastic because it doesn't look good so I cut out glass from an empty instant coffee pot. I have no pictures of this because it failed several times (I first tried thermal-shocking the glass but it shattered - I eventually cut the glass with my dremel and a diamond cutting wheel). I wouldn't recommend using glass if you don't have the right tools and protection equipment, because cutting glass with a diamond wheel creates a super thin - and probably dangerous to breathe - dust, even when trying to neutralize it with oil or water. I glued that window in place with some heavy-duty glue.
I also made a wooden knob for the rotary selector, locked in place with a brass nail.
Step 7: Software Development - Work Setup
It's now time to talk about software development for this project. This project requires software development but I mainly started it because I wanted to work with leather ; this is why I didn't spend much time on the software compared to the rest of the project (especially considering I studied software development and this is the part of this project where I know what I am doing).
Hardware Design choices
I chose to use a raspberrypi to speed up the development process. This might not be the best choice, for instance it might have suboptimal power consumption compared to smaller devices. But I wanted the development process to be as simple as possible, and I wanted to have some processing power and memory to do things such as advanced graphics, vectorial fonts, ... which would probably have been harder on smaller devices. In fact, the screen is 128x160 pixels, with 16 bits per pixel color depth (5-6-5 format), resulting in one screen buffer using about 40KB of memory. While this would have been possible on other devices (some arduinos, ESPs, ...), using a linux system makes the development process almost seamless between the Pi and my computer. This allowed me to develop a simulator for the GUI development.
I developed on the Pi directly, connecting via a WiFi hotspot created on my computer. Then I ssh'd into the Pi, this is handy to run the applications directly without the trouble of cross-compiling, transfering the code, running it,... While it avoids this burden, it lacks power to run vim with all plugins. To match my typical workflow, I used sshfs to mount the remote directory on my Pi to a local working directory on my computer. Also because Git relies only on the filesystem it can be used seamlessly on the remotely mounted directory (aswell as all git wrappers).
Finally, the software is written in Python and C (C code for handling low-level peripheral access mainly) the Python code can be run seamlessly with a simulator, this speeds up the development process a lot.
Step 8: Software Development - Design Choices
Software design was heavily influenced by the human interfaces available on the device. The screen supported 16 bits per pixel color depth, over a 128x160 pixels screen. The input method supports only scrolling in two directions and validation of choice. This is a very specific interface, not often used in end-user devices, it is for example more common for heavy-duty public machines such as public transportation ticket vending machines. This means that all classical GUI paradigms (mainly touchscreens and point-and-click inputs) dot not work. Thus, no need for a library handling button or widgets, I used a low-level graphical library : PyGame, an SDL-based graphical library. To display the rendered image, on the Pi I extract the raw buffer, and send it to the screen via SPI, while on the computer I display it on a window, this is how the simulator works.
The devices supports communication with a smartphone over BLE (Bluetooth Low Energy). For using the Raspberry Pi as a BLE peripheral I used the PyBleno library, because Raspberry Pis are typically used as BLE centrals rather than peripherals (more about BLE here). Then I developed a test application for android.
While most of the code is written in python (especially the GUI handling) the code interfacing with the hardware is written in C, for instance the SPI driver I used is this the TFT_ST7735 that can be found here. The interfacing with Python code is done with Boost.python, which allows to call C code from python, and also set up callbacks for asynchronous operations. For instance I set an interrupt callback when the rotary selector is scrolled, which itself triggers code in python. This allows for efficient usage of the CPU time because there is no polling for the pins status.
Step 9: Give It Some Power
The power source I used is a 2.5Ah powerbank which I opened, removed unnecessary components (such as the output USB ports), and packet into a dedicated pocket on the main leather piece.
To charge the device I left the micro-B input port of the powerbank to stick out of the pocket, and stitched a small flap to cover it when not in use. I tried this with the sewing machine but it failed so I eventually hand-stitched it and it worked fine.
After making sure everything was working as expected I stitched the pockets close, and the project was complete !
Participated in the
First Time Author Contest