Home Blog Page 11

Meet Bittle, an Advanced Open-Source Robot Dog by Petoi

This is Bittle, a ready-to-run advanced open-source robot dog by Petoi that is based on the OpenCat robotic pet framework.

If you’ve ever wanted to explore building your own robotic quadruped, but have felt overwhelmed by the amount of information and options available or have been at a loss with where to start, then Bittle is the perfect product for you. So in this review, we’ll take a look at what Bittle is, how it works and what it can be used for.

Have a look at my video review to see Bittle in action, or read on for the written review:

Where To Get Bittle

Bittle is primarily available for purchase online through Petoi’s website or their Amazon store and comes in three packages:

  • Base Kit – Includes all of the parts required to assemble your own robot dog
  • Pre-assembled Kit – All of the components included in the base kit, but pre-assembled and ready-to-run
  • Developer Kit – The pre-assembled kit with 10 replacement servos and an extra battery pack

Petoi have sent me the pre-assembled kit to try out and share with you, so that’s the kit that we’ll be taking a look at in this review.

What’s Included In The Box

The base kit comes in a branded box with clear protective inserts to hold the included components in place.

Bittle Packaging

Included is Bittle, along with a battery pack with an integrated charging circuit, and then an accessories kit.

Inside Bittles Pre-assembled Kit Box by Petoi

The accessory kit includes an infrared remote, a spare servo and some screws, a calibration tool, a small screwdriver and a pack of modules that allow communication with Bittle. These modules include a USB programming module, a Bluetooth module and a WiFi module.

Included Accessories With Bittle

Assembling Bittle

If you’ve bought the base kit then you’ll need to do some assembly work before you can start using Bittle, including making up the legs, mounting the servos in place at the joints and connecting the wiring through to the control board that makes up Bittle’s body.

Bittle By Petoi Packaged

If you’ve got the pre-assembled kit, like I do, then you’ll just need to snap the head into place and plug in the battery. You’ll also need to move the servos to the correct starting position as they’re packed with the joints bent in the opposite direction to make Bittle more compact.

Preparing Bittles Legs For Power Up

The body and components feel like they’re well made and are good quality. Part of what makes this robot dog look great and function so well is that they’ve taken the time to design and manufacture custom parts – like the servo arms that have been specifically designed to join the leg components with the inclusion of a spring to provide a bit of shock absorption.

Bittles Servo Joints

Controlling Bittle With The Infrared Remote

Once assembled, the included 21 button IR (infrared) remote allows you to start playing around with some of the core functions of Bittle right away. It’ll allow you to walk, run, turn and do a couple of pre-programmed skills right out of the box using a small infrared receiver on Bittle’s back.

Included IR Remote Control

The arrow keys control Bittl’s walking/movement directions along with speed settings and 11 skill buttons allow you to execute some of the pre-programmed skills.

Getting the first movement out of Bittle is as easy as plugging in the battery pack and then aiming the remote at his back when you press one of the buttons.

Here’s Bittle waving hello…

Bittle Waving Hello For The First Time

Exploring Bittle’s Control Board

Once you’ve tried out Bittle using the IR remote, you can either dive right in to coding your own skills or you can download the mobile app (for iOS or Android) to unlock some additional functionality, including calibration and customized commands. Either way, you’ll need to remove the black cover on the top to get to the control board to plug in one of the communication modules.

Under the cover is a custom-designed controller called NyBoard with an integrated Atmega328P chip, PCA9685 PWM servo driver, MPU6050 motion sensor, an infrared sensor and a number of ports and interfaces to add sensors and devices to.

Nyboard, Bittle's Control Board

There appears to have been some revisions made to this board as some of the versions I’ve seen online have a row of RGB LEDs along one side. The core functionality however seems to be largely the same.

NyBoard Controller

I really like that they haven’t trimmed this board down to only suit the functionality and IO that the standard Bittle configuration requires. Leaving additional servo outputs, I2C interfaces and digital IO ports gives you a lot of options to build upon the basic design and make your own modifications and additions to the robot dog. This along with the open-source software means that you’re getting a development platform to learn on, build upon and explore, rather than just a finished product that you’ll probably get bored with after a couple of weeks. Part of the fun in building your own quadruped or robotic pet is that you never really finish it, there is always something else you can add, tune or modify and Bittle retains this – being a platform to build upon rather than just being a finished product.

Coding Routines, Skills And Features

Coding is best done through the Arduino IDE, and you’ll need to use the included communication module to allow your computer to program Bittle. This allows you to plug Bittle into your computer using the included micro-USB cable.

Plugging In The USB Programmer and Cable

If you’re not comfortable with the Arduino IDE, you can use Python as an alternative. They even have a drag-and-drop coding interface for beginners. So there really is something for every level of experience.

Bittle's Drag and Drop Programming Interface

Their documentation is really good and covers everything you may need to do to use and maintain Bittle as well as documentation and instructions for adding your own sensors, skills and features.

Coding New Skills On Bittle Using The Arduino IDE

Calibrating Bittle’s Leg Positions

In Petoi’s documentation, they mention that the pre-assembled kit is only coarsely tuned. So they recommend running through the calibration process for best results. I’m going to run through the calibration sequence using their iOS app. To use the app, I need to plug in the Bluetooth communication module to allow my phone to communicate with Bittle.

Installing The Bluetooth Communication Module On Bittle

To help out with the calibration process, I also 3D printed their stand with the calibration arms built into it.

We can then open up the app to pair Bittle to the phone and start the calibration process. If you head over to calibration mode, the legs will move to their calibration positions and you can then make adjustments to their positions.

Bittles Legs In Calibration Mode

Course adjustment is made by removing the arm from the servo and aligning it as best you can. You’ll need to remove the screw that holds the servo arm to the servo in order to remove it.

Course Calibration Adjustment

Fine adjustment is then done in the app until Bittle’s legs are at perfect 90-degree angles, by aligning the legs with the stand or with the included calibration tool.

Using The Calibration Tool To Check Bittle's Legs

You can select each join in the image at the top of the screen and then make adjustments to it using the + and – signs. It’ll only let you just the servo between an upper and lower limit before asking you to rather make a course adjustment.

Fine Calibration Adjustment Using The App

The stand is also useful for trying out new movements and testing commands without having to worry about where Bittle is going or if it’s going to fall off your desk.

Working On Or Repairing Bittle

All of Bittle’s components either screw or snap into place. So it’s super easy to take apart if you need to swap out a servo, change a spring or make changes to the wiring or control board. You just need a screwdriver and you’re good to go.

Replacing A Joint Servo

If you’re doing a lot of work on it then you’ll want to get a better screwdriver than what’s included with the kit as it’s a bit small and cumbersome to work with.

The wiring is also all held in place and partially hidden by snap-on covers over the legs. These help ensure that they don’t interfere with the joint movements and also keep Bittle looking neat.

Using The iOS App To Control Bittle

We’ve already paired the app with Bittle in the calibration process, so now let’s try some customized commands. Bittle has a number of controls and skills that are preprogrammed, these can be set up to run individually or as part of routines using text inputs through the app or the Arduino IDE.

So let’s try one of them. The code to look or check around is ck, so we type in kck to run the command and we can give the quick command a name “Look Around”.

Using Text Commands To Control Bittle

We now have a quick button to look around, which he’ll do each time we push the button.

Creating Custom Butttons For Bittle In The App

We can try commands that aren’t available through the infrared remote, like play dead, or march on the spot. We can also string commands together to create routines and behaviour sequences.

Bittle Playing Dead

The onboard IMU knows the orientation of Bittle, so if he stumbles or falls over, it will automatically activate a routine to flip him back over and onto his feet.

Bittle seems to manage quite well on most flat surfaces. It walks best on surfaces that are a little bit rough, like wood or concrete, but struggles on very uneven or loose surfaces like stones, sand or pebbles.

You can also use the IMU to allow Bittle to balance on uneven surfaces or when pushed or bumped.

Bittle Balancing When Being Pushed Externally

Final Thoughts on Bittle

Petoi have clearly put a lot of time and effort into creating a good quality product that is great for a range of experience levels. If you’ve never programmed anything in your life, you’ll still be able to get started with the basic drag-and-drop interface, and the open-source code allows experienced programmers to make any changes they’d like to build upon and improve Bittle.

They also have a number of external sensors already available and are working on some additional ones to add functionality to Bittle.

Additional Sensors Like Camera Vision For Object Tracking

These include sensors like obstacle avoidance and object tracking through a smart camera. So definitely check out the sensors if you’ve already got your own Bittle, and visit their web store if you’d like to get your own robot dog or cat.

Let me know what you think of Bittle in the comments section below and let me know if you have any project ideas that you’d like to see me try out with him.

Bittle Waving Goodbye

128 Cores for AI Vision Projects, the reComputer Jetson-10

Today we’re going to be looking at the reComputer Jetson-10, a palm-sized AI computer that can recognise people, animals and objects, while still being efficient enough to run on a battery pack.

reComputer Jetson-10

The reComputer Jetson-10 is a new product by Seeed Studios, that consists of a palm-sized aluminium case that houses a passively cooled NVIDIA Jetson module. The module runs on their custom carrier board that is designed for AI application development and deployment. They have sent me their H0 model which runs a Jetson Nano module with 128 NVIDA CUDA cores that can deliver up to 0.5 TFLOPS of computing performance. It’s also got a Quad-core ARM A57 CPU running at 1.43 GHz, 4GBs of LPDDR4 RAM and 16GB of EMMC storage.

Here’s my unboxing and testing video, read on for the write-up:

Unboxing And First Look At The reComputer Jetson-10

The reComputer Jetson-10 comes in a matt black box within a branded sleeve. The packaging is really good, with branded foam inserts to protect the reComputer and to divide the box into two compartments.

Branded Foam Inserts

Included in the box along with the reComputer Jetson-10-1-H0 is a 12V, 2A power supply with some options to suit a variety of international power outlets. Mine came with two euro adaptors, which I assume was a packing mistake.

Included Power Adaptor With Plugs

The case is a really minimalistic, aluminium design with three plain sides and all of the ports on the back.

Seeed Studios reComputer Jetson-10

On the bottom it’s got large ventilation holes around the edges and four slotted mounting points so that it can be mounted onto a wall for deployment.

Jetson-10 Underside

One of the sides features rubber feet so that it can stand horizontally or vertically on a desk or table. If you’re running intensive applications then it’s probably best to position the reComputer on its side as this allows the hot air to rise up through the ventilation holes.

reComputer Jetson-10 Standing Up

On the back, there is a bit of variation depending on the model, but the Jetson-10-1-H0 has got a 12V power input, HDMI and display ports, 4 USB 3.0 type A ports, gigabit Ethernet and a microUSB port which is for recovery and flashing the onboard storage.

Ports on Back of reComputer Jetson-10

The top is my favourite part of the case design. It’s clean and unsuspecting, but to access the Jetson module, you just push up on this silver rod hidden by one of the vents and this pops the magnetically latched top cover off.

So it’s super easy to access the Jetson module to connect a camera or use the GPIO, you don’t even need to use a screwdriver. The four magnets hold it in place very well, you really can’t tell that the top cover is held in place magnetically and isn’t screwed or snapped into place.

Under the top cover, you’ll see the large passively cooled heatsink on the Jetson Nano module that’s seated in the custom carrier board.

Jetson Nano on Seeed Carrier Board

The board has a wide range of IO, some of the nice additions are support for PoE (Power over Ethernet), an optional 4-pin fan plug, control and UART pins. On the bottom of the carrier board, you’ve got a M.2 M Key slot and an optional battery holder to supply the onboard RTC (real-time clock) module.

Underside of Carrier Board

Preloaded Software On The reComputer

Now that we’ve had a look at the hardware, let’s plug it in and try running some software on it.

It comes preloaded with NVIDIA’s JetPack SDK, so it’s ready to plug in and boot up right away. The JetPack SDK includes the Jetson Linux Driver Package running on a Linux based operating system (Ubuntu) as well as CUDA-X accelerated libraries and APIs for deep learning, computer vision, accelerated computing and multimedia.

NVIDIA JetPack Software

Through JetPack, the reComputer can run a wide range of fairly complex AI systems like full native versions of machine learning frameworks like TensorFlow, PyTorch and MXNet. So you can use it for things like people, animal and object recognition, for smart systems like traffic control and vehicle detection and even in manufacturing and logisitics.

Running Neural Networks on the reComputer

NVIDIA have really good documentation and a great introductory series of tutorials to get started with AI and computer vision.

Hello AI World NVIDIA Jetson

The tutorials use a number of TensorRT-accelerated deep learning neural networks, which you’ll need to build from source code. This process is all explained in detail and in doing so you’ll learn a lot along the way.

I’ll show you some of the cool things that you can do on the reComputer once you’ve worked through them.

Object Recognition Using ImageNet

The first neural network that I’m going to show you is one that does object recognition, and we’ll start off with a still image. We’ll send a neural network called ImageNet the still image and it’ll then use TensorRT and the imagenet class to recognise the object in the image. It’ll then overlay the classification result and it’s confidence level for the result onto the image.

The package comes with a few sample images to try out, so if we run this on one of the sample images and then go to the image output folder, we can see that the reComputer is 99% sure that this is a banana.

Still Sample Image Object Recognition Banana

So it’s pretty confident that it’s got this one right.

I don’t like using sample images as they’re generally chosen so that the system generates good results, so I also tried this network on three of my own images as well. I used a picture of an elephant, one of my dog and one of the Sydney harbour bridge.

My Sample Images For Object Recognition

One thing I did notice when running these images is that they were much slower to process. This is because I sent the full-size original images to the program and not reduced resolution images like the sample images. You’ll notice this with the result text size as it’s now much smaller than the image.

So ImageNet is 62% sure that this is a tusker, which is sort of on the right track, although this elephant is missing its tusk on the camera side.

Tusker Sample Image Object Recognition

It’s also 56% sure that my dog is a Toy Poodle. I think this confidence is a bit low because there are a few different poodle type dogs that it has been trained to recognise and they’re all quite similar.

Toy Poodle Sample Image Object Recognition

And finally, it’s 73% sure that this is a steel arch bridge. So it got all three of the objects correct in the still images.

Steel Arch Bridge Sample Image Object Recognition

We can also pass the program a saved video or a live video stream and it’ll do the same thing in real-time. To do this we obviously need to add a camera to our reComputer Jetson-10, so let’s plug that in first. You can use a CSI camera like the official Raspberry Pi camera module or use a USB camera. I’m using a CSI camera for this example.

CSI Camera Connected To Jetson Nano Module

So if we try this out on different objects on my desk, you can see that we’re getting an ImageNet overlay telling us what objects have been detected in the image as well as their certainty. So it’s 98% sure that this is a teapot.

Teapot Certainty Live Object Recognition

It eventually decided that the broccoli wasn’t a green lizard (better demonstrated in my YouTube video) although it wasn’t very confident in its decision.

Broccoli Live Object Recognition

You’ll also notice that a warning popped up when this live feed started saying that the heatsink is hot and shouldn’t be touched. So it was getting quite hot when running this neural network on a live video stream with a screen recording utility running in the background as well. It’s still quite impressive that the Jetson Nano is able to run this neural network at around 50-70 frames per second while also capturing the screen contents.

It was also able to recognise a keyboard, a pair of sunglasses and my MacBook.

Another interesting thing to look at is the data in the terminal during or after the network has been run. It displays information on the classes that the network thought were most applicable to the sample frame, along with its confidence level in each. It also displays the most likely object and its associated confidence level.

Terminal Text Showing Classification Certainty

Object Recognition and Location with DetectNet

To actually use this object recognition functionality in a project, there is another network called DetectNet that’ll also give you the location and size of the object detected in the image.

Object Detection Running On Live Feed

So with this information, you could then build something like a robot car that follows a certain object, like your dog or cat, or a counter that keeps track of birds or certain wildlife visiting your garden etc..

Pose Estimation Using PoseNet

The next network that I had some fun with is one that does pose estimation on people, or just their hands, called PoseNet. This neural network estimates the position of joints and body parts and again can be run on still images, videos or a live video feed.

Pose Detection Running On Live Camera Feed

This is really useful for building robots or machines that accept gestures as inputs, like AR or VR systems or can be use to build systems that monitor human behaviour, like counting people who are sitting or standing or estimate which direction people are walking in.

Pose Detection On Hand Running On Love Feed

So there are just some of the basic computer vision systems that you can run on the reComputer Jetson-10, but they should give you a good idea of the capability of the system.

Power Consumption of the reComputer Jetson-10

The last thing I wanted to have a look at is the power consumption. The reComputer comes with a 12V, 2A power adaptor that you’d use if you have it plugged into a permanent or non-portable setup.

Running from the power adaptor with its standard configuration, it uses around 2-3 watts when at idle on the desktop with no applications open.

Power Consumption Running Idle

It uses around 8-10 watts when it is heavily loaded – running one of the object recognition models I’ve shown you previously along with a screen recording utility.

Power Consumption At Full Load

8-10 watts is fairly low for a device running on mains power, but at this power consumption, you’d work through a set of batteries quite quickly. This is obviously not ideal for building robots and portable devices, so JetPack has a settings option that allows you to switch the Jetson module to a 5W low-power mode.

Switching JetPack To 5W Low-power Mode

In this mode, the power consumption of the module is limited to a maximum of 5W. So if I turn this on through the toolbar, the power consumption drops.

Power Consumption At Reduce Power Mode

Mine dropped to around 6W. This is probably higher than the 5W stated as I’ve got a keyboard, mouse and flash drive plugged into it as well. If you switch to low-power mode, you’ll also notice that the frames per second drop with the reduction in power. So this power reduction comes at the expense of performance, but still allows about 20-30 fps to be processed and you’ll get an improvement in battery life. So, depending on the project, this might be a suitable option for your application.

Final Thoughts

I’ve really enjoyed trying out the reComputer Jetson-10 over the past two weeks. It’s a neat, ready to run solution that would look right at home on your desk, but still has the versatility to be used in an actual project.

The magnetically latched lid makes tinkering with the carrier board or Jetson Nano a breeze, so it’s definitely one of my favourite features.

Top Cover Popped Open

I think they could have possibly included an optional fan, as the Jetson Nano did get quite hot during my testing. This was running “flat out” though with a neural network running continuously and a screen recording utility capturing the display contents, so this is probably a worst-case scenario.

The reComputer Jetson-10 is fantastic for getting started with neural networks and deep learning on computers. Be sure to have a look at Seeed Studio’s product page and check out their store for loads of other tech and electronics products and project inspiration.

Let me know what you think of the reComputer Jetson-10 in the comments section below and let me know if there are any computer vision projects that you’d like to see me try out with it.

Raspberry Pi CM4 Cluster Running Kubernetes – Turing Pi 2

Today I’ve got an exciting package to share with you, it’s the new Turing Pi 2 which the guys at Turing Machines have sent me to try out and share with you. So a big thanks to them for making this project possible.

This is the successor to the original Turing Pi, and if you’re wondering what a Turing Pi is, it’s essentially an all-in-one solution for creating a compact Raspberry Pi cluster, without the hassle of sourcing power supplies, cables and network adaptors, and then finding a way to connect them together. Something that I know all too well from my last cluster build.

Unboxing The Turing Pi 2

All of the components required to build your ARM cluster are built into a single board. The original allowed 7 Pi Compute Module 3’s to be clustered together. While this new board has a number of improvements and upgrades over the original, the most significant being that it’s designed to use the newer Compute Module 4’s, so it’s a lot more powerful.

Here’s a video of my unboxing and assembly of my Turing Pi 2 cluster, read on for the write-up:

What You Need For This Project

First Look At The Turing Pi 2

Now that you have a rough idea of what the Turing Pi 2 is, let’s take a closer look at the board.

The Turing Pi 2 has 4 SO-DIMM slots that can each accommodate either a Pi Compute Module 4, through an adaptor board, or a NVIDIA Jetson module.

4 SO-DIMM Slots For CM4 or Jetson Modules

It’s Mini ITX design means that it’ll also fit into standard ITX computer cases.

It’s got an onboard managed gigabit ethernet switch that networks the 4 slots and makes them accessible through one of the two onboard Ethernet ports.

Onboard Gigabit Ethernet Controller

An onboard management controller manages things like fan speed through a J17 connector, interface buttons and LEDs, as well as power to each slot.

Onboard Management Controller

Each slot also has some additional interfacing associated with it, so you’ve got HDMI, GPIO and a mini PCIe port available to slot 1, a mini PCIe port available to slot 2, two SATA III ports available to slot 3 and four USB 3 ports available to slot 4.

Turing Pi 2 Layout

If you’re going to be using CM4 modules, like I am, then you’ll need to use these adaptor boards to be able to plug them into the SO-DIMM slots.

CM4 Adaptor Board

These adaptor boards also have onboard SD card slots, which you’ll need for the operating system image if you’re using a Compute Module without onboard EMMC storage.

Preparing The CM4 Modules

If you can source the right CM4 modules, you can theoretically create a 16 core cluster with 32GB of ram. Unfortunately, CM4 modules are pretty scarce at the moment, so I have to use what I’ve got available. I’ve got two 4GB CM4 modules with 32GBs of onboard EMMC storage, and I’ve got two 2GB CM4 Lite Modules, meaning that they don’t have any onboard storage. One of these Lite modules has WiFi and the other doesn’t, but we’re not going to be using that in this cluster in any case.

Raspberry Pi Compute Module 4s

The CM4 modules just snap into place on the adaptor boards. There are four holes in the corners to hold them together with some machine screws, but I prefer not to use these as they tend to bend the CM4 modules if you don’t use the right size spacers.

On the two Lite modules, I’ll need to use micro-SD cards to load the operating system. I’m using Sandisk Ultra Plus cards for this, they’re reasonably cheap but are still fast and reliable.

Sandisk Ultra Plus MicroSD Cards

The modules can then just be pressed into the SO-DIMM slots and they’re then ready to go. They are also apparently hot-swappable, meaning you can plug in or remove them from the slots without having to turn the power off, although I’d prefer not to chance this.

Snapping CM4 Module Into Adaptor Block

Before I plug all of them into the board, we need to do something to assist with keeping the modules cool. I’m going to be using these black aluminium heatsinks by Waveshare. They are just screwed into place over the CM4 module, using the four screw holes in the corners, with some thermal tape between the heatsink and the CPU and Ethernet controller.

Aluminium Heatsink For CM4 Module

Waveshare’s instructions are for the nuts to face outwards, but I think they look better with the brass standoffs and screws the opposite way around so that the screw heads face outwards. This doesn’t seem to cause any issues with the spacing, the nuts fit perfectly between the CM4 modules and the adaptor boards.

Attaching Heatsink To CM$ Module

Let’s add the heatsinks to all of the modules and we can then plug them into our Turing Pi 2 board.

Snapping CM4 Module & Adaptor Into Place

With that done, our cluster is basically assembled. All we need to finish it off is to plug in a power supply and an Ethernet cable.

Powering The Turing Pi 2

Power is supplied to the board through a 24 pin ATX connector from a typical computer power supply. They recommend using a compact supply, like the PicoPSU, mine hasn’t arrived yet, so I’m going to be using a 450 watt power supply from another project.

24 Pin ATX Power Supply Connector

The board only needs a maximum of around 60 watts, so I’ll definitely be changing over to the PicoPSU as soon as it arrives.

Designing & Laser Cutting A Case For The Turing Pi 2

As I mentioned earlier, you can put the Turing Pi 2 board into any mini ITX case. I had a look online for some options, but they’re all too bulky for what I am going to be using the cluster for. I also like the look of the Turing Pi 2 board and modules, especially once all of the power and activity lights are on, so I’m going to design and cut my own from clear acrylic.

I started out with a similar form factor to my water-cooled Raspberry Pi build. Since the mini-ITX board already has screws in the four corners, I could use nylon standoffs and do away with the 3D printed corner pieces. So I could make an all-acrylic design.

Turing Pi 2 Case Design

I added cutouts for the ports at the back and cutouts for three 40mm 5V fans on the front. You could rather use a single 120mm fan on the side as a quieter solution, but they’re quite thick and the fan will then cover up the CM4 modules, which is what I wanted to avoid in the first place. I also added a cutout for a power button on the front panel and then some ventilation holes to allow the fan’s air to escape at the top and on the back.

With the design done, let’s get it cut out on my laser cutter.

I’m going to use 6mm clear acrylic for the larger side panels to give it some rigidity.

Laser Cutting The 6mm Components

The other panels will all be cut from 3mm acrylic.

Laser Cutting The 3mm Components

Assembling The Turing Pi 2 Case

Once the panels are all cut, we can start assembling our case.

Laser Cut Case Components

As mentioned earlier, I’m going to be mounting the board using some M3 nylon standoffs. So let’s start by melting an M3 brass insert into each of the holes in the back side panel so that we’ve got something to screw the standoffs into. The melting temperature of acrylic is about 150-160°C, so if your soldering iron has an adjustable temperature setting then set it at 160°C or slightly higher.

Melting Brass Inserts Into Place

Once those are in place, we can screw in our Nylon standoffs. I’m using 8mm standoffs on the bottom and then a series of 20mm standoffs on top of the board until we clear the CM4 modules.

Nylon Standoffs To Mount Board

So let’s screw in the 8mm standoffs first.

Screwing Nylon Standoffs Into Place

We can then place the board over them, with the ATX power cable and connector running beneath it. This is hopefully temporary and will be replaced with a small cable and barrel jack once the PicoPSU arrives.

Let’s then add the remaining nylon standoffs to each so that the front side panel clears the CM4 modules. I found that 3 x 20mm nylon standoffs provided enough room for the CM4 modules, so the overall internal width is 70mm.

Securing Turing Pi 2 To Back Side Panel

Now we can peel the protective film off of our other acrylic pieces and push them into place.

Installing The 3mm Acrylic Side Panels

Before we close up the main side panel, we also need to mount the power button and fans onto the front panel.

I’m going to use three 40mm RGB fans that I’ll screw into place using some M3 button head screws and nuts. I’m going to leave them unplugged for now as I’ll need to make up a harness to connect them to the 5V supply pins.

M3 Nuts Pressed Into 40mm RGB Fans

The power button I’m going to use is the same one I used for my water-cooled Pi build, the cable should just be long enough to reach the required pins on the opposite side of the board.

Power Button With Cable Attached

Once the fans and power button are secured on the front panel, we can re-insert the front panel into the slots on the 6mm back side panel.

Front Panel Assembled With Fans and Power Button

The last thing we need to do is to place the 6mm front side panel over the top to lock the other pieces into place. We’re not going to do that just yet as we need to first flash the operating system onto and prepare SD cards for our CM4 modules. So let’s move on to the software.

Loading The Operating System Onto The CM4 Modules

Before we can boot the Pi’s up, we need to load the operating system that we’re going to be using on each of them. This is where you have a few options, depending on what you’re going to be doing with your Turing Pi 2.

You could load different operating systems and or apps onto each of your Pi’s and use them as individual servers on your network, so for example have Pi-hole running on one, OpenMediaVault on another, Home Assistant on the third and a Plex server on the fourth. Each Pi will have its own IP address, will be identifiable by its own mac address, and will act in the same way it would if it were individually connected to any switch on your home network.

Deploying Apps On Turing Pi 2

Another option, which is the option that I’m going to be setting up, is to install Rapsberry Pi OS on each, then install Kubernetes. Kubernetes will have a master node and three worker or slave nodes and I’ll then be able to just tell Kubernetes what apps I’d like deployed on the cluster and it’ll manage the deployment of the apps automatically. So it’ll decide which Pi to run each app on and can do things like load balancing and adjust for a missing node if one is removed.

Kubernetes Deploying Apps On Turing Pi 2

So I’m going to start by flashing Raspberry Pi OS onto each Pi. I’ll have to do this in two ways because two of my modules have onboard storage and two require SD cards.

The ones that have onboard storage need to be installed on the board (or another carrier board) and need to be powered up with boot mode disabled. They can then be individually connected to my computer using the slave USB port so that they act like SD cards, visible to Raspberry Pi Imager.

Flashing Raspberry Pi OS Onto CM4 Modules

For the ones without eMMC storage, I need to just flash two microSD cards using a microSD card reader.

In Raspberry Pi Imager, I’ll set the name of each node and turn SSH on so that we can access it over the network to continue the installation of Kubernetes.

I’ve put the SD cards back into nodes 3 and 4, which have our Lite modules on them, and I’ve flashed Raspberry Pi OS onto nodes 1 and 2. So we can now power it up.

To close up the case. the acrylic pieces need to be lined up with the slots in the main side panel and we can then push it down into place and secure it with four M3 button head screws into the nylon standoffs.

Adding The Front Side Panel To The Case

I’m not going to screw the side panel down just yet as I might need to open it up again to get to the modules or SD cards while setting it up.

Boot Up The Cluster For The First Time

I’ve now connected the fans up to get 5V from a USB port, so let’s try boot up our Pi’s and continue with the installation of Kubernetes.

When you push the power button, the board’s management system starts up each Pi in succession, so first node 1, then nodes 2, 3 and 4.

Powering Up The Cluster For The First Time

There are a number of LEDs assigned to each slot and on the adaptor boards. These show power to the slot, Ethernet activity, power on the adaptor board and activity for each CM4 module. So those are what I wanted to keep visible with the clear case design.

Indicator LEDs on Turing Pi 2 Nodes

After a few minutes, the Pi’s should all have finished their first boot process. You can also monitor the progress on node 1 by plugging the Turing Pi 2 into a monitor.

Allow Each Node To Boot Completely

You should notice significantly less flashing of the activity LED on the back of each carrier board. You can then move on to setting up Kubernetes.

Setting Up Kubernetes On The Turing Pi 2

I’m just going to go through a summary of the installation process of Kubernetes, if you want to set it up on your own cluster I suggest following Network Chuck’s video, he’ll take you through the entire process step-by-step.

The Kubernetes distribution that I’m going to be installing is called K3S, which is a lightweight distribution that is designed for use on resource-constrained devices like our Raspberry Pis.

After allowing the Raspberry Pis to boot up, we’ll need to SSH into them to install and set up Kubernetes. I’ve already assigned hostnames and static IP addresses to each node on my local network, this ensures that each node is given the same IP address by my router every time it comes online.

I’m going to SSH into each node using Putty on my windows PC and I’m going to start by setting up the master node.

We’ll install Kubernetes as the root user using a single line with some setup information following it:

curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -s -
Installing K3S Onto The Master Node

Once it is installed, we’ll need to copy our master nodes key or token as we need this to set up our worker nodes:

sudo cat /var/lib/rancher/k3s/server/node-token

We now have a basic cluster running, although it only consists of a single node. So let’s log into our other three nodes and install Kubernetes so that they can join our cluster.

We do this with a similar command to the master, but this time including the master node’s token and IP address:

curl -sfL https://get.k3s.io | K3S_TOKEN="<INSERT TOKEN>" K3S_URL="https://<INSERT SERVER IP>:6443" K3S_NODE_NAME="servername" sh -

Replace <INSERT TOKEN> and <INSERT SERVER IP> with the token that you copied from the master node and your master node’s IP address.

Once we have completed the setup on the fourth node, we should have our cluster ready.

We can confirm that all of our nodes are connected and available by again running the kubectl command on our master node:

kubectl get nodes
All Nodes Are Now Available

Our 4 nodes are now available and our cluster is ready for us to deploy apps on it. I’m not going to go into this in this video as it’ll then be too long, but this essentially involves creating a .yaml configuration file for each app you’d like to deploy on your cluster and then a single command line to deploy it from our master node.

Final Thoughts On The Turing Pi 2

Before we finish off, let’s take a look at its power consumption. The cluster uses around 25W once it is running a few apps, and when heavily loaded this goes up to a maximum of about 30W. So this is significantly less than running an old laptop or computer instead of the cluster.

Power Consumption 25 Watts

It’s also worth keeping in mind that this is with a 450W power supply, so it’ll probably come down by about 5-10W once I switch the cluster over to a smaller PSU. I’ll post an update here when I do.

Overall, I really like how the case has turned out. It’s simple, protects the Turing Pi 2 and still allows you to see into it and see all of the activity and indication LEDs. One addition I might make on the next version is to add some space for one or two 2.5″ SATA drives to be mounted so that they can be easily plugged into the available ports.

Turing Pi 2 In Clear Acrylic Case

Is there anything else you’d like to see me add to the case design? Let me know in the comments section below.

I think the Turing Pi 2 has a lot of potential; the upgrade to CM4 modules unlocks a significant amount of computing power and the all-in-one solution really makes it easy to get started. There is a lot of interfacing available on the board and it’ll hopefully all be made available and accessible through updates to the firmware in the coming months. I look forward to improving my cluster as the community evolves with it.

This Turing Pi 2 board and it’s firmware are still beta versions, so there will likely be a few tweaks and changes made before the final production runs. But the good news is that they’re launching on Kickstarter this week, so definitely go check their campaign out. I’ll leave a link to it as soon as it goes live. You can sign-up for their newsletter and updates in the meantime to stay informed.

Let me know what you think of the Turing Pi in the comments section below, what are you going to use it to run?

Mini Plex Server Running On A ZimaBoard With A 480GB SSD

In this project, we’re going to be making a Mini Plex Server with SSD storage using a ZimaBoard. If you haven’t heard of a ZimaBoard before, it’s a low-cost, feature-rich single board server – we’ll take a look at some of its features once we get it unboxed.

Zimaboard Single Board Server

This is a limited edition set that was sent to me by Seeed Studios to try out and share with you. It comes in this awesome branded case with the components all packaged and protected with foam cutouts.

Zimaboard Limited Edition Set

Take a look at the video of my build, or read on for the written instructions. The video is particularly helpful for the software setup.

What You Need To Make Your Own Mini Plex Server

Equipment Used:

Some of the above parts are affiliate links. By purchasing products through the above links, you’ll be supporting my projects, at no additional cost to you

Unboxing The ZimaBoard Limited Edition Set

The box is divided into two layers, each with foam cutouts. On the top layer, we’ve got the Zimaboard 832 single-board server.

Zimaboard In Limited Edition Set Case

On the layer underneath it is a Kioxia 480GB SSD, a 12V power supply, a PCIe adaptor, a SATA Y splitter, a SATA cable, an Ethernet cable and a Mini DisplayPort to HDMI adaptor.

Contents of Zimaboard Limited Edition Set

The Zimaboard runs a quad-core Intel CPU, and it’s x86 architecture means that it can run a wide range of operating systems, including Linux, Windows and Android. There are three variants of this board, the one included with this set is the most powerful 832 varient. This board has a 4 core Celeron Apollo Lake processor that runs at 1.1Ghz, with a 2.2Ghz burst frequency. It also has 8GB of LPDDR4 RAM and 32GB of onboard eMMC storage.

The full specifications for the ZimaBoard 832 and other variants are available from their website.

Zimaboard 832

Its a fanless design with a dual purpose housing and heatsink on the top and a gloss acrylic bottom. What separates this board from other similarly sized single board computers is the inclusion of a PCIe 2.0 x 4 slot and two SATA ports. On the opposite side to the SATA ports are two USB 3.0 ports, two Gigabit Ethernet ports, a Mini DisplayPort and the power input. So you’ve got a lot of options for connectivity and peripherals.

One thing to mention is that it doesn’t have WiFi connectivity, so you’ll need to use a dongle if you’re not planning on using a wired connection.

The included SSD is a 480GB Kioxia 2.5” SATA drive, which the included SATA cable plugs into. The included SATA cable looks like a proprietary cable with a unique power plug, but it seems to be included in the individual board packages as well.

Included 480GB Kioxia SSD

The 12V, 3A power adaptor can deliver up to 30W, so there is plenty of power available for storage drives and USB devices as well. It also includes a couple of different wall adaptor options to suit different countries.

Power Adaptor With Multiple Plug Options

The SATA Y splitter allows you to power two SATA drives from the single power supply on the Zimaboard.

Dual Sata Y Harness

Then lastly, the included PCIe adaptor allows you to connect an M.2 NGFF or NVME drive to the board. It would have been nice to have a way to “secure” any PCIe cards to the ZimaBoard somehow, perhaps using the backplates provided for use with computer cases, but it’s great to have the option to use PCIe cards with the ZimaBoard.

NVME and NGFF PCIe Adaptor

So that’s a basic overview of the ZimaBoard and what’s included in the Limited Edition set, so let’s move on to setting up our Plex server.

Designing The Plex Server Stand & Making The Components

As usual, I don’t like having loose cables and drives lying around, so I’m going to start by designing a drive holder and stand for the Zimaboard to hold two 2.5” drives underneath the board. I did this in Fusion360.

The 3D printed stand picks up on the holes underneath the ZimaBoard to hold the acrylic sheets in place and then provides a bay for each of the 2.5″ drives. The screws that secure the drive to each bay will also be used to hold some clear acrylic side panels in place as a stand.

One side panel is notched at the top to clear the PCIe port on the ZimaBoard.

Zimaboard Stand Model In Fusion360

I’ll make the files for this stand available to my Patrons on Patreon if you’d like to make your own.

I’m going to 3D print the adaptor bracket in black PLA and laser cut the clear acrylic sides.

Since I’m going to be using it as a Plex server, I’m going to laser engrave the Plex logo onto the side and try to put a coloured insert into the acrylic for the orange part of the logo.

Let’s laser engrave and cut the side panels first.

Laser Cutting The Plex Logo and Stand

Now we just need to cut two orange inserts for the section of the logo that I cut out. I cut these from a separate sheet of translucent orange acrylic.

3D Printed and Laser Cut Components

We can then add these to our 3D printed bracket, and we’re then ready to start assembling our Plex server.

Assembling The Mini Plex Server

To assemble our Plex server, we’ll also need a couple of M3 screws and nuts.

I’ve put aside four M3x16mm screws to go into the Zimaboard and then eight M3x8mm screws for the drives. I’m using the four M3 nuts because I’m not installing a drive in the bottom bay for this build, so these will secure the M3x8mm screws in place of the second drive.

Screws Required To Complete The Stand

To finish off the side panels, we need to first glue the inserts into place. I’m going to do this with a drop of super glue along the top and bottom edges of each insert.

Super Glue The Plex Logo Into Position

I’m not going to remove the protective film yet as this helps stop any glue or vapour from marking the acrylic.

Plex Logo Glued Into Place

While the glue dries, let’s install the bracket onto the bottom of the Zimaboard.

Start by removing the four black screws on the bottom of the ZimaBoard. Make sure that you hold the acrylic in place while you do so, else these layers will drop off. Keep the black screws in a safe place in case you want to remove the drive holder in future.

Remove Black Screws From Underside of Zimaboard

Place the stand onto the bottom of the Zimaboard, with the edges aligned with the board, and then replace the screws with the M3x16mm button head screws. These should just be long enough to get three to four turns into the board.

Install 3D Printed Stand Onto Zimaboard

With the stand in place, we can now peel the protective film off of the acrylic panels so that we can install them.

Plex Logo With Protective Film Peeled Off

The insert is a bit less orange than I would have liked, but it still looks quite good I think.

I’m going to use the top bay for the SSD so that I can easily add a second drive through the bottom in future if I’d like to.

The drive and panels are held in place using the M3x8mm screws, which screw into the SSD.

Screwing Side Panels Onto 3D Printed Stand

Now I’m going to add some M3x8mm screws and nuts to the bottom holes. This will give the side panels a bit more support and will close up the holes so that the finished assembly looks a bit neater.

Screwing Screws Into Bottom Of Stand

Now we just need to plug in our cables to finish it off.

For the SSD, I’m going to use the single SATA and power cable that came with the set. This can easily be replaced if a second drive is added in future.

Plugging SATA Drive Into Port And Power

On the opposite side, we need to plug in our power and Ethernet cables. You’ll also want to plug in your mini DisplayPort adaptor so that you can plug your ZimaBoard into your monitor or TV to configure it.

Plugging Ethernet and Power Into Zimaboard

Our Plex server is now built, so we can move on to configuring it.

Mini Plex Server Running On A Zima Board With A 480GB SSD

Booting The ZimaBoard For The First Time

The first time I booted the Zimaboard, it required a few updates, so I did those first. It comes preloaded with CasaOS, which is a software package by IceWhale that is built around the Docker ecosystem, but with a user-friendly web interface. Have a look at the CasaOS GitHub repository for some additional resorces on the package.

CasaOS GUI Vs Docker Back End

The default password is CasaOS and you’re then taken to the desktop.

If we open the system monitor, we can see that we’ve got our 4 processor cores, 8GBs of RAM and 32GBs of eMMC storage.

Zimaboard System Stats

Once your Zimaboard is connected to your local network, you’ll be able to access the web interface through the assigned IP address. You can also access the web interface locally through the quick launch on the toolbar.

The first time you log in to the CasaOS web interface, you’ll need to create an account and you’ll then land on the dashboard shown below. This is where you will manage your server and monitor its performance.

CasaOS Web Interface On Zimaboard

Installing Plex On Your ZimaBoard

From this step onward, it’s best to watch the video at the beginning of this post. The video shows you a lot more detail about what to click on and where to type commands etc. I’m now going to connect the Zimaboard to my network and re-load the web interface so that we can install Plex.

If we open up the App Store, we can find Plex and then click on install. This will download a preconfigured Docker image and launch it on our Zimaboard.

Installing Plex App On Zimaboard

It’ll then appear alongside the other containers running on our board and we can click on it to open up its web interface as well. The IP address for your Plex server will be the same as your ZimaBoards – but on a different port.

We’ll then need to create another account, this time for our Plex server.

Plex will then run through a configuration wizard.

We’re not going to be using any premium features for this build, so we can just close the window about monthly subscription offers.

You’ll then be asked to name your server, I’m going to give mine the name – My Plex Server.

We can then start adding our Media Libraries. These are basically locations or folders that contain our media files.

Adding Libraries To Plex Server

I’ll set up Movies and TV Shows as these are what I’m going to be using my Plex server for. Before we can finish this step off, we need to know where our media is being stored on our Zimaboard.

So let’s open up the File Browser app from our CasaOS web dashboard.

File Browser’s default username and password is usually admin, so it took me a few tries to figure out that it has been configured as CasaOS as well.

Using File Browser To Locate Files and Folders

We can now see our files stored on the Zimaboard and we can see that there is a folder called Media. This folder contains further folders for Movies, Music and TV Shows. We’ve got the Movie Big Buck Bunny preloaded in our Movies folder. So let’s add these locations to our Plex server as libraries.

Big Buck Bunny In The Media Folder

We’ll start by adding Movies and then add the Movie folder that we found in our File Browser app. Then we can do the same for TV shows.

Lastly, we can choose what content we want to be visible as pinned sources and we’ll then land on our Plex server’s web interface home page, where we can see our Movie is available.

Big Buck Bunny On Plex Server

TV Shows is empty because we had nothing in this folder yet.

You can add media to either of these folders using the File Browser app, which can be accessed using it’s IP address and port on any other computer on your network.

Adding Our SSD Storage To The Mini Plex Server

We’re almost finished, but we still need to make the media on our SSD available on our Plex server. Currently only the content on our onboard eMMC storage is available.

If we open up storage on the CasaOS dashboard, we can see that our drive is being seen, but it’s not available as a storage location.

Adding SSD To CasaOS Storage Manager

I ran into a bit of an issue here. I tried using this tool to create a storage location a number of times. I left it open for a while and the storage location never popped up. I tried creating it again. I tried restarting the system. I tried again after restarting, but I couldn’t get this tool to work. If anyone with more experience using CasaOS knows what I’m doing wrong here, please let me know in the comments section below – this looked like it should have been pretty straightforward.

I eventually managed to get the drive formatted and mounted using the Disks utility on the desktop. Remember to mount the drive after it is formatted, otherwise it still won’t be available.

Using CasaOS Disk Utility To Add Storage Drive

Once the new storage location on our SSD is available, we need to open up the App settings for Plex and add the volume to make it available to our Plex server as well.

Do this by adding the Host location as /media/casaos/SSDStorage and the container as /SSDStorage.

Add Storage Drive To Plex Server To Give It Access

When you click save, it’ll relaunch Plex with the new configuration, so you’ll need to give it a few seconds to start up and you’ll then be guided through the wizard again, so we’ll just repeat what we did previously.

When we get to the libraries step, we need to add a folder to our Movies and TV Shows media type. You’ll see that we now have our SSDStorage folder available, but it’s got nothing in it. So we need to create folders for Movies and TV Shows.

I’m going to do that quickly through the CasaOS desktop, and they’ll then be available on our Plex server.

Add Folders To The Drive For Movies and TV Shows

If you also want the local eMMC storage locations to be available on your Plex server then you can either add them as additional libraries or you can add their storage locations to the existing two libraries you’ve just created.

Add New Libraries To The Plex Server

If you add them as additional libraries then you’ll have multiple libraries for Movies and TV Shows and they’ll each only have the content from their respective folders.

If you add their storage locations to your existing libraries then you’ll have a single library for Movies and a single library for TV Shows and they’ll be pooled from the two storage locations. I prefer this option as I can then add media to either location and it’ll show up in one of the two libraries.

And that’s it, our Plex server is now ready to use.

Playing Media From The Mini Plex Server

You can play media locally, directly on the Zimaboard or on a network-connected device like a tablet or Apple TV. Plex also has an option to make your media available outside of your local network as well, so you can access your media library from any internet-connected device.

Big Buck Bunny Running On Plex Server

It’ll also remember where you stopped watching and will allow you to resume playback on a different device.

I have installed the Plex app on my Apple TV, so I’m able to watch my media on my computer, tablet or TV with ease.

Plex Running On Apple TV

Final Thoughts On The ZimaBoard

With CasaOS and docker, you can also use your Zimaboard to run a range of other applications along with Plex. I’m going to use mine to run PiHole and Home Assistant as well. You can install these apps through the App store on the CasaOS web interface in the same way that we installed Plex.

Zimaboard Mini Plex Server

Overall I think it’s a great option if you’re looking for a low-power device to run server applications on your personal network. It’s got a host of useful ports and interfaces and it’s powerful enough to comfortably run a few applications without slowing your network down.

Let me know what you think of the Zimaboard and my Plex server in the comments section below.

They’re currently being shipped to backers from their Kickstarter campaign and they’ll then be made available for sale. Be sure to have a look at Seeed Studio’s product page if you’d like to get your ZimaBoard. As I mentioned earlier, they have three variants available, so there are some options available depending on your requirements.

3D Printed Wireless Joystick Controlled Animatronic Eyes

In this project, we’re going to be making a set of wirelessly controlled animatronic eyes. I’ve been wanting to do this project for a while, so when Quantum Integration launched their new Motor & Servo Driver board, this project immediately came to mind. Their new board is based on the PCA9685 driver chip, so you can also build a similar setup using an ESP32 or Arduino if you’d like.

Here’s my video of the build, read on for the write-up:

What You Need For This Project

Equipment Used

Some of the above parts are affiliate links. By purchasing products through the above links, you’ll be supporting this channel, with no additional cost to you.

Designing & Printing The Animatronic Eye Components

I started out by drawing up a 3D model in Fusion 360. I knew roughly what I wanted the final set of eyes to look like, but naturally had to make a few tweaks along the way.

Fusion360 Animatronic Eye Model

I wanted the eyes to be able to move left and right as well as up and down, so I needed two servos for each of them. I also wanted to have eyelids that could blink, and in future maybe wink independently, so I needed another two servos for those movements as well. At the centre of each eyeball is a small brass universal joint and I’m going to use some cotton thread to connect each eyeball to the servos rather than using solid pushrods.

I had to go through a couple of trial prints to see what tolerances and clearances worked well. My first set of eyeballs was too big and got caught on the eyelids, but making them too small also left large weird looking gaps between the eyes and the eyelids, so that was also no good.

I also had to split the base to allow the screws that hold the eyelids to be installed so close together.

But eventually, I had a set of 3D prints that could be assembled into a working set of eyes.

3D Printed Animatronic Eye Components

If you’d like to 3D print your own eyes, the 3D model files for my projects are now available to my Patrons on Patreon or on my Etsy store.

Assembling The Eye Components

To assemble the eyes, we just need two small universal joints for 3mm shafts and some M2 screws and nuts.

M2 Screws and Universal Joints

These are the ones that were locally available for me. I’ve linked very similar ones in the parts list, but you might need to make some minor adjustments to fit the ones that are available to you. You’ll also some cotton thread or thin string to connect the eyeballs to the servos.

Let’s start by adding the thread to the eyeballs. We just need to glue a 10cm length of thread to four opposing inside edges of each eyeball. The eyeballs are round and don’t have any holes in them, so it doesn’t matter which four locations you choose, as long as they are equally spaced. I used a drop of superglue on the end of each length of thread.

Glue Threads Onto Back Of Eyeball

We can then press the universal joints into the 3D printed bases. Mine are a tight fit, but if yours are a bit loose you can secure them with a little bit of glue as well. Just make sure that you don’t get glue in the universal joint’s pins or it’ll lock up.

Press Universal Joint Into 3D Printed Base

Then we can push each of the eyeballs onto the universal joints as well.

Press Eye Onto Universal Joints

Now let’s add our eyelids. These pivot around some M2 screws in the holder on either side of each eye. Prepare the base by screwing these M2 screws into each side, with just one or two turns of thread exposed on the inside.

Screw Eyelid Screws Into Base Supports

A 3D printed pushrod is then going to be connected between each eyelid and the servo behind it to open and close it. The top pushrod is the longer one with a small extension on it to connect to the bottom pushrod.

Screw Pushrods Into Eyelids

The screws need to be adjusted a bit, you want them tight enough that they hold the components in place, but still allow free movement. You might need to iteratively tighten or loosen them to get them right.

Pushrods Assembled Onto Eyelids

Place the set of eyelids between the screws on the base and slowly tighten them until the eyelids are held in place. Make sure that the screws don’t protrude too far on the inside of the eyelids and touch the eyeballs.

Assembled 3D Printed Components And Eyeballs

The pushrod should be free and easy to gently push and pull to open and close the eyelids.

Pushrods Should Be Easy To Open and Close Eyelids

Once we have our eyes and eyelids assembled, we can add our servos. I’m using 6 micro servos, three for each eye. 

These are just glued into place on their supporting faces as they’re shown in the model. Install the servos on both base assemblies with the second eye being a mirror image of the first.

Glue 3 Servos Onto Each Eye Assembly

Lastly, tie the cotton thread to your two front servos. This was quite a fiddly job – make sure that you tie them off so that there is a bit of tension on the eye to stop it from wobbling. Also, don’t screw the white control arms onto the servos yet as you might need to adjust them once the servos are powered and centred.

Servos Connected To Eyeball and Eyelids

With that done, the eyes are now complete and are ready to add the electronics to.

Connecting The Electronics

As I’m using the Quantum Integration system, I need a build base to wirelessly control the eyes and I’m going to use one of their four new DIY kits, the Motor and Servo Driver to drive the servos.

Quantum Integration Builder Base

The Motor & Servo driver board allows you to control up to 8 servos and 4 motors with the I2C interface on your builder base, so it’s perfect for the 6 servos used in our project. The boards come as a kit with all of the surface-mounted components pre-soldered, you just need to add the through-hole ones.

Quantum Integration Motor And Servo Driver Board

Once the board is assembled, we can pair up the driver and builder base and plug in our servos. As I mentioned earlier, the driver uses the I2C interface, so we just need to make connections between the 5V, GND, SCL and SDA pins on each. The builder base is going to get its power through the servo driver board, so we only need to supply power to the driver board, which we do through the 5V and GND pins on the left of the board.

Note: You don’t actually need the jumper between 5V and VM that I’ve used as the servos are powered through the 5V supply. VM only supplies power for the DC motor outputs.

Connecting Power Jumpers To Motor and Servo Driver Board

Then just plug the servos into the driver board and we can then move on to programming it. I’ve connected the servos on outputs 1-6 as below:

  • 1 – Left Eye – Left Right
  • 2 – Left Eye – Up Down
  • 3 – Left Eye – Blink
  • 4 – Right Eye – Left Right
  • 5 – Right Eye – Up Down
  • 6 – Right Eye – Blink
Completed Electronic Components

Creating The App and Firmware

Now let’s log into our Q-Server and have a look at the App to control the eyes. 

Quantum Integration Animatronic Eye App

We’d got two joystick inputs on the left, one for the left stick and one for the right stick. The x and y axis on the left stick will control the eye movement and the button on the right stick will control the blinking.

These then feed into the three controls on our web dashboard, so that we can control the eyes from the web interface as well. We have two analogue sliders, one for the left and right movement and one for the up and down movement, and then a button to blink.

The web controls then feed into some ranging blocks which set directions and travel limits for the servos and then finally feed into each of the six servos on the right. So we have the left and right movement servos at the top, the up and down movement servos in the middle and the blinking servos at the bottom.

Lastly, before we run the app, we need to create our builder base firmware to tell the builder base which servo is connected to which driver output. These are identified by a channel number for each servo object as follows:

  • Servo 1 – Channel 3
  • Servo 2 – Channel 2
  • Servo 3 – Channel 1
  • Servo 4 – Channel 0
  • Servo 5 – Channel 15
  • Servo 6 – Channel 14
Builder Base Firmware

I started out by only enabling a single eye to test the App and firmware. It looked like the eye movement was set up nicely and the blinking worked well too.

Testing A Single Eyeball's Movement

We can now finish off the build by screwing the two bases together and marking the eyeballs with a pupil using a black Sharpie. If you’ve printed the eyeballs with the back surface on the print bed then the concentric circles of each layer can be used as a guide for marking the pupils.

Screwing The Base Together
Drawing on the Pupils With Sharpie

The Completed Eyes & Final Thoughts

Completed Eyes

Overall I’m quite impressed with how well these animatronic eyes turned out. The blinking works better than I expected it, and the cotton thread to the eyes holds up really well as a cheaper alternative to solid pushrods. I definitely think that solid pushrods are a more robust solution, but these work perfectly for a short term solution. 

Let me know what you think of them in the comments section below.

Making Laser Cut Raspberry Pi Cases Using The Atomstack X7 40W

Today we’re going to design and laser cut some new Raspberry Pi cases from 3mm plywood using the Atomstack X7 40W. This is a new laser engraving and cutting machine from Atomstack which is largely the same as their flagship X7 Pro, but with a slightly lower power 40W laser module.

Atomstack X7 40W

Being similar to their flagship model, it’s got a number of great features, including an offline independent control terminal, so you can operate the laser without it needing to be connected to a computer, a 32-bit ESP32 based mainboard, and a really high-quality all aluminium frame and electronics housing with a metal e-stop and buttons. Even the laser module is well packaged with an all-metal protective enclosure and a small acrylic window to see the laser.

Atomstack Offline Control Module

They claim that the 40W laser module can cut through 15mm thick wood and acrylic, although the acrylic will need to be opaque black as a diode laser can’t cut through clear or translucent materials. I haven’t tested the machine up to 15mm, I’ve only used 3mm plywood, but it had no problems with it even though plywood can often be a challenge to cut.

Laser Cutting Plywood With Atomstack

Watch my full video below, or read on for the write-up:

What You Need For This Project

Some of the above parts are affiliate links. By purchasing products through the above links, you’ll be supporting this channel, with no additional cost to you.

Unboxing & Testing The Atomstack X7 40W

The assembly of the Atomstack X7 40W was pretty simple. The gantry is all preassembled with the motors, so you’re really just assembling the four sides frame and installing the gantry onto it.

Unboxed Atomstack X7 Components

That said, if you haven’t put one of these machines together or used one previously then you might need to look at some photos or videos online to help out as the manual is a bit too brief in my opinion. It’s basically just a single page for the actual three-step assembly of the machine, with the packets of screws marked for each of the steps.

Installation Instructions

To control the laser and/or generate the required gcode for your cutting and engraving, you have the option of using a free software package called LaserGRBL, which I’ve used previously on other lasers, or a paid-for software package called Lightburn. Lightburn does have a lot more functionality than LaserGRBL, so if you’re going to be using the laser for more complicated work or as a daily workshop tool then you’ll probably want to invest the $83 for a license key. LaserGRBL is only able to provide basic control of the laser, while Lightburn allows layout and editing features as well as more advanced control.

LaserGRBL Homescreen

I used LaserGRBL for all of the work done in this project and it worked well for what I needed it for.

Once I had the Atomstack X7 40W set up, I tried a test engraving on one of the supplied sample pieces of plywood and I also did some test cuts on my own plywood.

Atomstack Engraving Sample

The sample engraving came out really well, the small laser dot size is able to produce high levels of detail, and it works fairly quickly too.

There is a lot of variation in the wood and adhesives used to make plywood, so you usually have to do a bit of experimenting to get clean cuts.

Laser Cutting Plywood Test

I used the example laser powers, speeds and passes provided by Atomstack as a rough guide and found that two passes at full power and 200mm/s seemed to work best for my plywood.

Example Cutting Parameters

Designing & Cutting The Compact Raspberry Pi Case

Once I was happy with the quality of the cuts, I moved on to designing the case. I’ve been wanting to create a more compact or low profile version of the 3D printed case that I made previously. An added benefit is that if I made it from plywood, then it could be assembled and painted in any colour to suit the project that I’m working on.

I came up with this rectangular design, which I drew up in Inkscape.

Take a look at my video on how to design your own Pi cases in Inkscape.

Simple Plywood Case Design

It has a similar form factor to my other cases but has a fan on top of the case rather than the side. The fan blows down onto the Pi’s CPU and exhausts air out of vents along the side.

When I was happy with the design, I put a fresh sheet of plywood into the bed of the Atomstack X7 40W and got cutting.

Cutting is pretty simple once you’ve got the hang of it. You’ll need to home the laser, then set the starting location for the cut. You also need to remember to adjust the focus of the laser to suit the material thickness that you’re cutting. This is easily done with the single thumbscrew on the front of the laser module, allowing the laser to be slid up or down on a track on the gantry. You’ll need to use a small piece of acrylic as a spacer between the bottom of the laser and the wood you’re going to be cutting.

Adjusting Laser Focus

You’ll also need to use an extractor fan or work in a very well ventilated room. One downfall of these open gantry designs is that the smoke made when cutting is not contained or filtered in any way. I worked near a large door and had a fan set up to blow the smoke out of the room.

Laser Cutting The Simple Case Components

One thing that this laser module does quite well is to blow the air away from the immediate area being cut. The internal cooling fan exhausts air out of the laser end which helps keep the lens clean and the smoke away from the immediate cutting area.

Cutting the plywood for this case in two passes took around 20 minutes to complete.

Simple Plywood Case Components Cut

Assembling The Compact Raspberry Pi Case

With our case components cut, we can now start assembling it.

I’m just going to be using PVA wood glue to glue the pieces together. The tabs on the sides of each piece interlock to hold them in position and keep the components square, so it’s quite easy to do.

Gluing The Simple Case Together

I’m going to first glue the four vertical sides together around the base. I’m also going to use the top cover to help hold them in place and hold them square, but I haven’t used any glue on it.

Once the sides are dry, we can add the 45-degree corner pieces to give it a bit more rigidity and close up the gaps along the edges.

The case is now complete and we can install the Raspberry Pi and fan into it.

Simple Pi Case Glued Together

This is just done with four M2.5 x 12mm brass standoffs pushed through the holes in the base and secured with some M2.5 nuts.

Brass Standoffs Installed Into Simple Pi Case

The Pi is then held on the standoffs using either some M2.5 x 6mm screws or additional standoffs if you’re going to be using a hat with the Pi.

M2.5 Screws To Secure Pi Into Simple Case

On the top cover, I initially planned on using some M2.5 x 12mm screws and nuts to hold the fan, but the pockets for the nuts are on the wrong side of the fan for the air to be pulled into the case and the screws are too short to go all the way through the fan. So I’m going to have to revert back to pressing some M3 nuts into the pockets and use the screws that came with the fan to secure it.

M3 Nuts Pressed Into 40mm Fan

The fan is then held on the top cover using the M3 screws that came with it.

Screw 40mm Fan To Top Cover

Lastly, I’m going to glue some 6mm brass standoffs to the inside of the side panels. These are needed to hold the top in place with four M2.5 screws. It’s easiest to screw these onto the top cover first, with the flat edge aligned with the edge of the cover. Then put a drop of glue onto each before pushing the cover down into place and allowing the glue to dry before removing the screws. Make sure that the glue doesn’t seep up the side of the standoffs and onto the cover or it might accidentally glue the cover to the case.

Glue Standoffs To Inside Walls Of Pi Case

We can then open up the cover, plug the fan into the 5V and GND pins and then close up the case again.

40mm Fan Plugged Into 5V Pins

Our basic, compact Raspberry Pi case is now complete. As mentioned earlier, the plywood finish can easily be painted or stained in a colour that suits your project.

Complete Simple Plywood Pi Case
Simple Plywood Pi Case On Ports Side

Designing & Laser Cutting More Detailed Cases

Now, this case looked a bit basic and didn’t really require much effort from the laser, so I decided to try and step the design up a bit and cut a pattern into the top and side panels as well.

I integrated two patterns into the original design, one with a hexagonal geometric pattern and one with a diagonal line geometric pattern.

Diagonal Pattern Pi Case Design

This was a lot more work than I thought it would be, and really challenged my Inkscape abilities, but it eventually started to look promising.

So let’s see what the laser can do with these patterned pieces.

Cutting Out Patterned Pi Case Components

And with that, we now have the parts to make two more cases.

Well if I’m honest, it took a few more attempts to get right. More cuts mean more time and more opportunities for things to go wrong, like the laser being bumped while cutting, pieces getting caught on the end of the laser and causing the wood to move and even a bit of variation in the plywood causing the laser not to cut through in the usual two passes.

Scrap Plywood From Test Cutouts

So my one hour of planned laser cutting turned into 5 hours, but I eventually had all of the pieces I needed to make up the two extra cases.

Patterned Components Cut Out

Painting & Assembling The Detailed Cases

I’m going to glue these two together in the same way as the previous one and I’m then going to paint them.

Gluing Patterned Cases Together
Completely Glued Patterned Pi Cases

I’m going to use two speciality spray paints that looked interesting at my local hardware store. I haven’t tried either of them before, but hopefully they come out looking good.

Spray Paints and Undercoat

The first is a pearl white colour, which has a bit of a glittered finish to it. The second is a grey, stone finish, which has speckles of black and white in it to create a natural stone appearance.

And, since I learned my lesson in the comments section of the last project that I didn’t use a primer or undercoat on, I’m going to be using a white undercoat on both cases before adding the colour.

So let’s give both cases a spray of the white undercoat to start.

Undercoat Sprayed Onto Patterned Cases

After a few hours, the undercoat is dry and we can move on to spraying on the colour coats.

I’m going to start with the glittered pearl white and I’ll be painting the diagonal patterned case with this colour.

Pearl Glitter Pi Case Painted

Next, I’m going to paint the hexagon patterned case with the grey stone finish. This paint needs 24 hours to dry and is applied quite thick, so I’m going to avoid doing too much around the edges where the top cover goes and I’m not going to do the underside of the top cover. If too much paint builds up in these areas then the lid isn’t going to fit properly anymore.

Granite Stone Finish Pi Case Painted

24 hours later, the two cases are ready to install the Raspberry Pis into. I really like the way the pearl white has come out, it looks great with the laser-cut pattern. The glitter effect is quite hard to capture on camera, but it looks really interesting when the light catches the edges.

Both Patterned Pi Cases Painted

The stone finish also looks great, it just took a really long time to dry. I’m glad I used the white undercoat with this paint as I think it would have come out too thick if I had tried to cover up the bare wood.

I’m going to install a plain black fan on the grey stone finish case and a clear RGB fan on the pearl white coloured case.

As with the previous plain case, the Pi’s are secured with some M2.5 x 12mm brass standoffs and some M2.5 x 6mm button head screws.

Raspberry Pis Installed Into Patterned Pi Cases

The fans are screwed onto the top cover with the included screws and some M3 nuts pressed into the pockets.

Fans Installed On Patterned Pi Cases

The top covers are secured with some M2.5 brass standoffs glued to the sides of each case and some M2.5 x 6mm screws to hold each in place.

Gluing Brass Standoffs Onto Patterned Pi Cases

That’s it, our two detailed cases are now completed. Although the general shape is the same, they look really different now that they’re finished off.

Completed Patterned Pi Cases
Running Pis Made Using Atomstack X7 40W

I also like how you can partially see into the cases and you can also see the Pi’s LEDs.

Final Thoughts On The Atomstack X7 40W And The Complete Cases

Overall I think that the Atomstack X7 40W is a good value for money, high-quality diode laser cutter and engraver. I really like the build quality and all-metal construction and the full-colour touch control panel makes it a breeze to use without a computer – something that most machines in this price range don’t have. The X7 40W is perfect for cutting and engraving woods and opaque plastics, but you’ll need to look at a CO2 laser if you’re wanting to cut clear materials. Be sure to have a look at the Atomstack website to get your own Atomstack X7 40W.

Atomstack X7 40W Unboxing

Let me know what you think of the two cases in the comments section below. Do you like the laser cut patterns on the sides? They obviously open the case up to a bit more dust, but they still provide a lot more protection to the Pi than just having the Pi exposed.

I think for future versions, I’d probably add an SD card slot into each of them to make it a bit easier to swap out the cards.

SD Card Slot To Be Made On Patterned Pi Case

I’d also like to re-look at the screws that hold the lid in place. It would probably be better to design slots in the sides for the screws to screw into and do away with the brass standoffs entirely.

Screws Slots To Be Added To Patterned Pi Case

All-In-One Indoor Air Quality Monitor With CO2 Sensor

In this project, we’re going to be making an all-in-one indoor air quality monitor with an IOT dashboard using an infrared CO2 sensor from DFRobot and a BME280 environment sensor.

CO2 is a colourless and odourless gas that is a by-product of combustion, produced by gas heaters and stoves, and also by metabolic processes in humans and animals. It typically exists in a concentration of around 300-400 ppm (parts per million) outdoors, but when the average adult exhales, they can produce a concentration almost 100 times greater than this. With poor ventilation, the CO2 concentration in an indoor space can build up quite quickly. Early signs of increased concentrations of CO2 include the inability to concentrate and tiredness, while high concentrations of CO2 can lead to headaches, dizziness and even difficulty breathing, and eventually loss of consciousness.

Ideally, we’d like to keep the concentration of CO2 in an indoor environment below 1,000 ppm, anything above this starts to lead to drowsiness and impaired concentration and the upper limit for what is considered to be safe is 5,000 ppm – so that’s actually the upper limit for our infrared CO2 sensor – since it has been specifically designed for this sort of use.

Gravity Infrared CO2 Sensor

Our CO2 sensor uses infrared light to measure the concentration of CO2 within the air and then produces a 0-2V analogue signal.

DF Robot Firebeetle ESP32-E Microcontroller

We’re going to read this signal using an ESP32 based microcontroller by DFRobot called a Firebeetle board. I’ve used one of these boards previously for my weather station because they have a great range of IO, integrated WiFi and Bluetooth connectivity and they’re designed to be power efficient. They even include a battery charging circuit and a JST connector plug for a lithium-ion or lithium-polymer battery.

I’m going to be using the board’s WiFi connectivity to send the measured data to Prometheus, which is an online time-series database, and I’ll then be creating a dashboard to view the data using Grafana. This dashboard will be able to be accessed on any internet-connected device with a browser and will allow time-based trends of the data to be created. I also want to include some local indication on the device so I’m going to be doing that with an I2C OLED display.

BME280 Sensor and I2C OLED Display

Finally, since I’ve already got a microcontroller and display, it would be good to measure some other environment metrics as well, so I’m going to also include a BME280 temperature, pressure and humidity sensor.

Watch my video of the build here, or read on for the full write-up:

What you Need For This Project

To complete this project, you’ll need the following main components in addition to basic wiring, header pins etc.:

Designing And 3D Printing The Housing

My goal is to build all of the components into a single desktop or wall-mountable device that I can power using a USB outlet and move around the house if I want to.

I quite like the futuristic look of the CO2 sensor, so I’m going to make the front cover of the housing clear so that we can see into it, and see the microcontroller, display and sensors. So for this reason it would be good to mount the four boards in a flat, rectangular layout as shown below.

Arrange The Boards In A rectangular Shape

I designed the case in Fusion360, using a simple layout with 3D printed standoffs to mount each of the four components.

Fusion360 Design of Case

I then added a screw on a clear acrylic cover to the front. I also added some ventilation holes along the top and a cutout for the USB cable on the side.

Fusion360 Case Design With Cover

I 3D printed the case in black PLA. It’s just a single print and I didn’t need to add any supports as the cutouts are relatively small and are rounded at the corners. This depends on your printer’s abilities but I think most printers would cope with these small overhangs without requiring any print supports.

3D Printed Case On Kywoo Tycoon Slim

I laser cut the front cover from 2mm clear acrylic.

Laser Cutting The Side Panels

The front cover is a basic rectangular shape with the same profile as the housing and I’ve added a cutout for the CO2 sensor and one for the BME280 sensor so that they’re both exposed to the outside air.

3D Printed and Laser Cut Components

Making Up A Wiring Harness

Before I install all of the components into the case, I’m going to make up a wiring harness to connect them together. The display and BME280 sensor both use the I2C interface to send and receive data and the CO2 sensor just needs a power supply and a connection to one of the analogue inputs.

Here is a basic wiring diagram for the connections:

Air Quality Monitor Wiring Diagram

I initially used analogue input A4, shown in the subsequent photos, but I moved this to A0 as A4 doesn’t work when using WiFi on the Firebeetle board.

One important note is that the CO2 sensor requires a 5V supply. Its analogue output is compatible with 3.3V microcontrollers as it doesn’t go above 2.0V, but it still requires 5V to power it. For this reason, I’m going to be powering the sensor with 5V directly from the USB supply, while the display and BME280 sensor will be powered using 3.3V from the Firebeetle’s onboard regulator.

I made the wiring harness up using coloured ribbon cable as well as male and female header pins and I added some coloured heat shrink over the soldered connections.

Wiring Harness To Connect Components Together

Installing The Components In The Case

With the standoffs already 3D printed on the housing, it’s relatively simple to install all of the components in the case.

I’m going to start by using some M3 brass inserts to make the M3 screws that hold the lid in place a bit more durable. These are just melted into place in the printed pockets using a soldering iron which I’ve set to 200 degrees – which is about the same temperature as the PLA filament is printed at.

Melting Brass Inserts Into Place

I’ll use a range of small screws to hold the boards in place, mostly M2.5 x 6mm screws, with the wiring running below the boards as far as possible. Make sure that you plug your connectors onto the correct pins and that they’re the right way around or your might damage your boards when you supply power to them.

Installing Components Into The Case

With that all done, we can now close up the case using four M3x8mm button head screws and move on to programing our Firebeetle board.

Programming The Firebeetle ESP32-E Board

I’ve written up an Arduino sketch that takes readings from each of the sensors every minute and then updates the display and uploads the data to Prometheus.

Indoor Air Quality Monitor Arduino Sketch

You can download the code from my Indoor Air Quality Monitor Github repository.

The posting to Prometheus part of the code is largely based on the example provided on the Grafana Cloud information page, which is linked to a GitHub repository called IoT with Arduino and Grafana.

There is a bit of setup involved in the code as you’ll need to set up your WiFi details as well as your Prometheus configuration information. The IoT with Arduino and Grafana repository explains this all in detail with screenshots, so head over to their repository if you need some additional help. Essentially, you need to update the config.h file to include your WiFi network name and password as well as your Grafana Cloud Remote Write Endpoint address, your Username and your API Key.

Once that is all done, you can upload the sketch and you should then start seeing some information being displayed on the OLED display and on your serial monitor.

Using The Indoor Air Quality Monitor

The CO2 sensor needs around 3-5 minutes to pre-heat, during which time it’ll give a reading of about 0.2V and it’ll then start producing a voltage between 0.4V and 2.0V, which corresponds to a CO2 concentration of 0-5000ppm.

Air Quality Monitor

I’ve set up the code to recognize these voltages and to indicate that the CO2 sensor is preheating before a reading is displayed.

CO2 Sensor Preheating

While preheating, we can still see that we’ve got readings from our BME280 sensor for the environment temperature, pressure and humidity.

After about 3 minutes, the CO2 concentration has now shown up on the display.

Indoor Air Quality Monitor Running

I’ve created a Grafana dashboard with an instantaneous gauge for each of the four metrics along the top and then a time-based trend below them.

Grafana Dashboard For Indoor Air Quality Monitor

The CO2 sensor hasn’t really picked up many spikes in CO2 concentration but it is currently being used in a fairly large living space and we tend to keep some windows or doors open during the day for fresh air.

You can read up a bit more on creating dashboards and visualisations in Grafana from my full Grafana tutorial.

So we’ve now got a portable indoor air quality monitor that we can leave in any room to monitor the air quality and we can access remote logs and trends of the data through any internet-connected browser.

Indoor Air Quality Monitor Using DF Robot CO2 Sensor

Let me know what you think of my Air Quality Monitor in the comments section and let me know if there is anything you’d add to it or change.

Compact 3D Printed Raspberry Pi Case Using The Kywoo3D Tycoon Slim

Today we’re going to be using the new Kywoo3D Tycoon Slim 3D printer to print two new cases for my Raspberry Pis. I’ll be printing one in regular PLA to get an idea of the print quality that the Tycoon Slim can achieve and one in TPU, which is a flexible filament that is perfect for creating bump and drop resistant cases – but is also notoriously difficult to print with. The TPU version will be especially useful for Pi’s that you’re going to use for travelling, like a portable media server or NAS.

This 3D printer was sent to me to try out and share with you by Kywoo3D through the online 3D printing store Tinker Hive. Tinker Hive is an authorised re-seller of Kywoo3D products and they offer three payment options, with the option to pay your printer off in four interest-free instalments, making it more affordable for tinkerers to get into 3D printing.

Kywoo3D is a relatively new company to the 3D printing game, having successfully launched their Tycoon 3D printer on Kickstarter in April last year. They’ve now brought out a more compact, and cheaper version called the Tycoon Slim, and that’s what we’re going to be taking a look at and using for today’s prints.

Here’s my video of the project, read on for the full write-up:

What You Need For This Project

Equuipment Used

Some of the above parts are affiliate links. By purchasing products through the above links, you’ll be supporting my projects, with no additional cost to you.

First Look At The Tycoon Slim

The Tycoon Slim comes mostly pre-assembled and is well packed with fitted foam inserts.

Kywoo3D Tycoon Slim Packaging

It comes with all of the tools required to assemble and operate the 3D printer and even includes a mini-sized spool a filament – something I haven’t seen supplied with a new printer. You usually just get a coil of a couple of turns of filament that is barely enough to complete the pre-loaded test print.

Tycoon Slim Package Contents

With the Tycoon Slim unpacked and set up, you may notice that its print volume is slightly larger than the Creality Ender 3 V2, but it is also around $100 dollars more expensive. I’m going to be comparing it a lot to the Ender 3 V2 as this is one of the printers that I’ve got the most experience with, I’ve got three of them and they are running for a large portion of each day – so I really know their strengths and weaknesses well and I can see that Kywoo3D have tried to address some of these weaknesses in the design of the Tycoon Slim.

Tycoon Slim Partially Assembled

The first and probably most noticeable is that the Tycoon Slim has a direct drive extruder with a filament runout sensor.

Kywoo3D Tycoon Slim Direct Drive Extruder

Now I wouldn’t classify the extruder type as a weakness on the Ender 3, but it does limit the materials that you are able to print with. With a direct drive extruder, you are able to print with flexible materials like TPU, so that’s one of the materials that we’re going to be trying out to make our Raspberry Pi case.

Filament Runout Sensor

Next, they’ve added a double vertical axis drive and they’ve addressed a common problem with axis misalignment by coupling the two lead screws together with a belt underneath the printer. This ensures that both motors always start up in the same position and move together.

Dual Z Axis Lead Screws

They’ve also done away with v-slot gantries and rather provided a linear rail design for the x-axis and a dual rod slider design for the y axis.

Kywoo Touch Bed Leveling Sensor

You’ll also always get great first layer results with an integrated Kywoo Touch bed levelling sensor.

You’ve also got a number of now fairly standard design elements, like a colour touch display, silent TMC2209 drivers, print resume from power-off and adjustable belt tensioners.

Colour Touch Display

Assembly of the Tycoon Slim was really simple as it is largely pre-assembled when it is shipped out. It probably took me around half an hour to get it set up to the point where I was able to start my first prints.

I printed one of their test prints, which is a bird whistle and then a version of my Raspberry Pi Desktop Case and these both came out really well.

These were both printed using their standard recommended printing profile without any tweaks and the print quality right out of the box is quite impressive for a printer that also didn’t need any manual levelling or adjustments to be made to the bed.

Desktop Case Print Quality

So now that we’ve got the printer working, let’s design our case and see how it handles printing with a flexible filament.

Designing The Raspberry Pi Case

I designed the case in Fusion 360 using a traditional split design – although I’m going to be using the Raspberry Pi’s mounting points and some brass standoffs to close the case up rather than using separate screws just for the case. There are obviously some pros and cons to this, so I’ll see how it holds up.

Low Profile Rapsberry Pi Case

I’m going to use a small 30mm fan for cooling, which will draw air in through the top of the case and exhaust it through the enlarged holes between the USB and Ethernet ports.

I’m also going to add a slim I2C OLED display to display stats or status information if it is running in a headless setup.

3D Printing The Raspberry Pi Cases

I exported the case shell halves and opened them up in Cura for slicing. I haven’t used TPU before, so I’m still going to have to experiment with the print settings, but I did find some general guidelines online and used these, along with Kywoo3Ds suggestions as a starting point.

Tycoon Slim TPU First Layer Quality

Printing in TPU did have its challenges and I had to play around with the settings to get reasonably good quality prints. Because TPU filament is flexible, it’s really easy to run the extruder too fast and you land up with the filament folding over itself blocking the top of the hot end. I had two initial prints fail quite early on because I was trying to print too quickly and at too low a temperature. After a couple of test prints, this is what I managed to achieve.

TPU Test Print

There are a few signs of under extrusion, which is a bit of balancing act between under extrusion and a successful print or over extrusion and blocking the nozzle. I’ll hopefully eventually find the perfect combination of speed and temperature to get near perfect prints. But other than that, this print is really good, the small features are still quite clearly defined and the fit around the Pi is fantastic.

Tycoon Slim PLA First Layer Quality

I then printed out a second case in translucent green PLA as well, so that you can see the quality difference between the two different filaments. The translucent green PLA case came out really nicely, the print lines are clean, the layers are consistent and the parts fit together perfectly.

Comparing Quality Between Prints

Assembling The Cases & Installing The Pis

Now that we’ve got our cases printed, we can move on to installing the components.

Components Required For Assembly Of The Case

To start, we need to add our brass inserts to the case to secure the Pi and hold the standoffs. I’m using M2.5 inserts and they’re melted into place using the tip of a soldering iron. I’m going to set the temperature to 210 degrees, which is in the middle of the recommended nozzle temperature for TPU, so should work perfectly.

Setting Soldering Iron Temperature To 210 Degrees

Just place the tip of the soldering iron into the brass insert and wait for it to heat up and melt into place. This shouldn’t require any force.

Inserting Brass Studs

I’m also going to do the same on the PLA print while I’ve got it out.

Brass Studs Inserted

Now we can install our Raspberry Pi into the case. The Pi is then held in place on the base using some M2.5 brass standoffs.

Raspberry Pi Installed In Case

On the case lid, we can mount our 30mm fan and the I2C OLED display.

I’ve had to remove the header pins on the display so that it is compact enough to fit into the case. I just added a short lead directly to the pads on the PCB.

Ribbon Cable Soldered Onto I2C Display

The display is held in place using some M2.5 screws which hold a retaining clip around the back of the display and screw directly into the printed standoffs.

I2C Display Installed In Case

The fan is held in place with some M2.5 button head screws and nuts on the inside.

Fan and Display Installed In Case

We can then connect our fan and display to our Pi’s GPIO pins. I’ve connected the fan to 5V and GND and the display to GND, 3.3V and then the two I2C pins SCL and SDA.

I’m going to stick a small heat sink onto the CPU which, with the fan directly overhead, should be a good compact cooling solution.

Aluminium Heatsink Added To Pi

We can then close up the case using some more M2.5 button head screws which screw into the brass standoffs.

Pi Case Closed Up Using Screws

And that’s our Pi installed in the case. When you turn it on you’ll still need to program the I2C OLED display to show our Raspberry Pi’s performance stats. You can do this using the script that I’ve used previously on my other designs, you’ll just need to change the display size to suit this more compact version.

Completed Low Profile Pi Case

Our case is now complete. We’ve got a durable cover that provides a bit of protection against drops and bumps, which is great for throwing into a travel box or your car.

Fan Ventilation Through Holes In Front

I’ve assembled the translucent green case as well, to get a feel for how it looks and fits. I, unfortunately, didn’t have a second 30mm fan, so I’ll be running this one without the fan for a few days until the fan arrives. But it should still be ok for light tasks.

Final Thoughts On The Tycoon Slim

By using the Tycoon Slim over the past few weeks, I have been quite impressed by how well it has worked and how little I’ve had to do to get some good quality prints.

As with any new company and product, there are a couple of things that could be improved on and Kywoo3D have already told me that they have made some improvements to the latest version of this printer which is currently being shipped out.

The clearance around the SD card slot is a little bit too big, so it’s easy to push the card into the metal housing instead of the slot. Kywoo3D are aware of the issue and have made up a 3D printable bracket to prevent this, which you can print out and install yourself.

Tycoon Slim SD Card Slot

Some other things they’ve changed is an improved bed levelling sensor and a glass print bed. The glass print bed is great once you’ve dialled in your bed levelling, and I use these on my other 3D printers, but I actually quite like the simplicity and ease of use of these magnetic print beds.

Tycoon Slim Touch Levelling Sensor

My only real complaint with this printer is that the user interface on the touch display is not as intuitive as I would like. There are a couple of missing features or features that I haven’t been able to find. Things like pre-heat that automatically set a preheat bed and nozzle temperature, or just generally being able to find options or settings since there isn’t really a main menu – each item’s settings are within each icon on the display. This is obviously not a deal-breaker but does take a bit more time to get used to.

Tycoon Slim Touch Display

Overall I think it’s a great first printer and it makes getting started with 3D printing about as simple as it can be.

Compact 3D Printed Raspberry Pi Case Using The Kywoo Tycoon Slim

Let me know what you think of the Kywoo Tycoon Slim in the comments section and be sure to check out Tinkerhive for all your 3D printing needs.

Ultimate Raspberry Pi Computer Build – Water Cooled CM4 with NVMe SSD

If you’ve been following my projects for a while then you’re probably aware that I like to do unnecessary things, like building a water-cooled Raspberry Pi cluster, or this desktop version of a water-cooled Pi. As cool as these may look, they’re not all that practical, so today we’re going to build something that is a little more practical, although is still a bit unnecessary.

We’re going to build the ultimate water-cooled Raspberry Pi desktop computer and try to give it all of the bells and whistles, including front-facing USB ports, a power button, an OLED stats display and an NVME SSD.

I’m going to be using a Raspberry Pi Compute Module 4, or CM4 for short, for this build so that I can use the CM4 IO Board for a number of features which we’ll get into in a bit.

Raspberry Pi CM4 and IO Board

I’m going to be adding a 1TB NVME drive which will be attached to the Pi using the PCIe Gen 2 socket on the IO Board and a PCI express adaptor.

Crucial NVME SSD

Lastly, for the unnecessary part, I’m going to water cool the CM4 module using 60mm radiator and Noctua fan as well as a small cooling block and pump.

Noctua Fan, Pump and Cooling Block

On the front of the case, I’m going to add two USB ports, a power button and an OLED display.

Here’s my video of the build, read on for the full write-up:

What You Need For This Project

There are a number of smaller parts used in this build that I just had lying around or repurposed, but these are the main components you’ll need if you’d like to try to tackle building your own ultimate Raspberry Pi desktop computer.

Hardware Used For The Raspberry Pi Computer Build

Equipment Used

In addition to the parts used above, I’ve used the below equipment and tools to complete the project.

  • K40 Laser Cutter/Engraver – Buy Here
  • Creality Ender 3 V2 3D Printer – Buy Here
  • Xiaomi Pencil Electric Screwdriver Set – Buy Here
  • Dremel Versatip Soldering Iron – Buy Here
  • Dupont Connector Crimpers – Buy Here

Some of the above parts are affiliate links. By purchasing products through the above links, you’ll be supporting my projects, with no additional cost to you.

Let’s Take A Closer Look At The Hardware We’re Going To Use For Our Raspberry Pi Computer

Let’s start out by taking a look at the IO board and some of the reasons why I decided to use it over a regular Pi 4.

Raspberry Pi IO Board

For a start, all of the ports are on one side and we have access to two full-size HDMI ports. We also have a J17 barrel jack for a 12V power supply, so we can drive 12V components like devices connected to the PCIe slot and the Noctua fan. This also ensures that we have enough current to power the Pi and an attached SSD, which can be a problem with the Pi 4.

The IO board also has header pins available for external USB ports, a 12V Molex fan connector with I2C PWM drive and tacho feedback, a full set of GPIO pins and a number of additional IO connectors.

I’m going to be using a CM4 Lite module. This means that it doesn’t have onboard eMMC storage, but we’re not going to use this anyway because we’re using an NVME SSD drive.

Raspberry Pi CM4 Module

I’m using a variant with 8GB of RAM as well as WiFi and Bluetooth connectivity. There is a pretty broad range of these CM4 modules available and some are more common than others. There is also a shortage of these modules at the moment due to the global silicon shortage, so they’re not all easy to come by.

For storage, we’re going to use a 1TB Crucial NVME drive which we’re going to connect to our Pi’s PCIe Gen 2 x1 Socket using an M.2 to PCIe adaptor.

Crucial 1TB NVME SSD
M.2 to PCIe Adaptor

For cooling, we’re going to use a 60mm Noctua NF-A6x25 FLX fan which I’m pairing with a 60mm radiator.

Noctua 60mm Cooling Fan

The 120mm one I used on my previous desktop build was obviously way bigger than necessary, and this is the smallest radiator I could find.

60mm Water Cooling Radiator

We’re going to use the same 40mm cooling block that I used previously as it fits over the CM4 module as well.

40mm Cooling Block On Pi CM4 Module

To move the coolant around, we’re going to use a small 5V pump, which I’m hoping I can run on 3.3V so that it is a bit quieter. I’m going to need to build a small reservoir for coolant storage and we’ll connect the components together with some clear flexible tubing.

On the front of the case, I’m going to add an I2C OLED display as I’ve done on a lot of my other case builds to display the IP address and some stats. I’m also going to add a power button, which I’ve chosen with a LED ring light around it which will light up when the computer is on. And lastly, I’m going to add two front-facing USB ports. I couldn’t find ones with four female pins on them locally, so I’m just going to cut up this splitter and put my own Dupont connectors onto each of the leads.

USB Splitter, OLED Display and Power Button

Designing The Acrylic Case

Now that we know what hardware we’re going to be using, we can move on to designing a case to house it all. I designed the case in Inkscape using my previous builds as inspiration. Inkscape is open source and is great for producing 2D part designs for laser cutting.

Case Design in Inkscape

Download the CAD files to make your own case.

Five of the sides of the case will be cut from 3mm matt white acrylic, and the other main side panel will be clear acrylic so that the internals are all visible. I’ve then got two small black acrylic accent pieces for the front panel and I’ve designed a new water cooling block bracket to keep the block positioned directly over the CM4 module’s CPU.

Acrylic doesn’t join very well at 45-degree angles (unless you mitre the edges) and I don’t like 90-degree edges on all of the sides as it starts to look too “boxy”. So I designed some corner sections in Tinkercad which I’m going to 3D print. Tinkercad is a free, browser-based basic CAD package that works by combining or removing shapes to form 3D models. These corner sections will support the side panels and hold another section of matt white acrylic along the 45degree edge as an accent piece.

Corner Pieces Designed In Tinkercad

I sketched up the rest of the case in Tinkercad as well to get a feel for what it would look like and made some tweaks to the design along the way.

Case Design Modelled In Tinkercad

I was a bit undecided about framing the clear acrylic side with a white acrylic border as well, but I think it looks better being entirely clear.

Cutting & Assembling The Case

With the design done, let’s cut the acrylic parts out on my laser cutter. I’m using a K40 laser cutter, which is a fairly generic name for a range of 40W desktop CO2 lasers that are available from a number of manufacturers, particularly in China. They’re quite inexpensive and work well for cutting and engraving thin acrylic and wood.

Laser Cutting The Acrylic Side Panels

With the acrylic cut, we can start assembling the case.

Laser Cut Acrylic Case Components

I’m going to peel off the protective film on the inside face of each piece, but I’m going to leave as much of the outside film in place as possible so that it doesn’t get dirty or scratched while assembling it.

Let’s start with the main white side panel and add our 3D printed corner pieces to it so that we can then glue the other four smaller side panels into place. I just printed the corner pieces out in black PLA on my Creality Ender 3 V2 using a 20% cubic infill.

3D Printed Corner Pieces In Black PLA

One of these pieces will go in each corner and I’ll hold them in place with some black M3 button head screws. This will also allow me to remove the main clear side panel after it is built for maintenance.

Corner Pieces Screwed Onto White Side Panel
Black Button Head Screws To Secure Corner Pieces

With that done, I’m going to also temporarily screw on the clear side panel to hold the corner pieces square while we glue the other edge pieces into place. This will give the whole case a bit of rigidity while we work with it.

To glue each of these pieces into place, I’m going to use some super glue. I don’t often use superglue, but it works well for bonds between acrylic and PLA and is quick and easy to use in this case.

Super Glue Side Panels Into Place On Corner Pieces
Sticking Front Panel Into Place

Once the four edge pieces are glued into place, we can remove the clear side panel and add the black accent pieces.

Gluing On Black Accent Pieces

I’m going to use weld-on 3 to glue these into place. This is a water-thin adhesive that is great for producing strong acrylic bonds that are virtually invisible. You could also use superglue for this, but you have to be careful to not create white vapour marks on the black acrylic.

While I’ve got the weld-on 3 out, let’s also glue the retaining ring on the back of our water cooling bracket. This will hold the cooling block in the right place over the CM4 module.

Gluing Retaining Clip Onto Cooling Water Bracket

With that, the acrylic part of the case is mostly complete, so we can move on to installing the hardware.

Installing The Computer Hardware Into The Case

Let’s start off by putting our Raspberry Pi CM4 module onto our IO board and checking that the bracket that we’ve made lines up correctly.

I’m going to be using some M2.5 brass standoffs, M2.5x12mm button head screws and M2.5 nuts to secure it. The nuts and standoffs will hold the CM4 module in place, although they’re mainly there to support the cooling block bracket. I’m not even going to tighten them as they’ll then bend the CM4 module and I might break some of the surface components.

Mounting Standoffs onto CM4 Module

I’m going to add a small thermal pad between the cooling block and the CM4 module to assist with heat transfer between the two components.

With the bracket installed, it looks like it fits quite well and we should have enough room to get out tubes past the standoffs on the inlet and outlet.

Ports on Water Cooling Block

Mounting The Raspberry Pi IO Board In The Case

Now let’s mount our completed Raspberry Pi IO board in the case. Rather than drill holes through the side of the case and then have nuts stick out the outside, I’ve 3D printed some supports to each hold an M2.5x4mm brass standoff. I’ll glue these onto the white side panel and these will then hold the board in place.

3D Printed Standoff Holders

We just need to trial fit the board to get the position of each standoff and we can then glue them into place. I did this a couple of times to be sure before actually gluing them down, but it seems to have worked well.

Pi IO Board Mounted Into The Case

Mounting The Front Panel Components

Next, let’s move on to mounting all of the components required on the front panel.

First, I’m going to mount the fan to the radiator and I’ll then mount the complete assembly onto the front panel. This way I don’t have to try to fit a screwdriver within the case.

Securing Noctua Fan To Cooling Radiator

The holes on my radiator don’t align very well with the holes on the case, but I was able to get them in eventually. For some reason, the radiator seems to be a little narrower than it should be, so the holes aren’t quite square.

Radiator Mounted Onto Front Panel

The black radiator against the white front panel is starting to look quite good, now we’ve just got one final touch to add – our Raspberry Pi logo which I glued into place using some superglue.

Stick Raspberry Pi Logo Onto Radiator

I 3D printed a rectangular housing to hold the two USB ports together. We need to trim a little bit of the plastic off around each port so that the port sits flush with the front of the acrylic rather than behind the acrylic. We can do that with a craft knife.

USB Ports In 3D Printed Holder

We then also need to cut the other end off of the cables and add some female header pins to them. There are only four pins on each, two for power and two for data, but I’m going to use a 5 pin cover to match the 5 pin arrangement on the IO board so that I know which way around to plug them in. You might find that one of the leads on your splitter only has two wires for power. If this is the case then you’ll need to use a port from a second splitter as well because you need to have all four wires in order to transfer data.

USB Header Pins on IO Board

The pins are crimped onto the stripped ends of each wire using a Dupont crimper and the plastic cover or holder then slips onto each pin to hold it in place. You’ll notice the wiring arrangement matches the above pin layout from the IO board’s schematics.

Removing Cable Connector and Replacing it with Dupont Connectors

Now that we’ve got the pins on, let’s glue the USB ports into place.

Mounting USB Ports onto Front Panel

I’ve gone ahead and added some leads and female pins to the power button, which is just held in place with a nut on the inside. The power button has four wires, two for the LED ring light which I can just plug into any 3.3V and GND GPIO pins and two for the switch contacts. You’ll need to also solder a 220-750 ohm current-limiting resistor onto one of the LED legs to protect it. The higher the resistance, the dimmer the LED will be, so choose this to suit your preference.

Adding Wiring To Power Switch

I’m going to connect the power button’s contacts to pins 13 and 14 on header J2 as outlined in the documentation. This probably means that the button won’t work to shut down the Raspberry Pi, it’ll only wake it up once it is off, but I can live with that.

Power Switch Used To Wake Raspberry Pi CM4 Module

I’ve also 3D printed a holder for the display which we can also glue into place. The display just used some 20cm breadboard jumpers to plug into the power and I2C GPIO pins.

Plugging Ribbon Cable Into I2C OLED Display
Wiring Connected To Raspberry Pi IO Board

Making The Reservoir & Completing The Water Cooling Loop

I couldn’t find a reservoir that is small enough for this size case, so I’m going to make a custom one up using a small clear container. This is easier than trying to glue acrylic pieces together with the hope that it will eventually be watertight.

It just needs to be tall enough to hold the pump, so we can trim down the bottle quite a bit.

Making Up The Reservoir Using an Old Container

I’ve designed and 3D printed some caps to go onto each end which will also be used to mount the reservoir onto the side of the case.

3D Printed End Caps For Reservoir

We can then push one end of the tube onto the pump, put the pump into the reservoir and then install the two end caps using some hot glue. The hot glue seals up the edges a little so that if the case is bumped, the coolant doesn’t spill out of the reservoir.

Completed Reservoir With Tubing and Pump

I’m going to use a section of foam strip to stick the reservoir to the side panel to dampen any vibrations from the pump which will hopefully result in a quieter running system.

Foam Strip Used To Mount Reservoir

I’ve installed the reservoir near the top of the case so that there is less risk of it overflowing and it’ll make it easier to top up.

Reservoir Mounted Into Case and Flexible Tubing Connected

I’ve run the flexible tubing on the shortest paths between the components. The cooling block should probably rather have had the upper port as the outlet on the return back to the tank so that air is less likely to be trapped in the void, but this complicates the tubing run to the radiator, so I’ve run it like this.

Installing The NVME Drive

Next, we can move on to installing our NVME drive. We need to remove the metal bracket that is supplied with the adaptor. They give you a shorter one as well but we don’t need these on this build as it’s not a standard case size.

Removing Metal Bracket From M.2 to PCIe Adaptor

We can then plug our SSD into the adaptor, add the small screw to secure the drive and plug the adaptor into our PCIe slot.

Installing NVME Drive Onto Adaptor

Finishing Off The Ultimate Raspberry Pi Desktop Computer Build

To finish off the case, we just need to glue on the acrylic accent pieces. These fit into the holder on the 3D printed corner pieces and I’ll glue them in place with some superglue.

Corner Accent Pieces To Be Glued Onto 3D Printed Brackets

We can then fill up the reservoir, then close it up with a 3D printed plug and screw on the clear side panel. I’m going to use opaque white coolant in the system to match the white acrylic. It would also be good to eventually get some white sleeving for the cables to neaten them up a bit in the future as well.

Filling Reservoir With White Coolant

Let’s peel off all of the remaining protective film and see what it looks like.

Removing Protective Film From Outside of Case
Raspberry Pi Desktop Computer Case Complete

Final Thoughts

I’m running Raspberry Pi OS Bullseye on the Pi and I obviously had to do some additional setup to get it booting off the NVME drive, to get the display working and even just to activate the USB ports because they’re disabled by default.

But it’s all working correctly now and I can use the front USB ports for basic interfaces. I haven’t read too much into the documentation but I suspect that these are only USB 2.0 ports. That’s ok for using them for accessing documents and small files on a flash drive or using basic USB peripherals.

Flash Drive Plugged Into Front USB Port

Let me know what you think of the Raspberry Pi computer build in the comments section below! Is there anything you think I missed or should have done differently? I was thinking of maybe bringing out the GPIO pins to one of the 3D printed corner pieces, perhaps one of the two at the top?

Grafana Weather Dashboard using InfluxDB and an ESP32 – In-Depth Tutorial

Following one of my previous projects where I built a weather station dashboard using InfluxDB and Grafana on the reTerminal, I had quite a few requests to do a more in-depth tutorial on how to get each part set up and running. So in this tutorial, I’m going to be going through each part of the process, step-by-step, so that you can get a similar setup running on your Raspberry Pi.

In this example, we’re going to use an ESP32 as our data collection node to collect temperature, humidity and pressure readings from some attached sensors. It’ll then post these readings to an InfluxDB database and we’ll then use Grafana to visualise the data. Don’t worry if you don’t understand what these are or how they work together just yet, I’ll explain them each in more detail as we work through them.

Data Arrangement Between Applications

Here’s my video tutorial, read on for the written tutorial:

Note: This tutorial assumes that you know the basics of using and programming an ESP32 development board using the Arduino IDE and using a RaspberryPi, including some terminal commands.

What You Need For This Tutorial

You’ll also need a monitor (my portable monitor shown at the end), keyboard and mouse for your Raspberry Pi in order to install and set up your Grafana weather dashboard.

Some of the above parts are affiliate links. By purchasing products through the above links, you’ll be supporting my projects, with no additional cost to you.

Setting Up Your ESP32 Microcontroller To Capture Sensor Readings

Connecting Your Sensors To Your ESP32 Microcontroller

Let’s start with setting up the ESP32 microcontroller and sensors.

You’ve probably seen people use a Raspberry Pi for this part as well, but I prefer to use a microcontroller like an ESP32 or Arduino for a number of reasons.

The first, and probably the most important, is that once you’ve programmed your microcontroller, you can switch it on and off as often as you’d like without having to go through a shutdown and bootup process. You don’t have to worry about it corrupting its memory card or locking up. It is entirely dedicated to the task you’ve programmed it to do and it’ll do it very reliably, even when you’ve had power interruptions.

ESP32 Can Be Turned On And Off As Required

The second is its power consumption, which really comes into play if you’re building a battery-based project.

You’ll struggle to get even a Raspberry Pi Zero W to run at under 260mA or a little over 1W, while I’ve managed to get an ESP32 based device like the Firebeetle board used in my weather station to run as low as 0.01 mA, or at an average of 1 mA when transmitting data over WiFi. So this is over 250 times more power-efficient, meaning that it can either run 250 times longer than the Pi or you can use a battery 250 times smaller than with the Pi – both of which can be a huge advantage.

Using Less Than 0.01mA When Running

We’re going to connect two sensor modules to our ESP32, the DHT11 sensor on the left connected to pin 4 for measuring the temperature and humidity and then a BMP280 sensor on the right connected to the I2C interface to measure atmospheric pressure.

Sensor Circuit Diagram

I’m going to connect the two sensors to my ESP32 on a breadboard using some jumpers for this example so that it’s easy for you to follow. The sensors I’m using are also from Seeed studios, they call them grove sensors and they’re particularly useful for people who are new to electronics because they include all of the components required to drive the sensor on the PCB so you don’t need to worry about adding resistors or making multiple power connections to drive them. I’ve cut the ends off the grove connectors to plug them into my breadboard, you could do this or just plug your jumpers straight onto the grove sensor pins.

Components Set Up On Breadboard

We can then connect our ESP32 to our computer and use the Arduino IDE to program it.

Sending Our Sensor Data To InfluxDB

Now that our sensors are connected, we want our ESP32 to take readings from them and then post these readings to an InfluxDB database over WiFi.

InfluxDB is a time series database package, which you can think of as a sort of large excel spreadsheet where each data point that you send to it will be stamped with the date and time that it was received. So if you send it a temperature reading, it’ll stamp it with the date and time that it was received and then store it in the table. This makes it really useful for any information that changes over time – like a weather station.

This database can either exist in the cloud, on InfluxDB’s servers, or it can be installed on our Raspberry Pi and run on our local network. I’m going to use InfluxDB’s servers in this example because this option works well if you’ve got a number of microcontrollers collecting information that are not all on the same network and it also allows you to reboot and make modifications to your Pi’s software without interrupting the collection of data as well. Either way, this setup process is largely the same for both options.

InfluxDB Running In The Cloud

Programming Our ESP32

Let’s have a look at our code and how to get the information into our database. I’ve put together this example sketch which I’m going to load onto it.

Download the example sketch from my GitHub repository.

You’ll need to have installed the ESP32 board using the IDE’s boards manager. Then make sure that you’ve got your board selected as “ESP32 Dev Module” and check that you’re using the correct COM port.

Make Sure That The Correct Board Is Selected

In the code, we start by importing our required libraries, these are basically packages of code that have been written to make it easier to interface with certain devices or objects. So for example, the DHT.h library contains all of the code required to communicate with our DHT sensor and we can then just use a single line in our code to ask this library to send us the temperature reading.

We’ve then got a section to define our WiFi and InfluxDB connection settings. Don’t worry too much about these yet, they’ll make sense when we get to the Influx DB setup portion of the tutorial.

We then need to create two sensor objects using our libraries, create three variables to store each of the fields that we want to measure and then set up our InfluxDB connection.

We then have our setup function, which is a set of code that is run just once when the ESP32 is first switched on.

This function starts communication with our computer for debugging, then sets up our sensors using the libraries we called up earlier, then connects to our WiFi network and then connects to our InfluxDB database.

Next, we have our loop function. This is a set of code that is run over and over as long as the ESP32 continues to be powered. So in our case, we add another line of readings to our table in our database each time we loop through this set of code.

First, we use our DHT11 and BMP280 libraries to get the current sensor readings from the two sensors.

We then tell our database library which column of our table each of these values should be stored under.

We then check our WiFi connection and re-connect to the network and database if we need to.

Finally, we write our measured values to our database as a single line of data so that the three measured values will all have the same timestamp.

This last portion of the code just displays the measured values on the Serial monitor, which makes it easier to debug. We can then check that the information that is showing up in our database is the information that our ESP32 is measuring.

Before we go ahead and upload the code to our ESP32, we need to add those network and database parameters at the beginning of the code.

The first two are our WiFi network name and password, so we can enter those right away. Remember that the network name is also case sensitive and needs to include any spaces or underscores as well.

The next five parameters are all required for our InfluxDB connection, so we’ll need to open up InfluxDB and create our database before we can finish this off.

Creating Our InfluxDB Database

Create an InfluxDB Account

Now that we’ve got our ESP32 set up to record the data from our sensors, we need a place to store the data. So let’s go to influxdata.com and then go to “Login” in the top right and click on “Login to InfluxDB Cloud 2.0”.

You’ll then be given an option to log in to your existing account or sign-up for a new account. I’m going to register a new account for this tutorial.

Once you have confirmed your email address, you’ll arrive at this page. You can leave the default Amazon Web Services provider, just select your correct region, then enter your name or company name and tick the box if you agree to their service agreements.

Create InfluxDB Account

You’ll then be asked to select a plan. Unless you’re wanting to capture large amounts of data or store the data for long periods of time, the free plan will be fine.

Select InfluxDB Plan Type

You should then arrive at your home page.

Get Your Database Connection Details

InfluxDB have already done some work on interfacing with Arduino based devices, so we can take advantage of that to make the integration easier. So let’s click on “Load Your Data” and then find the “Arduino Client Library”.

InfluxDB Client Library Options

Now you’ll see two boxes with a generic API token and bucket, and below that are some prepopulated snippets of code.

InfluxDB Arduino Interfacing Options

We can then just copy these fields across to our Arduino sketch. My sketch is based on this example code, so you can just copy the whole snippet and replace the section in my sketch if you’d prefer.

It’s perfectly fine to use this generic token and bucket, but if you’re going to be using multiple devices to capture data and if you want to set an expiry on your data so that it’s automatically deleted after a period of time then you’ll want to create your own, which you can also do right from this page, so let me show you how to do that as well.

First, let’s create our Token. This is basically a key that allows an external device to read, write and manage the information in our database. We can set this up with customizable options to limit what the device with the key can do, but for simplicity let’s just create an “All Access API Token”. This will enable our device to read, write and modify our database.

Give the token a name, which is commonly the device name, then click save. We can then copy this token and replace the one in our Arduino sketch.

Creating A New API Token

Next, we want to create our bucket, which is essentially a fresh database. In InfluxDB each database needs to have a retention policy. The retention policy is how long data is stored in the database before being automatically deleted. This prevents the database from becoming bulky and slow to query, so it should be chosen based on how often you’re writing data to it and how long you expect to need to see historic trends.

In our case we’re only going to be writing to our database every few minutes, so let’s go with 30 days. This will also allow us to visualise monthly trends as well as highs and lows on our dashboard.

Creating A New Bucket

Make sure that the new bucket is selected and we can then go down to the code and copy the field across to our sketch.

WiFi & InfluxDB Parameters

The last field to set in the sketch is the timezone, this should be set correctly so that your database entries are stamped with your local time, which you’ll need to establish yourself. They give you some examples for common locations and a web resource for naming other locations, mine is set up for Sydney Australia.

Adding The Database Connection Details To Your Sketch

With our InfluxDB and network settings added to our code as above, we can now upload the code and make sure that our ESP32 is writing the information to our InfluxDB database.

I’m also going to quickly change the delay between readings to 5 minutes as the indoor temperature and humidity don’t change that quickly.

Once your code has successfully been uploaded to your ESP32, open up the serial monitor and check that you’re getting the expected feedback. This will also give you the latest readings that are being taken from the sensors. Any errors in connecting to the WiFi network or InfluxDB should also come up here.

Serial Monitor Output Details

Now we’ve got our information being sent to and stored in our database, but it’s pretty intimidating to look at a table full of numbers, so we need a way to gather the information we’re interested in from our database and display that information in a format that’s easier to visualize and that’s where Grafana comes in.

Data Saved To InfluxDB Table

InfluxDB does now have its own visualisation tools, but I find Grafana to be a lot more powerful and user friendly.

InfluxDB Data Visualisation Tools

Installing Grafana on Our Raspberry Pi

As with InfluxDB, Grafana can be run in the cloud, on their own servers, or on a Raspberry Pi on our local network. For this example, I’m going to be installing and running it on my reTerminal, which is a Raspberry Pi based touch display terminal.

Grafana Running Locally On Our Raspberry Pi

I’m starting with a fresh install of Raspberry Pi OS Buster, and we can install Grafana by entering the following commands into our terminal.

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add –
echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana-enterprise

Once we’ve got Grafana installed, we then need to start the application, you’ll see in your terminal window from the previous step that it explains to you how to start the service and verify that it is running.

Commands To Start Grafana Server

So let’s enter those commands:

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server

You should then see a green message like this saying that it is running.

Grafana Server Running

Lastly, we need to set it to automatically run on start-up.

sudo systemctl enable grafana-server.service

Creating Our Grafana Weather Dashboard

Connect Grafana To Our InfluxDB Database

With Grafana now running on our Pi, we can access the dashboard by opening a new browser window and entering the URL – http://localhost:3000/login

You’ll then need to enter your username and password, the defaults are admin for both, and you’ll probably then be prompted to create a new password.

Login To Grafana

Now that we’re on the Grafana user interface page, we need to configure a data source to be able to read the information stored in our InfluxDB database.

So let’s click on “Add your first data source”.

We can then choose our data source type, which in our case is InfluxDB and we’ll then land on a configuration page like this.

Configure New Data Source

This is a similar process to the one we followed to allow our ESP32 to write information to the database, we’re now just telling Grafana how to read information from the database.

You can change the name of the data source if you’d like, I’m going to leave it as InfluxDB.

Next, we’re going to change the Query Language to Flux. Flux is more of a scripting-style query format rather than an SQL query format, so is a bit more versatile than InfluxQL.

The URL is the same as the one used in the Arduino code, so we can just enter it or copy it across from our code.

You can leave most of the default settings selected for now.

Let’s add our username and password here.

Enter Login Details

Then lastly we need to enter our database details.

InfluxDB Settings

These are the same details that we used in the Arduino sketch, with the exception of the token. The token is similar to the ESP32 token except that that token could be a write-only token and this could be a read-only token. I say “could” because they’re just “all-access” tokens in this example, but in practice should be read-only or write-only. So let’s open InfluxDB to generate this token.

We’ll go to tokens, then click on Generate API Token.

I’m going to create this as an all-access token again, but you can configure it as a read-only token if you’d like.

Create A New Grafana API Token

Then we just need to copy the generated token over to our configuration page.

I’m going to set the minimum time interval to 60s as we’re only writing to our database every 5 minutes and I’ll leave the max series as 1000.

Now click on “Save and Test” to see if Grafana is able to access your database.

Test New Database Connection

If it has worked correctly then you should get a green tick and it’ll tell you how many buckets have been found.

So that’s great, we can now move on to creating our dashboard.

Creating Your First Dashboard Panel

Let’s go back to our Dashboard’s home page using the menu bar on the left. We can then click on this box on the right side to create our first dashboard.

Creating A New Grafana Dashboard

A dashboard is a page that is used to display a set of information. We’re going to create a single dashboard to display our three weather parameters. Each of the graphs or gauges that we want to display can be created in a panel, so let’s create our first graph by clicking on “Add a new panel”.

We then get a page that gives us a number of options to set up what data is displayed and how it is displayed. It might look quite intimidating the first time you land on this page, but it’s quite simple once you get the hang of it.

Grafana Panel Editor

Using the toolbar on the right side you can configure how you want the information displayed, like the title, axis labels and colours. At the top of this section, you can choose the type of visualisation, like a time-series graph or an instantaneous indicator gauge.

Using the toolbar at the bottom, you can configure your database query that selects what information from your database is displayed.

Let’s enter our first query to get the temperature information from our database.

Setting Up New Flux Query

We start by telling it which bucket to read the information from.

We then select the range to look at, we’re going to look at the past day.

We then need to add a filter to tell it which field to look at, we’re going to be using temperature first.

Lastly, we’re going to name the set of data returned as “_results”.

If you click on the graph area, it’ll run the query and you should now see a data trend being displayed as a time-series graph.

Editing The Time-Series Graph To Look The Way We'd Like

We can then configure how we can this information to be presented by making changes to the graph’s parameters on the right. Try changing each of these fields and see what effect it has on the displayed graph, you can’t really mess it up too much and if you do you can just set it back to the original value or setting.

You can changes things like the title and axis labels, add trend lines and legends, and even change the series colours.

Creating The Rest Of Our Dashboard

Let’s do the same for the humidity and pressure as well.

Grafana Three Graphs On Dashboard

We’ve now got three graphs that show a time-based trend of our data, but it’s difficult to see what the current values are, so let’s create an instantaneous gauge for each parameter by following the same process.

We can use the same query as we’ve done previously but instead of one day, we only need the data recorded in the past 5 minutes as this is how often we’re taking new readings.

Creating A New Gauge In Grafana

Gauges are quite a useful visualisation tool as you can set up limits and define coloured thresholds or bands showing the normal and extreme conditions for each metric or field.

I’m really just scraping the surface of what you can do with each of these visualizations, so you should definitely read up a bit more about what options are available and try customizing yours further.

The last thing I want to add is a bit more information on the high, low and average values for the past 24 hours. We can do this quite easily by adding these values to each graph’s legend.

Adding A Legend To Each Graph

Search for each value in the text field, or select them from the drop-down list. I’m also going to change the legend mode to Table rather as I prefer the way this presents the values.

Resizing The Dashboard To Run In Fullscreen Mode

This dashboard looks fine if we’re viewing it on the web, but if we want to use it on something like a touch display, then we don’t want the browser and toolbars to be visible, we just want to see the information on the dashboard.

We can do this by first hiding the taskbar and browser toolbars by setting the browser to fullscreen mode.

Zoom In On Graphics

Then we can hide the Grafana toolbars by cycling the view mode using the icon in the top right.

Cycle View Mode

We can also then re-size the panels to suit the fullscreen mode on our device.

That’s it, we’re now done creating our first Grafana dashboard from data that we’re recording to InfluxDB using our own sensors and microcontroller.

Complete Grafana Dashboard

Remember to save your Dashboard before exiting or leaving it running.

Save Dashboard

This is a really basic example. There are loads of tools and plugins available to create really powerful graphics and trends, so do a bit of reading up on them and try creating some unique ones for your data.

Grafana Dashboard Running On An External Display

I hope this tutorial was helpful, let me know what you’re going to be using your new Grafana dashboard to monitor in the comments section below.