Home Blog Page 14

Solar Powered Crypto Miner Using A Raspberry Pi

A common question I’ve seen across a number of my Raspberry Pi projects and videos is whether you can use a Raspberry Pi to mine cryptocurrency. The answer to this question is yes, it is technically possible, but probably not in a way that is going to make you any amount of money. In fact, you’ll be lucky if you ever make enough money to even recoup the hardware cost.

With that said, instead of just showing you how to mine cryptocurrency on a Raspberry Pi, I thought why not make it a bit more interesting and make it solar powered as well. That way we don’t even have to worry about offsetting the electricity costs associated with running the crypto miner. So in this project, we’re going to be building a solar powered crypto miner using a Raspberry Pi.

Now since we’re already heading down a road to no profit, there’s not much point in going overkill and trying to solar power a cluster of Pis or even a single Pi 4. I’m rather going to try and get away with building the cheapest setup possible to show you how long it would take to pay it back and start making some money.

Here’s a video of my build and setup of my solar powered crypto miner using a Raspberry Pi, read on for the full write up.

What You Need To Build A Solar Powered Crypto Miner

Note: 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.

Assembling The Solar Powered Crypto Miner

The brain behind this project is a Pi Zero W. It’s one of the most power-efficient Raspberry Pis available and it’s got built-in WiFi, so we don’t need to worry about powering any external dongles or running network cables.

Raspberry Pi Zero W

What Size Solar Panel Do We Need?

To start out we need to figure out how much power our Pi Zero W uses when it is running and connected to WiFi so that we know what size solar panel we’re going to need to power our crypto miner.

We’re going to install Raspberry Pi OS Lite as we’ll be running this as a headless setup and we’ll access the Pi over our WiFi network for any additional work we need to do in order to set it up.

I usually just use Raspberry Pi imager to burn the image to the SD card. Select Raspberry Pi OS Lite as the operating system, then choose your connected SD card as your storage location and then click on write to begin burning it to your card.

Raspberry Pi Imager

When this is done, you’ll need to remount the disk and open the boot directory. Next, create a next blank text file in the boot directory and rename it “ssh” with no extension.

Adding SSH To Boot Directory

You’ll also need to set up a “wpa_supplicant” configuration file that tells your Pi how to connect to your WiFi network. You can download the template below, then just update your network name and password and save the file.

WPA Supplicant File

The last thing to do is to change the extension from .txt to .conf and then copy it into the boot directory as well.

Adding WPA Supplicant To Boot Directory

I’m going to boot the Pi up and use a USB power meter to measure the amount of power the Pi uses when idling and when transferring data over WiFi.

Testing Pi's Power Consumption

It looks like our Pi uses just under 100mA when idling and this spikes to about 130mA when using WiFi. So we need a panel that is able to produce at least 1W and we need a little extra for when a cloud comes over or it’s not in full sun.

USB Solar Panel

I’m going to use this 5W panel which is designed to charge mobile phones. This will provide up to 1A at 5V, which should be more than enough to keep the Pi powered and will produce a bit extra to power the Pi during times when it is overcast or not in full sun.

Adding A Charge Controller And Battery

Now that we’ve got our Pi and our solar panel, we just need to add a charge controller and a battery.

Charge Controller And Battery

Now you might be thinking why don’t I just plug the Pi directly into the USB port on the solar panel. I could do that and it would probably work when the panel is in full sun, but if there is a disturbance to the light on the panel, then the panel would immediately stop providing sufficient power to the Pi and the Pi would turn off or reboot. Obviously, this would only need to happen a couple of times before the SD card is corrupted.

USB Cable On Solar Panel

So we add the solar charge controller to take the power from the panel and use it to charge a battery and then use the battery to power the Pi. This way when there is an interruption to the solar panel’s power, the Pi is still powered by the battery.

DF Robot Solar Charge Controller

This charge controller comes from DF Robot, it takes the input from the solar panel and uses it to charge a 3.7V lithium-ion or lithium-polymer cell. It then uses the battery to provide a regulated 5V supply to the USB port and some header pins. It’s also got a number of safeguards and an over-discharge feature to protect the battery.

I’m using a single 2500mAh 18650 lithium ion battery, which should be able to power the Pi for a maximum of about 8 hours. If you want the rig to be able to run through the night then you’ll need to add a second or third battery in parallel to store the additional energy from the solar panel.

The 5W solar panel should provide enough power to run the rig continuously through the day and night with some buffer for short overcast periods of a couple of hours if you add two additional 18650 batteries (3 in total) in parallel.

I’m going to connect new leads directly onto the tabs on the panel as I suspect that there is a regulator between the USB lead and the tabs which we don’t need. I’m going to test these tabs first using my multimeter in order to get the polarity correct when connecting it to the charge controller.

Testing Solar Panel With Multimeter

Next, I’m going to use a soldering iron to solder the new leads directly onto the tabs.

Soldering Leads Onto Solar Panel

We can then connect the solar panel and the battery to the charge controller. I’ve used a battery holder which has a built-in USB charging circuit, which I’m not going to use for this project. The one linked in the parts list is just a standalone single cell holder.

Connecting Panel and Battery To Charge Controller

I then glued all of the components onto the back of the solar panel using some nylon standoffs so that I can mount it onto the GoPro suction cup mount and stick it onto an outdoor window.

All Components Connected On Solar Panel

Once this is all done, we’re ready to plug in the micro USB cable between the charge controller and the Pi and let it boot up.

Pi Plugged In And Booting Up

Stick the crypto miner up in a sunny spot so that the solar panel starts charging the battery and supplying power to the Pi.

Back Of Solar Powered Crypto Miner

Setting Up The Mining Software

Now that your solar powered crypto miner is in the sun and plugged in, your Pi should boot up and connect to your WiFi network automatically. You’ll need to find its IP address, which can be done in a number of ways. The easiest I find is to log into my router and find it in the DHCP table.

You can then access the Pi through an SSH connection using a utility like Putty. Type in your Pi’s IP address, make sure that SSH is selected and then click on open to open a new terminal window.

Putty to SSH Into Pi

Login with the default username (pi) and password (raspberry), which you should probably change if you’re going to be using your Pi for any period of time, and then run the usual updates and upgrades by typing in the following command:

sudo apt-get update && sudo apt-get upgrade -y
Raspberry Pi Update and Upgrade

While your Pi ticks away at the updates, head over to Minergate to create an account to join a mining pool. If you don’t know what a mining pool does, it’s essentially a group of people who put all of their resources together to collectively mine cryptocurrency, and the profits are then divided among participants based on their level of contribution to the pool.

Once the updates are complete, install the below dependencies by running this command:

sudo apt install git automake autoconf libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev

We’re going to be mining for Monero using cpuminer-multi. So we’ll need to download the GitHub repository by running this command:

sudo git clone https://github.com/carolinedunn/cpuminer-multi
Get cpuminer multi

When the repository has been downloaded, navigate to the directory:

cd cpuminer-multi

We then need to compile the code using the following commands:

sudo ./autogen.sh
sudo ./configure
sudo ./build.sh

These do take a while to get through, particularly the last one.

Mining Monero On A Solar Powered Raspberry Pi

Once this is all done, we’re finally ready to start the crypto miner and start contributing to the pool. Enter the following command to start mining on your Pi:

./cpuminer -a cryptonight -o stratum+tcp://xmr.pool.minergate.com:45700 -u MINERGATE_EMAIL_ADDRESS

When it starts running, you should see some figures being displayed alongside “CPU #0”. This is the hash rate of your Raspberry Pi.

Running The Miner

Ours is sitting at a dismal 1.47 hashes per second. Which is really bad!

In order for you to be making any meaningful money from mining Monero, you need to be above about 100 kilohashes per second. So we’re sitting at almost 100,000 times less than this limit at the moment.

Let’s use CryptoCompare’s profitability calculator to have a look at how much money we’d make if we could leave this setup running for a month or a year.

Monero Earnings Conversion Chart

So at 1.47 hashes per second, we would be earning $0.0057 per month or $0.069 per year. So it would take almost 220 years of mining just to pay off the Raspberry Pi.

So you can see that crypto mining on a Raspberry Pi, even with free electricity, is just not that practical. Your Pi would need to run far longer than the expected life of the equipment to even pay back the hardware cost associated with it.

I’m going to try to set something similar up on my water-cooled Pi cluster as well to see how many years that would take to pay off. So, subscribe to my newsletter or my Youtube channel so that you don’t miss out on that, and let me know your comments and thoughts on my solar-powered crypto miner in the comments section below.

Connect and Program An OLED Stats Display For Your Raspberry Pi

In this guide, I’ll show you how to program a 128×64 I2C OLED stats display as a quick dashboard for your Raspberry Pi. I use this script on my Raspberry Pi Desktop Case and a lot of people have asked me for some more in-depth setup and programming instructions to get it running.

You can make your own Raspberry Pi Desktop case by following my build guide, or buy a premade kit from my Etsy store.

This guide is written specifically for a Raspberry Pi 4B running Raspberry Pi OS Buster, although you should be able to work through it for other Raspberry Pi models.

Update: For those running Raspberry Pi OS Bullseye, please use my revised guide.

Raspberry Pi Desktop Case

Here’s a video guide to connect and program the OLED stats display, read on for the full written guide and script modifications.

What You Need For This Project

Amazon Affiliate Links

Banggood Affiliate Links

Connecting Your I2C OLED Stats Display To Your Raspberry Pi

We’ll start by hooking the display up to the Raspberry Pi. To do this, you’ll need a 4 wire female to female jumper cable. The colours on the cable don’t matter, they’re just there to help you keep track of which wire goes to which terminal.

I2C OLED Display and Ribbon Cable

The OLED display’s pins are labeled on the front, which seems to confuse a lot of people, especially when they’ve installed the display into a case or housing and the front area above the screen is no longer visible.

I2C OLED Display Front and Pin Labels

These are most commonly GND, VCC, SCL, and SDA. Don’t just copy this arrangement though, make sure you check your own display as there are versions of this display that have the VCC and GND pins the other way around.

OLED Display Pinout

These displays don’t have reverse polarity protection, so if you connect them incorrectly (even just once) then it’s quite likely that they’ll be damaged and will no longer work, even if you correct the wiring afterward.

I2C OLED Display Rear

Plug your ribbon cable into these pins and then make a note of which colour you’ve got connected to which of the four pins. If you’re installing the display into your case before connecting it then it’s a good idea to write down which colour is connected to which pin so that you don’t forget.

Plug Ribbon Cable Into Display

Next, you need to plug the other ends of the jumpers into your Raspberry Pi’s GPIO pins. The Pi’s GPIO pinout diagram can be found quite easily online and is available on the official Raspberry Pi website.

Raspberry Pi 4 Pinout
Source: RaspberryPi.org

Make sure that your Pi is off and the power is disconnected before plugging or unplugging jumpers from the GPIO pins. You don’t want to short a connection or plug a lead into the incorrect pin by mistake and not have a chance to check your connection before powering it up.

You’ve got a few options for the GND and VCC jumpers. I usually plug the GND jumper (mine is green) into Pin 14, but you can use any pin labelled Ground. I plug the VCC jumper (mine is blue) into Pin 1, which is a 3.3V power pin. Again, you can use any of the 3.3V or 5V power pins as this display can run on both 3.3V and 5V.

Connect Power Cables To Raspberry Pi

Next, we need to connect the communication jumpers SCL and SDA, which just get plugged into the corresponding GPIO pins. Plug SCL (mine is purple) into Pin 5 and SDA (mine is white) into Pin 3. Don’t get confused between the GPIO numbers and the Pin numbers, ignore the GPIO numbers on the diagram and just go by the SDA and SCL labels and the corresponding pin numbers.

Connect Communication Cables To Pi

Check all of your connections again and you’re then ready to power your Pi up and get started with programming the display.

Connections Between Pi and OLED Display

Programming The OLED Stats Display

Once you’ve booted up your Pi, you should be on the Raspberry Pi OS desktop. It’s possible to do this installation on a headless Pi as well, it’s just easier to make the required layout changes to the script in the full version first.

Enabling & Testing I2C Communication

To get the display to show our Raspberry Pi’s performance stats, we’re going to be running a Python script. Before we do this we need to enable I2C communication on the Pi as this is how it communicates with the display. You can either do this through the preferences menu or by typing this command into a new terminal window:

sudo raspi-config
Enable I2C Communication

Select interfacing options, then I2C and then select Yes and then reboot the Pi by typing in the following command:

sudo reboot

Once your Pi has rebooted, you need to check that the following 3 libraries have been installed. You may already have them installed, but it’s worth checking. Run each one of these commands individually in your terminal:

sudo apt-get install python-smbus
sudo apt-get install i2c-tools
sudo pip3 install Adafruit_BBIO
Install The Required Libraries

Once you’ve done that then you can check that your Pi is able to see that your display is connected. You can do this by typing in the following command:

sudo i2cdetect -y 1

You should then see a table, similar to the below, that shows a single pair of characters in it. This code indicates the I2C address of your display.

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I2C Detect Table

If your table is returned blank then you’ve either got a wiring issue or I2C communication isn’t turned on. If you get a table full of characters then you’ve probably made a wiring mistake as this happens if SDA is shorted to ground. Go back and re-check your connections to your Pi and display and re-check that you’ve got I2C communication enabled after a reboot.

Don’t proceed with trying to get the script to work if you don’t get the correct response in this step, if your Pi isn’t able to see the display thats connected to it then it won’t be able to communicate with it to get anything displayed.

Downloading And Running The Adafruit Stats Script

Next let’s have a look at the python script and how to install it.

The script is one of the example scripts provided in the Adafruit Python SSD1306 library, with some tweaks. There is a note on the Github page to say that this is a depreciated library, but that doesn’t mean that you can’t use it or that it will no longer work. It just means that they have developed a better or more recent set of libraries. We’re not so much interested in the library as we are in the stats example script, so we’re going to use it anyway.

Download the script by typing in the following commands:

sudo python -m pip install --upgrade pip setuptools wheel
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git
Download The Adafruit OLED Display Library

Next, navigate to your library’s directory:

cd Adafruit_Python_SSD1306

Then run the setup script to install the library. Make sure that the python version you choose here matches the version you are going to run the actual script in.

sudo python3 setup.py install
Run The setup Script

Next navigate to the examples directory in the Adafruit directory:

cd examples

Then execute the stats script:

python3 stats.py

You should then see your Pi’s stats shown on the display.

Basic Stats Example Script Running

You can see the text isn’t that clear, there are a few weird characters on the display and the CPU temperature isn’t displayed. So we’re going to try and fix those in the following section.

Adjusting The Display Content & Layout

The following steps are done on the Raspberry Pi OS desktop and edits to the script are made in Thonny Python IDE (which comes pre-installed).

Open up the examples folder in the Adafruit library which you were working on in the previous step and use the Thonny Python IDE to open up the stats script so that you can edit it.

Copy these two portions of the script below and paste them into your script on your Pi.

Add the following two lines to the script at the end of the “# Shell scripts for system monitoring from here” section

cmd = "vcgencmd measure_temp |cut -f 2 -d '='"
temp = subprocess.check_output(cmd, shell = True )

Replace the following lines in the “# Write two lines of text” section.

draw.text((x, top), "IP: " + str(IP,'utf-8'), font=font, fill=255)
draw.text((x, top+8), str(CPU,'utf-8') + " " + str(temp,'utf-8') , font=font, fill=255)
draw.text((x, top+16), str(MemUsage,'utf-8'), font=font, fill=255)
draw.text((x, top+25), str(Disk,'utf-8'), font=font, fill=255)
Editing The Content of the Script

Have a look at the video at the begining if you’re unsure about which lines to replace or change.

Running the script you can now see that the characters are gone and the temperature is being displayed alongside the CPU load:

Display adjusted to remove characters

This is where I left the display in my original video, but it looks a lot better if you use a better font, which allows the text to fit into the width limit and uses the full height of the display, so let’s look at that next.

First, let’s change the display size so that we’re using all of the display’s pixels so that the text is a bit clearer. This display is actually a 128 x 64 display, not the 128 x 32 display which is set by default.

Comment out the line near the top which sets the display size to 128 x 32:

# disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST)

And then uncomment the line which sets the display size to 128 x 64:

disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST)
Editing the Display Size

If you run the script you’ll now see that the text is much clearer, but it all bunched up in the top half.

OLED Stats Display Squashed Into Top Half

We can play around with the spacing, but this font is just not great for this stats layout. So let’s now look at changing the font.

Download the font PixelOperator.ttf from https://www.dafont.com/pixel-operator.font and then unzip the contents of the download.

Downloading The New Font

Look for the standard pixel operator font and copy the font into the same directory as your stats script.

You’ll then need to copy the filename of your font, along with the extension, to put into the script.

Comment out the line which loads the default font:

# Load default font.
# font = ImageFont.load_default()

Uncomment the line which loads the replacement font and paste your filename into it, keeping the inverted commas on either side. You can also play around with the font size by editing the number after the font name, I’ve used 16 here.

# Alternatively load a TTF font.  Make sure the .ttf font file is in the same directory as the python script!
# Some other nice fonts to try: http://www.dafont.com/bitmap.php
# font = ImageFont.truetype('PixelOperator.ttf', 16)
Copying New Font In Script

If you now run the script you’ll see that the text is a bit taller and is in your new font, but it’s still bunched up at the top of the display. So the last thing we need to do is adjust the layout.

New Font Being Displayed on OLED Stats Display

Adjusting the layout is a bit of a guessing game until you get it looking the way you’d like it to, or just copy the numbers I’ve used:

draw.text((x, top+2), "IP: " + str(IP,'utf-8'), font=font, fill=255)
draw.text((x, top+18), str(CPU,'utf-8') + " " + str(temp,'utf-8') , font=font, fill=255)
draw.text((x, top+34), str(MemUsage,'utf-8'), font=font, fill=255)
draw.text((x, top+50), str(Disk,'utf-8'), font=font, fill=255)
Editing The Display Spacing

When you’re done, you should now have a clear OLED stats display running on your Pi.

OLED Stats Display Now Showing The Correct Items and Spacing

This script will continue to run and update the display as long as you’ve got your IDE open. But we want it to run all the time and run on startup, so there’s one last thing to do.

Setting The Script To Run Automatically On Startup

Copy the OLED stats display script and the font into your home directory.

Copy Script and Font Into Home Directory

Open crontab by typing the following command into your terminal:

crontab -e

If this is the first time you’re opening crontab then select 1 as your editor and hit enter.

Add the following line to the end of the file to run the script:

@reboot python3 /home/pi/stats.py &
Edit Crontab To Automatically Run On Startup

You might need to change the directory to suit the directory that you’ve got your script saved into.

Also don’t forget the & at the end to tell the Pi to continue starting up and run the script in the background.

Save the file when you exit and then try rebooting your Pi to see if it is working correctly.

If it is all working correctly then you should have a working stats display which starts up automatically each time your Pi boots up.

Programming An OLED Stats Display For Your Raspberry Pi

If you’re using an Ice Tower with your stats display, plug the fan’s power cables in to the 5V and GND GPIO pins next to the display’s connections as shown below.

Plug Ice Tower Fan Into Available IO Port

Let me know what you think of this OLED stats display in the comments section below and let me know what you’re using it for. Have you built it into your own case?

Bitcoin Ticker Using An ESP32 and OLED Display

Today we’re going to be making a desktop Bitcoin ticker using an ESP32 development board and an OLED display. This one has been programmed to display the current Bitcoin price in US dollars, but you could set it up to display any cryptocurrency or even multiples cryptocurrencies in any local currency, as long as there is an API available for it on one of the exchanges.

Bitcoin Cryptocurrency Ticker

Along with the price, it displays the percentage change from yesterday’s closing price. It also lights up either a red or green LED underneath the display depending on whether the price has increased or decreased.

Bitcoin Price

The ticker is powered by an ESP32 development board, which has built in WiFi. It connects to your WiFi network and fetches the updated Bitcoin price through the Coindesk API every 15 minutes. The code is based on Andrew Budziszek’s version on GitHub, with some added functionality for the LEDs and the Bitcoin logo on startup.

If you enjoy cryptocurrencies, then have a look at my recent Bitcoin Full Node which I built on a Rapsberry Pi.

Here is my video of the build and the ticker running, read on for the written instructions to build your own:

What You Need To Build Your Own Bitcoin Ticker

To build one of these, you’ll need an ESP32 development board, an I2C OLED display, a green and red LED and two resistors. I had 100ohm resistors here, but landed up using 330ohm ones for the final assembly.

You can buy a kit for this project, which includes the electronic components, PCB and faceplate here – Crypto Ticker Kit

Components Required

Amazon Affiliate Links

Banggood Affiliate Links

Connecting The Components On A Breadboard

As with most of my projects, I started out by assembling the components on a breadboard to test the connections and the code. My breadboard isn’t big enough to access the pins on both sides of the ESP32, so I just tested the OLED display as LEDs are quite straightforward to connect and program.

There are only four connections to be made, two for power and two for the I2C connection to the display.

One thing to be aware of is that there are two different versions of these displays available on the internet, one which has the GND and VCC pins the opposite way around. Make sure you check the polarity before supplying power to the display or you might damage it.

Assembling Components On Breadboard

Once you’ve connected the display, you just need to upload the code using the Arduino IDE. If this is the first time you’re using an ESP32 board in your Arduino IDE then you’ll need to install some additional software first.

I uploaded the original version of the code along with my network name and password and the Bitcoin ticker came to life.

Designing And Assembling The PCB

I then designed a PCB to mount the components onto. I drew up a circuit diagram and added the LEDs to the circuit. I use Easy EDA to design my PCBs as it is free and web-based, so you don’t need to download or install anything on your computer.

Circuit Diagram

PCBs are a great way to neaten up your projects and make them a lot more durable. I always add a couple of power connections and some additional IO access holes onto my PCBs in case I want to add something at a later stage.

I drew up the PCB, added the traces, silkscreen and some mounting holes.

Bitcoin Ticker PCB Design

PCB Way provided the PCBs for this project for me to share with you. They offer quick turnaround times and are really affordable, with basic PCBs like these from just $5 for 10 pieces and they’re made up in a day or two.

PCB Way Manufactured PCBs

If you’re interested in getting your own PCBs made up, you can use their online quote tool to get an instant price before you place your order.

Bitcoin Ticker Black PCB With White Silkscreen

I ordered these in black as the PCB is going to be visible in the final design of the Bitcoin ticker. I didn’t want to design a case to cover the whole board. As you can see, they’re really good quality boards and they’re well finished off.

Now lets get our components mounted onto the PCB.

The assembly of the PCB is really straight forward. The orientation of the components is shown on the silkscreen. The only part you need to be careful with is the polarity of the LEDs, the flat side of the LED (negative or cathode) should be lined up with the flat side on the silkscreen.

Soldering Components Onto Ticker

Once you’ve got all of your components mounted, you can trim the ESP32 and OLED display pins sticking out of the back of the PCB if you’d like. This is not entirely necessary though.

Making A Cover Plate For The Bitcoin Ticker

Next, I designed a cover plate to protect the PCB. This just protects it from accidental bumps when the Bitcoin ticker is on your desk and prevents a short circuit if anything metallic comes into contact with the pins on the display or ESP32.

I designed the cover plate to be cut from a piece of 2mm clear acrylic.

Designing The Bitcoin Cover Plate

I also added the Bitcoin logo to the cover. I designed a couple of other cryptocurrency options to play around with, so I could convert the ticker to show pricing for Ethereum or Dogecoin as well.

I made up a set of legs that are just cut from some scrap acrylic. They’ll need to be bent at 90 degrees at the indicated markings and these then fit onto the back of the brass standoffs behind the PCB.

I then laser cut and engraved the cover plate.

Laser Cutting The Cover Plate
Laser Cut Bitcoin Ticker Cover Plate

The cover is mounted onto the PCB using some M3 x 10mm brass standoffs and M3 x 8mm button head screws.

I mounted a set of standoffs onto each side of the PCB so that the ticker can then be mounted onto a stand, bracket or shelf.

Brass Standoffs Added
Cover Plate Added

Modifying The Code To Use The LEDs

Now that the Bitcoin ticker is complete, we just need to modify the code to make use of the two LEDs as well. Fortunately, there is already a test in the code to see whether the price has increased or decreased in order to calculate the percentage, so we just need to add the LED pin IO lines to these sections to get them to turn on and off. I also added a line to put the ESP32 to sleep for 15 minutes between updates to save power.

You can download the code from my GitHub Repository.

Once you have downloaded the code, you’ll need to upload it to your ESP32.

Start by selecting the correct board. In Tools > Board select DOIT ESP32 DEVKIT V1.

If this is the first time you’re using an ESP32 board in your Arduino IDE, you probably won’t have the above option, so you’ll need to install some additional software first.

Important – some of the libraries used below (HTTPClient.h) are packaged and installed with the specific ESP32 board installation process outlined above. Please make sure that you follow this process to install the ESP32 board option in your Arduino IDE or you’ll get compilation errors identifying missing libraries.

Select the correct port that your ESP32 is plugged into via Tools > Port.

Windows 11 – Some Windows 11 installations might not have the CP2102 USB to UART driver installed and your COM port won’t show up in the IDE. If you open Device Manager then you’ll see it listed with an error. You can download the driver from Silicon Labs.

You might also need to install a couple of libraries if they’re not installed by default. These are listed in the sketch after //Include the required libraries. If you try compiling the code and are given an error mentioning any of these libraries not being found then try searching for them in the Arduino IDE Library Manager by going to Tools > Manage Libraries. They are all standard libraries found in the library manager.

Also, make sure that you set your WiFi Network Name and Password to your own network. Make sure that these match exactly, they’re case-sensitive and need to include any spaces or characters as well.

Finally, click Upload to upload the sketch.

xreactx has also provided an alternative sketch for Cardano.

I uploaded this modified version of the code and the Bitcoin ticker was then complete.

Bitcoin Logo Displayed On Startup
Connecting To WiFi Network
Bitcoin Price Running On Ticker

Let me know what you think of this Bitcoin ticker in the comments section. Are you going to try to build your own?

Adding AI Vision To A Robot Car Using A Huskylens

Today I’m going to be looking at adding AI line and object tracking to my previously built obstacle avoiding robot using a Huskylens.

A Huskylens is a standalone sensor with a couple of preconfigured recognition algorithms that allow you to easily add AI powered machine vision to your Raspberry Pi and Arduino projects.

Gravity Huskylens AI Vision Sensor

It’s got built in object tracking, face recognition, object recognition, line tracking, colour detection and tag recognition and the best part is that it doesn’t require any internet connection to run. All of the processing is done locally on the Huskylens.

Here’s a video of the modifications done to the robot car as well as the car following lines and tracking objects, read on for the write-up and code:

What You Need To Build Your Own AI Powered Robot Car

Unpacking The Huskylens

This Huskylens was sent to me by DF Robot to try out and share with you.

The Huskylens comes well packaged in a black bubble wrap sleeve within a two compartment box. Measuring just 52mm x 44.5mm, it’s smaller than an Arduino Uno or Raspberry Pi, it’s about the same size as a Micro:bit.

Huskylens Unboxed

The device has two primary inputs. A multifunction menu selector and then a learn button, which allows you to select and learn new objects, faces and tags directly on the built-in 2-inch display. So you don’t need a PC with you to change modes or select different tracking objects.

An OV2640 2.0 Megapixel Camera on the front is the Husklen’s “eye”.

Huskylens Camera

It uses a Kendryte K210 AI chip to run a neural network, which results in pretty impressively fast learning and recognition. Even with relatively fast-moving objects.

Kendryte K210 Neural Network Chip

In the second compartment in the box you’ve got a mounting bracket, some screws and the cable to connect it to a microcontroller.

One thing that’s worth noting is that the included cable has female Dupont/jumper connectors on it. This makes it directly usable with a Raspberry Pi, which has male GPIO pins, but you’ll need to make up an adaptor to use it with an Arduino Uno or LattePanda which typically have female pins.

Screws and Cables Supplied With The Huskylens

The Huskylens runs on 3.3-5V and consumes around 320mA at 3.3V or 230mA at 5V, so its perfect for battery powered projects as well.

Adding The Huskylens To The Robot Car

I’m going to be installing the Huskylens in place of the servo and ultrasonic sensor on the robot car which I built previously. Visit the previous build guide for the 3D print files for the car as well as assembly instructions, obviously leaving out the servo and ultrasonic sensor.

Ultrasonic Sensor On Robot

The car uses an Arduino Uno and a dual L293d motor driver shield to drive four wheels through some geared motors.

L293D Motor Driver Chips

I’ll be mounting the Huskylens onto the bracket which is supplied with it. The bracket is somewhat universal in that it’s got a mounting pattern which could be fixed with a single screw, two screws or mounted onto a servo arm.

Huskylens on Bracket

I’ve 3D printed a small adaptor block to fit into the servo holder on the robot car to screw the bracket into. I just glued this bracket into place using a glue gun.

Adaptor Block For Mounting Bracket

I secured the bracket using a single M3x8mm screw through the centre hole.

Secure Bracket In Place

The Huskylens can communicate using I2C or SPI communication, I’m going to be using I2C because these pins are still available on the motor driver shield. Just like any other I2C device, there are four connections to be made, two for power and two for communication.

I used the GND and 5V pins from one of the servo outputs and then connected the SDA and SCL wires to A4 and A5 respectively.

Huskylens Installed On Robot Car

Now that it’s installed, let’s power it up and have a look at the line and object tracking functions.

Experimenting With Line Tracking

We’ll start by powering up the Huskylens and switching it to line tracking mode.

I’ve drawn a black arrow on a piece of paper, so let’s see how well it is able to pick it up.

We first need to point the crosshair in the centre at the line and then press the learn button to tell the Huskylens that this is the type of line it needs to follow.

Align The Line With Crosshair

You’ll then see it recognise the line and overlay a blue arrow which follows the line around on the display.

Huskylens Line Tracking

The Huskylens is actually impressively fast when tracking a line and picking up direction changes, even when the line is removed and then brought back into the field of view.

I adapted the code from the obstacle avoiding robot to use the data from the Huskylens to follow a black line drawn on the floor using the Huskylens Line Tracking example by Angelo Qiao. There are some functions that have been carried over from the obstacle avoiding robot that are not used in this code but might be useful for future adaptations.

//The DIY Life
//Michael Klements
//16/04/2021
//Huskylens Line Tracking Robot
//Adapted from Huskylens Line Tracking example by By [Angelo qiao](Angelo.qiao@dfrobot.com)

#include "HUSKYLENS.h"                            //Import the required libraries
#include "SoftwareSerial.h"
#include "PIDLoop.h"
#include <AFMotor.h>

AF_DCMotor rightBack(1);                          //Create an object to control each motor
AF_DCMotor rightFront(2);
AF_DCMotor leftFront(3);
AF_DCMotor leftBack(4);

byte motorSpeed = 60;                             //The maximum motor speed
int motorOffset = 15;                             //Factor to account for one side being more powerful
int turnSpeed = 50;                               //Amount to add to motor speed when turning
int leftSpeed = 0;                                //Variables to keep current left and right motor speeds
int rightSpeed = 0;

PIDLoop headingLoop(120, 0, 0, false);            //Set up PID control for the heading, only P used for now
HUSKYLENS huskylens;                              //Create a Huskeylens object
int ID1 = 1;                                      //We're tracking recognised object 1

void printResult(HUSKYLENSResult result);

void setup() 
{
  Serial.begin(115200);                                         //Start serial communication
  Wire.begin();                                                 //Begin communication with the Huskeylens
  while (!huskylens.begin(Wire))
  {
      Serial.println(F("Begin failed!"));
      Serial.println(F("1.Please recheck the \"Protocol Type\" in HUSKYLENS (General Settings>>Protol Type>>I2C)"));
      Serial.println(F("2.Please recheck the connection."));
      delay(100);
  }
  huskylens.writeAlgorithm(ALGORITHM_LINE_TRACKING);            //Switch the algorithm to line tracking.
  rightBack.setSpeed(0);                                        //Set the motors to the motor speed, initially all 0
  rightFront.setSpeed(0);
  leftFront.setSpeed(0);
  leftBack.setSpeed(0);
  moveForward();                                                //Start the motors
  accelerate();                                                 //Accelerate to the set motor speed
}

void loop() 
{
  int32_t error;
  if (!huskylens.request(ID1))                                  //If a connection is not established
  {
    Serial.println(F("Check connection to Huskeylens"));
    leftSpeed = 0; 
    rightSpeed = 0;
  }
  else if(!huskylens.isLearned())                               //If an object has not been learned
  {
    Serial.println(F("No object has been learned"));
    leftSpeed = 0; 
    rightSpeed = 0;
  }
  else if(!huskylens.available())                               //If there is no arrow being shown on the screen yet
    Serial.println(F("No arrow on the screen yet"));
  else                                                          //Once a line is detected and an arrow shown
  {
    HUSKYLENSResult result = huskylens.read();                  //Read and display the result
    printResult(result);
    
    error = (int32_t)result.xTarget - (int32_t)160;             //Calculate the tracking error
    headingLoop.update(error);                                  //Perform PID control on the error
       
    leftSpeed = headingLoop.m_command;                          //Get the left side speed change
    rightSpeed = -headingLoop.m_command;                        //Get the right side speed change

    leftSpeed += motorSpeed;                                    //Calculate the total left side speed
    rightSpeed += (motorSpeed-motorOffset);                     //Calculate the total right side speed
  }
  Serial.println(String()+leftSpeed+","+rightSpeed);
  leftFront.setSpeed(leftSpeed);                                //Set the new motor speeds
  leftBack.setSpeed(leftSpeed); 
  rightFront.setSpeed(rightSpeed);
  rightBack.setSpeed(rightSpeed);
}

void accelerate()                                 //Function to accelerate the motors from 0 to full speed
{
  for (int i=0; i<motorSpeed; i++)                //Loop from 0 to full speed
  {
    rightBack.setSpeed(i);                        //Set the motors to the current loop speed
    rightFront.setSpeed(i);
    leftFront.setSpeed(i+motorOffset);
    leftBack.setSpeed(i+motorOffset);
    delay(10);
  }
}

void decelerate()                                 //Function to decelerate the motors from full speed to zero
{
  for (int i=motorSpeed; i!=0; i--)               //Loop from full speed to 0
  {
    rightBack.setSpeed(i);                        //Set the motors to the current loop speed
    rightFront.setSpeed(i);
    leftFront.setSpeed(i+motorOffset);
    leftBack.setSpeed(i+motorOffset); 
    delay(10);
  }
}

void moveForward()                                //Set all motors to run forward
{
  rightBack.run(FORWARD);
  rightFront.run(FORWARD);
  leftFront.run(FORWARD);
  leftBack.run(FORWARD);
}

void stopMove()                                   //Set all motors to stop
{
  rightBack.run(RELEASE);
  rightFront.run(RELEASE);
  leftFront.run(RELEASE);
  leftBack.run(RELEASE);
}

void turnLeft(int duration)                                 //Set motors to turn left for the specified duration then continue
{
  rightBack.setSpeed(motorSpeed+turnSpeed);                 //Set the motors to the motor speed
  rightFront.setSpeed(motorSpeed+turnSpeed);
  leftFront.setSpeed(motorSpeed+motorOffset+turnSpeed);
  leftBack.setSpeed(motorSpeed+motorOffset+turnSpeed);
  rightBack.run(FORWARD);
  rightFront.run(FORWARD);
  leftFront.run(BACKWARD);
  leftBack.run(BACKWARD);
  delay(duration);
  rightBack.setSpeed(motorSpeed);                           //Set the motors to the motor speed
  rightFront.setSpeed(motorSpeed);
  leftFront.setSpeed(motorSpeed+motorOffset);
  leftBack.setSpeed(motorSpeed+motorOffset);
  moveForward();
}

void turnRight(int duration)                                //Set motors to turn right for the specified duration then continue
{
  rightBack.setSpeed(motorSpeed+turnSpeed);                 //Set the motors to the motor speed
  rightFront.setSpeed(motorSpeed+turnSpeed);
  leftFront.setSpeed(motorSpeed+motorOffset+turnSpeed);
  leftBack.setSpeed(motorSpeed+motorOffset+turnSpeed);
  rightBack.run(BACKWARD);
  rightFront.run(BACKWARD);
  leftFront.run(FORWARD);
  leftBack.run(FORWARD);
  delay(duration);
  rightBack.setSpeed(motorSpeed);                           //Set the motors to the motor speed
  rightFront.setSpeed(motorSpeed);
  leftFront.setSpeed(motorSpeed+motorOffset);
  leftBack.setSpeed(motorSpeed+motorOffset);
  moveForward();
}

void printResult(HUSKYLENSResult result)                    //Display the results on the serial monitor
{
    if (result.command == COMMAND_RETURN_BLOCK)
    {
        Serial.println(String()+F("Block:xCenter=")+result.xCenter+F(",yCenter=")+result.yCenter+F(",width=")+result.width+F(",height=")+result.height+F(",ID=")+result.ID);
    }
    else if (result.command == COMMAND_RETURN_ARROW)
    {
        Serial.println(String()+F("Arrow:xOrigin=")+result.xOrigin+F(",yOrigin=")+result.yOrigin+F(",xTarget=")+result.xTarget+F(",yTarget=")+result.yTarget+F(",ID=")+result.ID);
    }
    else
    {
        Serial.println("Object unknown!");
    }
}

Let’s upload the code and see how well it works.

I’ll start by pointing the Huskylens on the front of the car downward so that it’s looking at the ground just ahead of the car.

Display Pointed Towards The Ground

I’ve drawn lines on the floor, trying to keep near the grout lines in the tiles so that it hopefully doesn’t get confused. I’ve also put some masking tape on the lines leading away from the turns so that it follows the turns and ignores the grout lines leading on from the turn.

Here are some images of the car following the line. It’s best to watch the video at the begining of the guide to see the line tracking feature running.

Robot Car Turning A Corner
Robot Car Following Line Using Huskylens
Car Following Line

Overall, the line tracking feature worked pretty well. The Huskylens is responsive enough that the car starts making adjustments to its direction as soon as the line starts drifting off centre or changes direction, so it’s able to track the line with a bit of speed as well. It only veered off course a couple of times during testing and these all occurred when the wheels slipped on the smooth tiled floor.

The limitation to the speed is probably more to do with the actual motors than with the Huskylens. These geared motors are really cheap and low quality, so the driver has a hard time controlling the speed accurately.

Experimenting With Object Tracking

Now that we’ve tried out line tracking, let’s try object tracking.

We use the selector to change over to Object Tracking mode. In this mode, the crosshair on the display is replaced by a yellow box. To start, you need to align the object you’re going to be tracking with this box and then press the learn button.

I’m going to try and use this Raspberry Pi logo cutout on a clear piece of acrylic as the object to track.

Aligning Tracking Object On Display

Once the object is learnt, it’ll receive an ID tag and it’ll then be followed around the display surrounded by the box. It also gets bigger or smaller if you move it closer and further away from the camera.

Learning The Object To Be Tracked

We’re going to use this box to control the car as well. When the box moves to the left or right of the display then we’ll move the car left or right and when it gets further away, the box gets smaller, and we’ll then move the car forward to follow the object.

I’ve adapted my old robot car code again, this time to follow the box around the screen.

//The DIY Life
//Michael Klements
//16/04/2021
//HuskyLens Object Tracking Robot

#include "HUSKYLENS.h"                            //Import the required libraries
#include "SoftwareSerial.h"
#include <AFMotor.h>

AF_DCMotor rightBack(1);                          //Create an object to control each motor
AF_DCMotor rightFront(2);
AF_DCMotor leftFront(3);
AF_DCMotor leftBack(4);

byte maxMotorSpeed = 50;                             //The normal motor speed
int motorOffset = 25;                             //Factor to account for one side being more powerful
int objectWidth = 50;
int turnGain = 12;
int offCentre = 20;
int distGain = 6;

int leftLimit = 160-offCentre;
int rightLimit = 160+offCentre;

int leftSp = 0;
int rightSp = 0;

bool isTurning = false;                           //Track when turning left and right
bool isTurningLeft = true;

HUSKYLENS huskylens;                              //Create a new Huskeylens object
int ID1 = 1;

void printResult(HUSKYLENSResult result);

void setup() 
{
  Serial.begin(115200);                                       //Start serial communication
  Wire.begin();                                               //Connect to Huskylens
  while (!huskylens.begin(Wire))
  {
      Serial.println(F("Begin failed!"));
      Serial.println(F("1.Please recheck the \"Protocol Type\" in HUSKYLENS (General Settings>>Protol Type>>I2C)"));
      Serial.println(F("2.Please recheck the connection."));
      delay(100);
  }
  huskylens.writeAlgorithm(ALGORITHM_OBJECT_TRACKING);        //Switch the algorithm to object tracking.
  rightBack.setSpeed(0);                                      //Set the motors to the motor speed
  rightFront.setSpeed(0);
  leftFront.setSpeed(0);
  leftBack.setSpeed(0);
  moveForward();                                              //Set motors to forward direction
}

void loop() 
{
  int32_t error;
  if (!huskylens.request())                                                 //If connection to Huskylens isn't available
    Serial.println(F("Fail to request objects from HUSKYLENS!"));
  else if(!huskylens.isLearned())                                           //If an object hasn't yet been learned
  {
    Serial.println(F("Object not learned!")); 
    setMotorSpeed (0,0);
  }
  else if(!huskylens.available())                                           //If the learned object isn't visible anymore
  {
    Serial.println(F("Object disappeared!"));
    setMotorSpeed (0,0);
  }
  else                                                                      //If object is being tracked
  {
     HUSKYLENSResult result = huskylens.read();                             //Get the results of the object being tracked
     if(result.xCenter < leftLimit)
     {
        leftSp = -turnGain*(leftLimit-result.xCenter);
        rightSp = turnGain*(leftLimit-result.xCenter);
     }
     else if(result.xCenter > rightLimit)
     {
        leftSp = turnGain*(result.xCenter-rightLimit);
        rightSp = -turnGain*(result.xCenter-rightLimit);
     }
     if(result.width < objectWidth)
     {
        leftSp = leftSp+(distGain*(objectWidth-result.width));
        rightSp = rightSp+(distGain*(objectWidth-result.width));
     }
     if(leftSp > maxMotorSpeed)
        leftSp = maxMotorSpeed;
     else if(leftSp < 0)
        leftSp = 0;
     if(rightSp > maxMotorSpeed)
        rightSp = maxMotorSpeed;
     else if(rightSp < 0)
        rightSp = 0;
     setMotorSpeed (leftSp, rightSp);
     leftSp = 0;
     rightSp = 0;
     printResult(result);
  }
}

void moveForward()                                //Set all motors to run forward
{
  rightBack.run(FORWARD);
  rightFront.run(FORWARD);
  leftFront.run(FORWARD);
  leftBack.run(FORWARD);
}

void stopMove()                                   //Set all motors to stop
{
  rightBack.run(RELEASE);
  rightFront.run(RELEASE);
  leftFront.run(RELEASE);
  leftBack.run(RELEASE);
}

void setMotorSpeed (int leftTempSp, int rightTempSp)
{
  rightBack.setSpeed(rightTempSp);                              //Set the motors to the motor speed
  rightFront.setSpeed(rightTempSp);
  leftFront.setSpeed(leftTempSp+motorOffset);
  leftBack.setSpeed(leftTempSp+motorOffset);
}

void printResult(HUSKYLENSResult result)                        //Display the results on the serial monitor
{
    if (result.command == COMMAND_RETURN_BLOCK)
    {
        Serial.println(String()+F("Block:xCenter=")+result.xCenter+F(",yCenter=")+result.yCenter+F(",width=")+result.width+F(",height=")+result.height+F(",ID=")+result.ID);
    }
    else if (result.command == COMMAND_RETURN_ARROW)
    {
        Serial.println(String()+F("Arrow:xOrigin=")+result.xOrigin+F(",yOrigin=")+result.yOrigin+F(",xTarget=")+result.xTarget+F(",yTarget=")+result.yTarget+F(",ID=")+result.ID);
    }
    else
    {
        Serial.println("Object unknown!");
    }
}

I uploaded the code to the robot and then tried the tracking out. This example took a bit more time to set up and get to a point where it was working reasonably reliably. Most of the time was spent adjusting the gains on the turning and distance tracking as it seemed to either not respond at all or respond too aggressively.

Robot Car Tracking Object

I eventually got it working reasonably well. The robot followed the Raspberry Pi logo around, moving forward when it was moved away and turning left and right to bring it back into the centre of the display.

You can watch the object tracking in the video at the beginning of this project as well.

Robot Car Following Object Being Tracked Using Huskylens

I probably need to spend a bit more time adjusting the gains, but you get a good idea of how the object tracking works.

I’d also like to try the object tracking mode on a two axis servo mount, as I think the results would be a bit more reliable and consistent than with the car.

Let me know what you think of the Huskylens and my robot car in the comments section below.

Build & Run Your Own Bitcoin Node On A Raspberry Pi

In this project, we’re going to be looking at how to run your own personal Bitcoin node on a Raspberry Pi. By running your own node, you can skip using a third party and directly make transactions on the Bitcoin network, without any additional fees.

If you don’t know how Bitcoin works, it’s essentially a network of thousands of nodes like the one we’re going to be building in this video. Each one has its own full copy of the Bitcoin blockchain, which is a record of every transaction which has ever occurred on the network. These nodes then work together to verify the transactions and maintain the blockchain. So you’ll essentially have a record of every Bitcoin transaction stored on your node and you’ll be helping to keep the Bitcoin network decentralized.

This is different to mining Bitcoin, which is a really bad idea on a Raspberry Pi as it would take you a couple of hundred years to mine a single dollar. Unlike Bitcoin mining, running a node doesn’t require any expensive hardware and can be done on a $35 Raspberry Pi and an external hard drive.

We’re going to be running a software package called Umbrel on our Bitcoin node. It’s really easy to use and their website literally guides you through the installation process step by step. The best part is that it’s free and all of its source code is available on GitHub.

Umbrel Software

Here’s my video of the build, read on as I take you through the project step by step so that you can build your own node:

What You Need To Build Your Own Bitcoin Node

  • Raspberry Pi 4B (8GB used) – Buy Here
  • 32GB MicroSD Card (16GB Min) – Buy Here
  • Low Profile Ice Tower (Black version used) – Buy Here
  • 1TB M.2 NVME SSD – Buy Here
  • External NVME Case (Not the one I used, but similar) – Buy Here
  • 1TB External SSD (Alternative to above) – Buy Here
  • Raspberry Pi Power Supply – Buy Here
  • Ethernet Cable – Buy Here
  • 4 x 3mm Yellow LEDs – Buy Here
  • 4 x 150ohm Resistors – Buy Here
  • M3 Screws & Nuts – Buy Here

Banggood Alternatives

In addition to the above, you’ll need to 3D print some parts for your case. I used a Creality Ender 3 V2 for this project. I used a K40 Laser Cutter to engrave and cut out the case lid.

The above parts are affiliate links. By purchasing products through the above links, you’ll be helping to support this blog, with no additional cost to you.

Designing & Making The Case

I started out by designing a case for the Bitcoin Node using Fusion 360. I designed the case to house the Raspberry Pi with the low profile Ice Tower installed and the SSD alongside it. I chose to used an M.2 NVME drive because it’s a bit more compact than a typical 2.5″ external one. SSDs produce quite a bit of heat, so I added a second fan onto the front of the case to push air into the case, which will then be exhausted from the vents on the side.

Designing A Case in Fusion 360

Print your own case – get the 3D print and laser cutting files

Note: The drive enclosure that I used is not all that common. I have provided an alternate case design for the linked Sabrent drive. This cutout is large enough to insert the entire Sabrent enclosure into the case (with the port sticking out a little).

Lastly, I designed a clear acrylic cover which I’m going to engrave a logo onto. I’m also going to install some yellow LEDs in the corners in to give the logo a gold glow while it’s running.

I enjoy designing and building my own cases for my Raspberry Pis, have a look at this mini desktop case I built to make my Pi look like a mini desktop computer.

3D Printing The Case

I 3D printed the case on my Ender 3, along with 4 legs and 4 corner clamps for the cover. The corner clamps are mainly there to stop the light from the LEDs from shining up and out of the case and keep it contained within the acrylic.

I printed the case in black PLA using an infill of 15%. The legs and corner clamps were printed solid using the same filament.

3D Printed Bitcoin Full Node Case

I then laser engraved and cut out the lid for the case from a sheet of 2mm clear acrylic. I designed the engraving and the cutout in Inkscape to the same dimensions as the sketch used in Fusion 360.

Laser Engraving The Case Lid

I engraved a mirror image of a Bitcoin logo into the back of the lid so that the top surface is still smooth, so it won’t trap dust and can easily be cleaned.

Peeling The Film Off The Cover of the Bitcoin Node

Assembling The Bitcoin Node

Now that we’ve got all of the components made up, let’s start assembling it.

First I’m going to install the legs, which are just held in place with an M3x8mm screw in each. In hindsight, it probably would have been easier to just glue these into place.

Screwing on the Legs

Next, let’s open up our Raspberry Pi. I used an 8GB version of the Raspberry Pi 4B, but you should be able to use the 2GB and 4GB versions as well.

Before I install the Pi in the case, I’m going to flash the SD card. I’ll do this using the method outlined on the Umbrel page. This involves downloading Balena Etcher and the Umbrel image and then flashing the image to the SD card.

Flashing Umbrel with Balena Etcher

Now that this is done, I’m going to put the SD card into the Pi and then assemble the Ice Tower as per the instruction booklet which came with it. Don’t add any of the brass standoffs yet, we’re going to use these in the next step.

Adding Legs to Ice Tower

To mount the Pi, we’re going to install one set of brass standoffs which came with the Ice Tower on the bottom of the case and hold the Pi in place with the second set. You’ll probably need to use a wrench or spanner to screw the standoffs into the base, they’ll be too tight to screw in with your fingers.

I missed a step here – I forgot to add the USB power cable through the slot near the USB cutout. You’ll see in the subsequent steps.

Installing Brass Standoffs

Next I’m going to add the cooling pad and install the Ice Tower on the CPU. The Ice Tower is held in place using some M2.5 screws which go into the brass standoffs. These also came with the Ice Tower.

Raspberry Pi Installed

Next, I’m going to install the second fan which came with the Ice Tower onto the front of the case. I pressed some M3 nuts into the pockets on the front and then secured the fan with some M3 screws. The fan should be mounted so that it pushes air into the case, although the airflow direction is not critical – it’ll work either way.

Install Fan onto Front of Case

Once this was done, I connected the wiring for the fans to the Pi’s GPIO pins.

Fan Wiring Connected To GPIO Pins

These just go onto two available 5V and GND pins near the end of the GPIO header.

GPIO-Pinout-Diagram-2

Now that the fans are done, we can install our SSD. As mentioned earlier, I’m using an M.2 NVME drive, so I needed a way to connect the drive to the Raspberry Pi. I bought a low profile USB C enclosure for it and I’m going to just be using the PCB inside it to mount the drive onto. We don’t need the rest of the enclosure for this project, the case will act as the new enclosure and we want to be able to get some airflow over the drive to keep it cool.

Putting SSD into Enclosure

I designed a cut-out in the case to mount the faceplate from the enclosure to hold it all in place.

Installing SSD into Case

It was at this stage that I noticed that I had designed a slot to run the power cable through and had forgotten to put it through the case before installing the Pi. I chose to put in a slot rather than add a large cutout to fit the connector through.

Forgotten Power Cable

So I had to remove the Pi to add the power cable and then re-install it.

Adding Power Cable To Case

I then made up a string of four 3mm yellow LEDs, one for each corner of the case. These are designed to fit into the holes I cut on the cover. I used a 150-ohm 1/4W current limiting resistor on each LED, then connected them in series and added some dupont connectors to the end to plug into the GPIO pins.

Soldering 3mm Yellow LEDs

I glued the LEDs into the cover with some clear epoxy. The top of the LEDs protrude a little from the surface of the cover.

LED String On Cover

I then plugged it in and closed it up using an M3 screw through each of the corner clamps. The corner clamps should align themselves as they go over the top of the protruding LEDs as well.

Screwing Top Cover On

Now that this is all done, the Bitcoin node is complete and ready to be powered up.

Powering Up the Bitcoin Node

Now that the Bitcoin node is assembled, lets plug in our cables and power it up. Umbrel says to allow the node 5 minutes to boot up before trying to access it.

Plugging In Cables

When I switched the node on for the first time, I found that the RGB lighting in the fan on the Ice Tower detracted from the yellow glow of the LEDs.

Top Cover of Bitcoin Node Illuminated, RGB Showing

I decided to replace the fan with another plain black fan which I had from another Ice Tower. You could probably also get away with just removing the fan on the Ice Tower altogether. The fan on the side of the case blows directly onto the heat sink as well.

Removing RGB Fan

This produced a much cleaner look. You can now only see the faint flashing LEDs on the Pi and the SSD under the cover.

Bitcoin Node on Raspberry Pi

Now let’s get back to Umbrel. You don’t need to connect a monitor to it to set up, once it’s booted up then you can access the dashboard by going to umbrel.local on any other computer or mobile device connected to the same network.

If you do plug in a monitor, you’ll be able to see some diagnostic information while it is booting up, but this is not necessary.

When you open up the dashboard you’re presented with a welcome screen and you’re then guided through the setup process.

Umbrella Welcome Screen

You’ll need to type in your name and choose a password. Then you’re asked to write down your seed words as a recovery mechanism if you forget your password. It’s quite important that you do this as there is no “I forgot my password” option when logging in. Lastly, you’ll need to accept a disclaimer.

You’ll then be taken to the main dashboard.

Umbrel Dashboard Running

Your node will begin downloading the Bitcoin blockchain. Depending on how fast or in my case, how slow your internet is, this could take a few hours or even a few days. At the time of making this video, the blockchain is around 327 gigabytes. Your node will also transfer a similar amount of data on a month to month basis, so you need to have a reasonably good internet service to maintain your Bitcoin node.

You’ll still be able to use your node while the blockchain is being downloaded, but you’ll have to wait to unlock the full functionality of your node.

You can also add apps and your wallets to your node to truly customise and get the most use out of it.

Let me know in the comments section if you do land up building your own node and what you think of this one.

Mini Sega Genesis Console Powered By A Raspberry Pi 4 Running RetroPie

In this project, I’m going to show you how I built a Mini Sega Genesis console lookalike, which is powered by Raspberry Pi 4 running RetroPie. The console has wireless controllers and can be used to play a number of arcade, console and classic PC games, all on one device. If you had a Nintendo, Sega and or Atari console back in the day then you’ll definitely want to give this project a try!

Here’s a video of the build and the console running some old games:

RetroPie is free software that runs on a few different devices. One of the best devices in terms of performance is a Raspberry Pi 4, so that’s the board that we’re going to be using for this project. The games being played on RetroPie are generally not very resource-intensive, so you should be fine with using the base model 2GB version. All of my 2gig Pi’s are in my water-cooled Pi cluster at the moment and I’ve got an 8gig Pi free, so I’m going to be using that. The emulation software mainly uses the CPU and GPU on the Pi, so RAM is not all that important.

I also chose to use wireless controllers for my console so that I didn’t have any additional cables protruding from the side of my console. The wireless receivers can be housed within the case, keeping it looking clean.

What You Need For This Project

  • Raspberry Pi 4 2GB – Buy Here
  • Power Adaptor – Buy Here
  • Aluminium Heatsink Set – Buy Here
  • Or Get The CanaKit (Includes Pi, Heatsinks and Power Adaptor) – Buy Here
  • Wireless Gamepad (or two) – Buy Here
  • 32GB MicroSD Card – Buy Here
  • Dcorn Monitor (Or Use Your Television) – Buy Here
Things Needed To Build A RetroPie Console

Keeping Your Pi Cool

To start off, we need to have a look at how to keep our Pi cool within the case. While most old console games are not really that intensive for the Pi to run, it’ll still be producing some heat which we need to remove. For most games, these small aluminium heat sinks will work just fine. You just need to peel off the backing and stick them into place.

Stick Your Heatsinks Onto The Raspberry Pi

We’ll have a look at some other cooling options a bit later when we’re designing the case.

Installing RetroPie

There are two parts to the software side of this project, the first is installing RetroPie, and the second is to add your ROMs. We’ll start by installing RetroPie and then have a look at how to load the ROMs a bit later on. ROMs are essentially images of the video games you’d like to play on your RetroPie.

To install RetroPie, I’m going to be using Raspberry Pi Imager. This utility makes it easy to format the SD card and write the image to the card without having to download any other apps or the operating system image first.

Raspberry Pi Imager

You simply select the operating system that you want to install, select the target drive, which is our SD card and then the utility does everything for you.

RetroPie on Raspberry Pi Imager

Make sure that you select the correct version of RetroPie for your particular Raspberry Pi. There are a couple of other versions for the Pi 2/3 and the Pi 1/Zero.

Once you’ve got your SD card prepared, you can plug it into your Pi. We’ll be loading the ROMs onto the Pi using an FTP client later.

Prepare The SD Card

Designing A Case For The Raspberry Pi

I wanted to make my own 3D printed case for the console, so I decided to design a case for the Raspberry Pi 4 which looks like a mini Sega Genesis console. I had a Sega console myself back in the day, so that was the obvious choice for me. Let me know if you like the case I came up with and what other options you’d like to see and I’ll have a look at putting these together as well.

The full set 3D print files, including all of the below versions of the case, can be downloaded here.

Designing The Sega Genesis Console Case

I designed the case in Fusion 360 and then shelled it out, sized it to fit the Pi and then added some cutouts for the ports. Some people have rerouted ports to the front or back of their cases, I just positioned the Pi sideways so that the primary cables would come out of the back of the console and I’m going to be using wireless controllers, so I don’t need the USB ports to be accessible with the case closed.

Fusion 360 Top Clear To See Pi

I’ve created a couple of variants of the case to suit different uses. One of them has the four USB ports accessible through a cutout in the side if you’d like to use wired controllers rather or if your controller’s receiver doesn’t fit within the allowed space.

Case With USB Port Cutouts

I’ve also created an option with the game slot and vents opened up to allow some of the heat to escape from the case if you’re running more resource intensive games.

Case With Better Ventilation

And lastly, I’ve created one which allows a 40mm fan to be mounted into the case to provide better cooling if your Pi is overheating. The fan is silver in the model, so is a bit more prominent. If you use a black fan and black screws then you’ll hardly notice it on top of the console.

Case With 40mm Fan

You can get the full set of 3D print files, which includes all versions of the case, through this link.

3D Printing The RetroPie Case

With the case design done, we now need to 3D print the components. I used black PLA for mine to keep with the original black console colour.

I printed the base of the case lying flat and the top vertically. This was done to reduce support material for the base and top cover, and also get some good detail on the top cover.

3D Printing The Case Top

I printed the components on a Creality Ender 3 V2 in black PLA with a nozzle temperature of 210°C and bed temperature of 55°C with a 100% infill.

I then cleaned up the support material and rafts by cutting them away with a craft knife.

Removing Print Support Material

Some people like to sand, fill and spray paint their 3D printed components to get a better surface finish.

Install Your Raspberry Pi In Your Case

You can then screw your Raspberry Pi to the base of your case using some M2.5 x 5mm screws, the standoffs are already printed in place. These are the same screws that are typically supplied with Raspberry Pi cases to hold the Pi in place and with an Ice Tower. Don’t overtighten the screws, they just need enough pressure to hold the Pi in place, if you tighten them too much then you might strip the holes in the standoffs.

Screw The Raspberry Pi Onto The Bottom Cover

Next we need to add the receiver from the gamepad. The gamepad I’m using has an internal battery with is charged using an included USB cable and has a small wireless receiver which needs to be plugged into on of the Pis USB ports.

This case design allows two receivers to be installed, one in each of the bottom ports. You should be able to just squeeze them past the bottom edge of the base with the Pi screwed onto the base. You won’t be able to use the top ports without the USB cutouts as the receivers stick out too much.

I wanted to make the case as compact as possible, so I didn’t scale the case up to fit receivers in the top ports as well. There are hardly any RetroPie games which support more than two players anyway.

Receiver Sits In Bottom Two Ports

I’m going to close up my case. You’ll want to keep your case open until you’ve finished the setup process as you might need to plug in a keyboard to type in your WiFi credentials or to change your Pi’s username and password.

Close Up The Case With M3 Screws

Connecting Your RetroPie To A Television Or Monitor

The console is now ready for its first boot up, we just need to plug it into a monitor. You can use any computer monitor with an HDMI input or even your television. To keep with the look of my mini console setup, I’m going to be using this 8″ monitor which Dcorn sent me.

HD Monitor From Dcorn

It’s got HDMI, VGA, AV and BNC inputs, so it will work with any Raspberry Pi, even way back to the first versions and it’s small and portable, with it’s own stand.

Range Of Input Options

It also runs on 12V, so it’s perfect to take along with a Pi in the car for your kids to play games on long drives or to use on camping and RV trips. It’s got a wide 178-degree viewing angle and has built-in speakers so you don’t have to worry about bringing headphones along or using external speakers for multiplayer games.

12V And Built In Speakers

If you’d like to get your own monitor, they’re available from Dcorn on Amazon.

Dcorn Monitor

Let’s plug in our cables and boot up our console. You’ll need to connect power and an HDMI cable to your monitor and then power and the micro-HDMI side of the cable to your Pi.

Plug Cables Into Monitor and Pi

Setting Up Your RetroPie

The first boot up takes a little longer than usual. Once the Pi has booted up, you’ll need to connect it to your network so that you can install your ROMs onto it. You’ll also be asked to push buttons on your gamepad so that your console knows how to manage the inputs.

RetroPie First Bootup

To connect your RetroPie to the internet, head to the options page and then select WiFi. You’ll then need to select your network and type in your network’s password.

If you are using an SD card which is larger than 4GB, you’ll need to expand it so that your Pi can use the remaining space for ROMs. To do this, open the raspi-config tool from the settings menu and then choose Expand Filesystem from the menu.

Lastly, head over to the configuration page and select show my IP. This will bring up your Pi’s IP address, which you’ll need in the next step to load ROMs onto it.

Show IP Address For Setup on RetroPie

Installing ROMs On Your RetroPie

You can download ROMs from a number of sources online, including a bunch of free arcade games and ones with expired copyrights. Just be aware that even though these games are often many years old, a lot of them are still protected by copyright laws. So downloading and distributing copies of these games is illegal.

Here are some resources for public domain ROMs:

I’ve downloaded a free version of Pacman for Super Nintendo which I’ll show you how to install.

Next you need to open up an FTP client on your computer, I used Filezilla, which is also free.

Filezilla Connectiong to RetroPie

Type in your Pi’s IP address which you found earlier and then the username and password, if you haven’t changed these they’ll still be the defaults, which are pi and raspberry. The port you’re accessing is port 22.

Click on connect and Filezilla should connect to your Pi and you’ll then have access to your Pi’s filesystem.

Copy ROMs into Relevant Platform Folder

Open the folder called RetroPie and then roms. This folder contains another folder for each platform that RetroPie supports. You’ll need to copy your unzipped roms into the relevant platform folder. As mentioned before, I’m using Pacman for Super Nintendo, so I’ll open the snes folder and then drag the contents of the unzipped rom onto the Pi.

Do this for all of your roms and then reboot your RetroPie.

Playing Games On Your New RetroPie

You should now see a menu item for each platform that you’ve got an available rom for. Open these up to see the games under each and select one to start it.

RetroPie Platform Options Once ROMs Loaded
RetroPie Running PacMan

You can add as many games as you’ve got space for on your SD card, but because these games were pretty small, you can literally fit thousands of games onto your RetroPie. I like to keep these down to a couple which we actually play so that we’re not scrolling through pages and pages of items each time we’re looking for a game though. It’s also pretty quick and easy to add or remove games as you’d like.

Platform Menu Showing Installed Games on RetroPie

Remember to shutdown your RetroPie properly before unplugging the power to prevent corrupting the SD card.

Shutdown RetroPie Properly After Use

Let me know what you think of my RetroPie console in the comments section. Are you going to try building your own one?

The M5 Paper, A Tablet Style Development Board With An E-ink Touch Display

Today we’re going to be looking at the M5 Paper development board, which is essentially an ESP32 tablet with a 4.7” e-ink touch display. The combination of a WiFi-enabled tablet with accessible IO as well as an ultra-low power consumption touch display really opens up a world of possibilities for home automation, dashboards, monitoring and data logging.

If you’re interested in some other boards in the M5 range, I had a look at the M5Stack Core 2 and M5StickC Plus last week.

M5 Paper Unboxing

Here’s my video of the unboxing and tinkering with the M5 Paper development board:

Where To Buy The M5 Paper

This board was sent to me by Banggood to share with you, you can get your own through the below link:

You can also have a look at some of the other boards in the M5 range:

The above links are affiliate links. By purchasing products through these links, you’ll be supporting my projects, with no additional cost to you.

Unboxing The M5 Paper

Let’s open up the M5 Paper and take a look at it.

The device is shipped with the pre-loaded demo program being displayed. This is one of the benefits of an e-ink display, the image can continue to be displayed even when the device is off or the battery is dead. The touch functionality obviously only comes back on when the device is powered up though.

M5 Paper E-ink Display

The 540 x 960 pixel e-ink display supports two touch points and 16 grey levels. The resolution is pretty good for a display of this size, the characters are crisp and clear and images look good as well.

On the right side we’ve got a microSD card slot for additional storage and a multifunction button – up, down and centre press.

Micro SD Slot and Multifunction Button

It is charged and programmed through a USB C port on the bottom alongside an IO expansion port.

USB C Port and Expansion Port

One the left side, we’ve got two additional expansion ports. Unlike the M5Stack and M5Stick boards, there are no accessible IO pins through a header pin arrangement, you’ve only got three IO expansion ports. But three ports seems like enough for what you’d be using on a device like this.

Second Two Expansion Ports

Like the other M5 boards, the M5 Paper has WiFi and dual-mode Bluetooth. It also has a realtime clock module and a built-in SH30 sensor that measures temperature and humidity.

M5 Paper Features

Specifications:

ESP32-D0WDQ6-V3240MHz dual-core, 600 DMIPS, 520KB SRAM, Wi-Fi, dual-mode Bluetooth
Flash16MB
PSRAM8MB
Input Voltage5V @ 500mA
Ports1 USB Type C, 3 x HY2.0-4P , TF-card (microSD) slot
E-Ink DisplayModel Number:EPD_ED047TC1 | 540*960@4.7″ | 
Grayscale : 16 Levels | Display area : 58.32*103.68mm | 
Display Driver : IT8951
Physical Button1 x Multi-function Button , 1 x Reset Button
RTCBM8563
Antenna2.4G 3D Antenna
PINSG25, G32, G26, G33, G18, G19
Battery1150mAh@3.7V
Working Temp32°F to 104°F ( 0°C to 40°C )
Net Weight86g
Gross Weight100g
Product Dimension118*66x*10mm
Packaging Dimension120*70x*14mm
Casing MaterialPlastic ( PC )

Preloaded Demo Program

The M5 Paper comes with a pre-loaded basic demo program, there’s a sample clip of this program included in my video at the beginning.

You turn it on by pressing the centre button on the side, the device then boots up and re-freshes the home screen we saw earlier.

The M5 Paper, A Tablet Style Development Board With An E-ink Touch Display

You can then open up a couple of mini-apps, one of which allows you to do a factory test of the sensors and IO. The system does a check on each device/sensor and reports the data back on the display. In our case there was no SD card plugged in and no WiFi connection, so those showed up as failed.

M5 Paper System Test

There are a few other mini-apps like this home automation dashboard. I’d definitely like to try and get this to drive my Phillips hue lights in future. This sort of app is one area where I think this device could really excel. I think a lot of people with various home automation devices would appreciate having a universal remote control for their system, which also lasts for a couple of weeks on a single charge.

M5 Paper Home Automation Control Panel

Using the text editor, I found that the display is amazingly responsive for e-ink technology and it does partial updates in well under a second. It’s still obviously a lot slower than an LCD or LED display, but if you’ve used an e-ink display before then you’ll really appreciate how well they’ve managed to get this one to work.

Typing on the M5 Paper

There are a few draw backs to the quick updates, you’ll see a bit of ghosting on more solid images, but you’ll hardly notice this through normal use. If you’re interacting with the display a lot, like during typing, then you’ll see that it partial updates small areas or it just does one refresh cycle at a time before waiting to see if you continue to interact with it. If you pause for one or two seconds then it’ll do another refresh to improve the image quality.

A Bit Of Ghosting On The M5 Paper

Overall, the image quality is crisp and clear, you can get quite a lot of detail out of it.

Display Details On M5 Paper

Pressing the power button on the back instantly turns it off, keeping whatever is currently displayed, but disabling the touch functionality.

You just push the middle button on the side to start it up again.

Programming The M5 Paper With Ui Flow

Now let’s try making and loading our own basic program onto the M5 Paper. It is compatible with the Arduino IDE, but we’re going to try and use Ui Flow to create a basic weather dashboard.

Ui Flow is a block coding and MicroPython IDE which allows you to drag and drop blocks to create basic programs in your browser and then wirelessly uploaded them to your M5 Paper device.

It’s got a reasonably long list of features and its really easy to use, so you can quickly and easily create your own programs with very little programming experience.  It’s definitely a bit limited for the M5 paper though, so you’ll probably want to use the Arduino IDE if you’ve got more ambitious plans for your programs.

To start, you’ll need to install a basic driver and then use M5 Burner to load the Ui Flow firmware onto the device.

M5 Burner For M5 Paper

M5 burner also allows you to burn a couple of other pre-made programs onto it, like this Microsoft ToDo list dashboard. The dashboard connects to your Microsoft account and pulls your to-do list onto your device.

Microsoft ToDo List On M5 Paper

Now let’s install Ui Flow to try and build our own dashboard. You simply click on download, wait for it to be downloaded onto your computer and then click on burn to burn it to your M5 Paper. You might also be asked to enter your WiFi network’s credentials to allow the device to access the internet in order to communicate with Ui Flow on your computer.

The Ui Flow firmware on your device then creates an API key which you’ll need to enter into Ui Flow in your browser to connect to your M5 Paper.

API Key For UI Flow

You then need to enter the API key into Ui Flow in your browser and then select the M5 Paper as your device.

Entering API Key Into Ui Flow

You’re then taken to the drag and drop block coding interface which allows you to start building your code.

I’m going to create a basic temperature and humidity dashboard that shows the date and time as well as a sun or moon depending on whether it is day time or night time.

Creating A Basic Block Code Program

This dashboard took around 15 minutes to make and upload to the device. Once you’re happy with the code, you just click on the run icon in the top right corner and the code is wirelessly sent to your M5 Paper device.

Block Code Dashboard
Weather Dashboard

Ui Flow for the M5 paper has a lot of room for improvement to make it easier to use the touch display. For example, it would be a lot easier to enable touch inputs on shapes, buttons or images to build control panels.

Programming The Device

Final Thoughts

The M5 Paper is a fantastic device in terms of hardware. It’s got a lot of built in features and I can definitely see a lot of potential in it, especially for home automation, universal remotes and creating longer term dashboards which don’t need to update very often.

I think the software packages and documentation for the M5 Paper need some work. Ui Flow is really easy to use to create basic dashboards, but it’s a mission to get anything meaningful from the touch display. It would have been a lot simpler to use if you could program images and shapes to function as buttons. You can obviously use the Arduino IDE as an alternative, but it’s going to take some time for the documentation, community and forums to catch up.

So if you’re up for the challenge, then consider getting one to start tinkering with.

Let me know what you think of the M5 Paper in the comments section.

M5 Paper In Packaging

Reimagine Your Home With Multipurpose Spaces

Many of us have probably wondered at some point about what it would be like to have some extra space to put away all our belongings that we simply have nowhere to store. While your first thought would probably be to extend your home or add an extra room or two to create that additional storage space, these are not always the optimal solutions.

Sometimes, making your space work for you will simply be a matter of changing the way your living space is used and making small tweaks to make it more functional. With that in mind, let’s take a look at some of the ways you can reimagine your home and turn it into a beautiful and practical one by creating multipurpose spaces that you will love.

Use room dividers to create a sense of privacy

Use room dividers to create a sense of privacy

Open floor plans are still quite dominant in the world of interior design. However, there are instances when homeowners crave privacy in their open concept spaces. That’s when room dividers come into play. You can either purchase a divider, build one, or improvise with what you already got.

For instance, a carefully positioned bookcase is a DIY room divider solution that has been around for decades and is still equally effective nowadays. The unit will need to be secured so that it doesn’t tip over, though, so keep that in mind, especially if you have small children running around. If you are feeling particularly crafty and want to take the DIY route, you can use virtually anything to build your own room divider, from pallet wood and repurposed doors to vinyl records and license plates.

Use multifunctional furnishings to transform a room

A simple and effective way to keep your home tidy and neat at all times, adding multifunctional furnishings is the perfect solution for a multipurpose living space. They allow you to quickly and easily change the room’s function and purpose while keeping other functions hidden until they’re needed again.

You can use Murphy beds to save space and turn a bedroom into a multifunctional room in just a couple of seconds. Rely on dining tables that double as working desks complete with hidden features for power and storage to quickly transform your dining room into an office. Ottomans and benches with hidden storage make it easy to keep clutter at bay, and other than functioning as extra seating, they can also be used as coffee tables and footrests.

Rely on rugs to break up space into distinct zones

Rely on rugs to break up space into distinct zones

When working with multipurpose spaces, it’s important to create visual zones. This will help you distinguish the transition between different areas of the home. This can be achieved by choosing some of the stylish Miss Amara rugs that will inject just the right amount of coziness into your living space. Other than feeling soft underfoot, the rugs will anchor the room and help you create distinct zones for playing, relaxing, and working.

When combined with effective furniture placement and area-specific lighting, rugs can help you completely transform your space, dictating how each area of your living space is used. To retain a sense of cohesiveness, make sure that you use the same color palette in those zones while allowing yourself to experiment with different textures, fabrics, and accent pieces.

Turn to visual tricks and decorate strategically

Less is definitely more when it comes to multipurpose spaces, and being careful with how you decorate your living space can go a long way in making your home feel more spacious and functional. Getting back to basics while retaining homely accents is key to achieving minimalism with personality and will make your space feel cozy without being cluttered.

Think upholstery with simple design, clear floors, floating shelves, and transparent, flexible furnishings. Taking such a strategic approach to decorating will help expand the space visually and make a smaller living space feel open and airy. Sticking to a restricted color palette is also a great way to create a sense of spaciousness in your home and ensure that all the rooms flow together perfectly.

Don’t let any space go unused

Don’t let any space go unused

Another way to improve the functionality of your living space is to make sure that every inch of the available space is serving a particular purpose. For instance, instead of using the space under the staircase for storing random items around the house, put it to good use by transforming it into a small workspace or a study nook. Make sure to match the colors and materials to the rest of the space so everything looks cohesive and intentional. Creating dedicated zones for activities like these is a great place to start building a conscious living space and making it more mindful.

Other than that, consider making upgrades that will help put your vertical spaces to good use. Rooms with high ceilings will benefit from creating a mezzanine space while the clever use of joinery can help you turn your home into a multi-use space so you can make the most of it.

Wrapping up

Instead of tackling costly renovations and extensions, making your home more functional and flexible can simply be a matter of rethinking the way you use your existing space and finding ways to make the most of it. Use these tips as an inspiration to reimagine your home, create your own multipurpose spaces, and ensure that it is as functional as it is beautiful.

Trying Out The M5Stack Core 2 and M5StickC Plus With Ui Flow

Today we’re going to be having a look at two members of the M5 range, the M5Stack Core 2 and the M5StickC Plus. These are feature-rich ESP32 based development boards that enable you to develop and prototype your own projects and IoT devices without a significant learning curve.

M5Stack and M5Stick

These devices both have colour displays, with the Core 2’s being a touch screen, as well as some additional buttons, built-in batteries, IO headers and a range of sensors, like microphones and IMUs built into them.

M5Stack Core 2 and M5StickC Plus

Here’s my video of the unboxing and tinkering with the two development boards:

Where To Buy The M5Stack Core 2 and M5StickC Plus

These two boards were sent to me by Banggood to share with you, you can get your own through the below links:

In addition to these boards, the following accessories were used here:

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.

Unboxing The M5StickC Plus

Let’s open up the M5StickC Plus first and take a look at that.

M5StickC Plus

I’ll start off by saying that this device is really small for what it is able to do. It’s a little bit bigger than an Arduino Nano, and obviously a bit thicker to accommodate the sensors and battery, but it’s really compact for what they’ve managed to fit into it.

It’s got a 1.1 inch TFT display, with two customisable buttons and a separate power button.

Back of M5StickC Plus

It’s got an IO expansion port on the top which has a range of power supply and input options as well as access to four IO pins. It’s also got a grove connector on the bottom to add compatible devices and sensors.

This USB C port is used to charge and program it.

Grove and USB on M5StickC Plus

In addition to these features on the outside, the stick has a built in LED, buzzer, 6 axis MPU, IR transmitter, microphone and real time clock. It also has both dual-mode bluetooth and WiFi connectivity.

So this is a really powerful little device.

Specifications:

ESP32240MHz dual-core, 600 DMIPS, 520KB SRAM, Wi-Fi, dual-mode Bluetooth
Flash Memory4MB
Power Input5V @ 500mA
PortsUSB Type C x 1, GROVE (I2C+I/0+UART) x 1
LCD Screen1.14 inch, 135*240 Colorful TFT LCD, ST7789v2
Button2 x Custom Buttons
LEDRED LED
MEMSMPU6886
BuzzerBuilt-in Buzzer
IRInfrared Transmission
MICSPM1423
RTCBM8563
PMUAXP192
Battery120 mAh @ 3.7V
Antenna2.4G 3D Antenna
PIN PortsG0, G25/G36, G26, G32, G33
Operating Temperature32°F to 104°F ( 0°C to 40°C )
Net Weight15g
Gross Weight21g
Product Size48.2*25.5*13.7mm
Package Size65*25*15mm
Case MaterialPlastic ( PC )

Preloaded Demo Program

The M5StickC Plus comes with a pre-loaded basic demo program, there’s a sample clip of this program included in my video at the beginning. The program demonstrates the use of the MPU, real-time clock, microphone, IR transmitter and Bluetooth connectivity.

Internal IMU on M5StickC Plus

Unboxing The M5Stack Core 2

Next let’s open up the M5Stack Core 2 – this is an upgrade to the original M5Stack Core.

M5Stack Core 2 In Box

The Core 2 has a 2-inch display, which is also a touch screen. It also has three capacitive touch button below the display, which replace the physical buttons on the original core.

M5Stack Core 2 Unboxing

We have two buttons on the side, one for power and one to reset the device. And then we also have a USB C port, Grove connector and microSD card slot.

USB and Grove on M5Stack Core 2

Beneath the case, we’ve also got an LED, microphone, vibration motor, speaker, 6 axis MPU and real-time clock.

Back of M5Stack Core 2

This cover on the back hides the 30 header pin socket which allows you to access a range of IO and communication pins, which are detailed in the diagram alongside it.

Cover Removed on M5Stack Core 2

This port also allows you to plug in other M5Stack modules to build a stack, which is where the device get’s it’s name.

The M5Stack Core 2 has got magnetic feet, so you can easily stick it to a white-board or your fridge as a control pane or dashboard.

Magnetic Feet on M5Stack Core 2

Specifications:

ESP32-D0WD-V3240MHz dual-core, 600 DMIPS, 520KB SRAM, Wi-Fi, dual-mode Bluetooth
Flash16MB
PSRAM8MB
Input Voltage5V @ 500mA
InterfaceUSB Type C x 1, GROVE(I2C+I/0+UART) x 1
IPS LCD Screen2.0″@320*240 ILI9342C
Touch ScreenFT6336U
Speaker1W-0928
LEDGreen Power Indicator Light
ButtonPower Button, RST Button, Virtual Screen Buttons * 3
VibrationInternal Vibration Motor
MICSPM1423
I2S Power AmplifierNS4168
6-axis IMUMPU6886
RTCBM8563
PMUAXP192
USB ChipCP2104
DC-DC BoostSY7088
TF card slot16G Max.
Lithium Battery390mAh @ 3.7V
Antenna2.4G 3D Antenna
Operating Temperature32°F to 104°F ( 0°C to 40°C )
Net Weight52g
Gross Weight70g
Product Size54 x 54 x 16mm
Package Size75 x 60 x 20mm
Case MaterialPlastic ( PC )

Preloaded Demo Program

The Core 2 also comes with a basic pre-loaded program that allows you to explore some of the features and sensors on the device, there is a clip of this program included in the video at the beginning of this post.

Front Display on M5 Stack Core 2

The program allows you to explore the IMU, touchscreen, microphone, SD card access, timer, clock and WiFi.

Getting Started With Ui Flow on the M5 Range

Next, let’s have a look at how to program these development boards. The boards are compatible with the Arduino IDE, and there is quite a lot of information on installing the boards into the IDE’s boards manager as well as programming them, but they are a bit easier to work with using micro-python.

The developer’s preferred method is to use a web-based IDE called Ui Flow.

Ui Flow To Program M5 Stack

To make use of this application, we need to download and install a driver on a computer and then flash the Ui Flow firmware to the device using M5Burner to enable it to communicate with the web application. You can also burn a couple of other pre-made programs to each device directly from the M5Burner tool.

M5 Burner To Install Ui Flow

M5Burner is pretty intuitive, especially if you’ve worked with the Arduino IDE before, you simply select your board, the COM port, baudrate, and then choose the software that you’d like to install on the device.

We’re going to burn the latest version of Ui Flow to both the Core and Stick devices.

Ui Flow on M5 Stack Core 2

One of the best features of Ui Flow is that it is able to be used wirelessly. The device connects to your WiFi network and generates an API key, and you can then program the device from your browser without any cables, even from a remote location.

API Key For M5 Stack Core 2

This sounded to me like it had the potential to be buggy and slow, but I’ve been really impressed with how well this works. I’ve used it to load a number of programs and revisions and I’ve never had any communication problems with it. It also uploaded the code to the device in just a couple of seconds, usually well under 5 seconds.

Ui Flow is an intuitive drag and drop, block coding IDE, which makes it really easy to get basic programs up and running. You can also switch between block and python modes to add functionality or edit the actual code being generated.

Basic Program In Ui Flow

We can literally make a program and have it running on the device in a couple of minutes. Here I just made a button to drive the internal vibration motor when it’s pushed.

When you click on upload or run, the device receives the code from the IDE and then starts running it.

Vibrate Button For Internal vibration Motor

Making A Basic Home Automation Control Panel On The M5Stack Core 2

Next, I wanted to try making a program that used some of the IO pins, so I decided to try and make a basic home automation control panel using a relay board which I had lying around.

8 Channel Relay Module for M5 Stack Home Automation

I dropped in four slider switches to drive a relay for each room and then added some digital IO blocks to set each pin high or low depending on the state of the button.

Basic Home Automation on M5 Stack Core 2

Never having used Ui Flow before, I did have to do some searching through the menus/options for certain blocks, but this whole program took around 5 minutes to make and get ready to upload to the device. It really is easy to use, even for a beginner.

I then plugged the relay module into the IO pins (pins 2, 27, 32 and 13) and uploaded the code to the Core 2.

Connecting Relay Module To M5 Stack Core 2

It looks like it’s all working the way it should. You can turn multiple rooms on at once and the sliders indicate the status of each switch or relay.

Switching Relays on and off Using Display

I didn’t want to plug all 8 relays in at once as I’m not yet sure what the Core 2’s power supply capacity is and this was being driven straight from the Core 2’s 5V supply, not an external supply. If you’re using a large relay module like this then it’s a better idea to supply the relays using an external 5V supply.

Home Automation on M5Stack Core 2

Connecting Sensors To The M5StickC Plus

Next, let’s look at running a program on the M5StickC Plus which uses the analogue inputs. The whole process is pretty similar, it’s just a matter of selecting a different device in M5Burner and then in Ui Flow.

API Key On M5StickC Plus

We’ll start by creating a program to display the X and Y co-ordinates from an external joystick. I’ve connected a basic two axis joystick to the grove port on the bottom of the M5Stick.

Adding Joystick To M5StickC Plus

Our block code just takes a reading from each of the analogue inputs, maps these to a range between -200 and 200 and then displays this on the M5Stick’s display.

Basic Block Codeing Program For M5 Stick C Plus

It’s obviously not scaled properly, but it works pretty well for a first pass.

Joystick Connection

We can also replace the joystick with a sensor, like this soil moisture sensor and modify the program to display the soil moisture level.

Soil Moisture Sensor On M5StickC Plus

We’re now just going to be using a single analogue input and we’ll also add a battery voltage indicator on the display.

Basic Block Code Moisture Program

So we’ve now got a basic soil moisture level and our battery voltage being displayed on our M5Stick.

Soil Moisture Level Sensor

Final Thoughts

I think these are great all-in-one devices to get started with electronics and rapid-prototyping. I like that they’ve included a couple of built-in sensors and IO options. These, along with the physical buttons and colour display mean that you can already start building some basic programs right out of the box. I also like that you’re able to use the Arduino IDE if you’re already comfortable with it, but there are also easier options available, like Ui Flow.

If you’d like to build more complex projects, then you have the option of using plug-and-play grove sensors, or take it a step further and use the built-in header pins.

Ui Flow’s block coding makes programming the M5 devices really easy, but you’re still able to access some more powerful options through the micro-python editor as well. You also really need to try the remote programming over WiFi feature as well, it’s fast and convenient.

If you’re looking for a basic device for tinkering then the M5StickC Plus will do just fine. If you’d like to get a bit more functionality and be able to add a wide range of sensors and devices later, then have a look at the M5Stack Core 2.

Let me know what you think of these two devices and Ui Flow in the comments section below.

M5Stack Core 2 and M5StickC Plus Review

Making An Ultra Low Power Arduino Pro

This 3.3V Arduino Pro Mini uses over 600 times less power than a traditional Pro Mini, using a couple of simple, low power, changes that cost around $2 to make.

Making An Ultra Low Power Arduino

If you’ve followed some of my previous projects, then you may have seen that I have tried something similar before. Last year, we stripped down an Arduino Pro Mini by removing the power LED and the onboard voltage regulator until we were able to achieve a standby current draw of just 5 microamps at 3.7V.

Original Arduino Power Test

This method would work well for a range of applications, but not having a voltage regulator onboard has complications for voltage-sensitive devices and circuits, so we’re going to look at replacing it with a regulator which has a much better quiescent current.

Arduino Pro Mini Regulator and LED

If you don’t know what this means, the quiescent current is basically the current than a device consumes with no load or in a non-switching condition. So for a regulator, this would be the current being drawn by the regulator with no load connected to it.

Here’s a video of the modification process and results, read on for the write up:

What You Need For This Modification

How To Modify Your 3.3V Arduino Pro Mini

The standard regulator on an Arduino Pro Mini is typically a Micrel MIC5205.

Micrel MIC5205

This regulator is reasonably efficient under load, but is quite poor at low load. Meaning that it waste’s quite a lot of energy when the Arduino isn’t drawing much current from it. This is usually fine for general battery powered projects which run for a few minutes or even an hour or two, but it becomes a problem if you’re trying to build ultra low power projects which need to last a few months on a single charge of a battery.

So lets start by having a look at where we got to previously.

Unmodified Arduino Pro Mini

We started off by testing a standard 3.3V Arduino Pro Mini with no modifications and found that it drew 4.5 milliamps, or 4470 microamps, from the 3.7V battery when running the pre-installed blink sketch.

Power Consumption Before Any Changes

This isn’t much, but it means that a 3.3V Arduino Pro Mini would run for just under a month on a single 3000mAh battery.

Using Low Power Mode

We then used a low-power script to put the Arduino to sleep between blinking. This script makes use of a low-power library to put the Arduino’s Atmega chip to sleep between operations, which uses significantly less power than when it is awake.

Arduino Low Power Mode Sketch

If you’re building ultra-low-power projects then a key part of getting longer battery life is to look at how often information is measured and updated and to make use of the time between these operations to put the Arduino into a low power state. I’m not suggesting that you only take measurements once a day or once an hour, but even waking up to take measurements or check conditions for 1 second in every 10 seconds will make your batteries last almost 10 times longer than without sleeping.

I used this low-power library in my soil moisture monitoring stick project.

Battery Operated Devices Required To Be Low Power

This low power mode modification reduced the current draw to just 1.5 milliamps, or 1500 microamps, so we’ve got around a 3 fold improvement without doing anything to the hardware. Our single 3000mAh battery would now power our Arduino for a little under 3 months on a single charge.

Looking At The Hardware Under A Microscope

Next, we’re going to look at some hardware modifications which we can make to further reduce the power consumption. We’re going to be looking at the small surface mount components on the Arduino PCB, so I’m going to be using this 7″ LCD Digital Microscope which Dcorn have sent me to give you a closer look.

DCorn Microscope

If you enjoy tinkering with electronics and small PCBs then a microscope like this is a great workshop tool. Some of the close-up images and video footage has been recorded using this microscope.

Removing The Onboard Power LED

The next modification was to remove the onboard power LED. This little LED is on whenever the Arduino is powered, which is great when it’s on your bench, but just wastes power in an enclosure.

Arduino Pro Mini Power LED

Last time, we removed this LED by just clipping it off with some wire cutters, this time I’ll do it with a pencil heat gun.

Removing The Power LED With Heat Gun

This had a massive impact on the current draw, reducing it to 0.05 milliamps or 54 microamps. Which is a great result for something we probably wouldn’t have used anyway.

Power Consumption With Power LED Removed

So this was 25 times less power than in low-power mode. This translates to an additional 2900 days of run time on a 3000mAh battery, just by removing an LED which would have likely been covered anyway.

Removing The Voltage Regulator

We then found that removing the voltage regulator resulted in another significant improvement,

Arduino Pro Mini Power LED Removed

I removed the voltage regulator using the pencil heat gun again, taking care not to damage any of the surrounding components.

Removing Regulator With Heat Gun

The board now consumes just 6 microamps.

Power Consumption Without Regulator

So we can tell from this test that our regulator was using around 50 microamps by itself. So now we’re going to have a look at whether we can change this regulator for a more efficient one.

The regulator I’m going to be using is a Microchip MCP1700, which is a 3.3V 250mA regulator which is designed to have a low quiescent current.

MCP1700 Data

One thing to note with this regulator is that it is only rated for an input voltage of up to 6V, so you won’t be able to use it up to 12V like a standard Pro Mini. There is an alternative, the MCP1702, which has a slightly higher quiescent current but allows an input voltage of up to 13.2V. So if you need a higher input voltage then have a look at this as an alternative.

An issue with the onboard regulator on the Pro Mini is that it’s a bit of an uncommon form factor, having 5 legs. Most voltage regulators you’ll see look more like the MCP1700, having 3 legs. So we can’t just directly replace the one on board with a better one.

MCP1700 with MIC5205 Form Factor

But fortunately, there is an easy workaround. We’re just going to use a through-hole version of the MCP1700. It is a bit larger but has exactly the same characteristics as the smaller package.

Surface Mount and Through Hole Regulator

We still need to remove the surface mount one, which you can do with a pencil heat gun or just use clippers as I did previously.

We’re then going to connect the legs of the regulator to the VCC, GND and RAW pins on the Arduino.

Adding MCP1700 To The Arduino Pro Mini

Doing this takes the voltage supply being applied to RAW and GND and supplies the regulated 3.3V to the Arduino’s VCC circuit.

Now that we’ve done this, let’s have a look at whether our Arduino still works and how much power it now uses.

MCP1700 Installed On Arduino Pro Mini

So the blink sketch is still running and we’re now only using 7 microamps, which is substantially better than the 54 being used by the old regulator.

Power Consumption With MCP1700

So we’ve now got an Arduino that still has a regulated supply which is using 640 times less power than an original Arduino Pro Mini. This means that this Arduino would run for almost two years on a battery that would only power an original Pro Mini for a day, and it would run for almost 50 years on a single 3000mAh battery (if the battery would last this long)

Arduino Pro Mini Still Flashing

So you’ve now got more battery capacity available to power your other IO devices. You can also use batteries with a long shelf life, like non-rechargeable lithium batteries, to power your Arduino for 5-10 years without ever touching it.

Let me know in the comments section what you’d use one of these modified Arduinos to power.