Sunday, July 26, 2020

Can You Mine Bitcoin With a Raspberry Pi?

Is it possible to mine Bitcoin on a Pi?

A while ago I did a post on mining cryptocurrency using a Raspberry Pi.

While I was able to mine some CPU based alternative cryptocurrencies like MAGI or Bytecoin, the Raspberry Pi just didn't have enough horsepower to mine major coins like Bitcoin or Litecoin. Those coins needed significant computing power from either a high powered Graphics processor or a dedicated mining machine - something that the Pi didn't have.

While my Raspberry Pi kept chugging away mining MAGI, I kept looking into possible ways to mine something a bit more substantial without busting the budget. I realized that I would definitely not get rich mining on the cheap, but I consider it more of a challenge to see if it could be done.

While I was doing some research, I stumbled across micro-payment cache (also known as Micro-wallet) websites like Coinpot. These sites harness extra CPU cycles from your machine as part of a pool of other computers to mine Bitcoin (or any other coin).

While you are not mining at a huge hash rate, you could mine Bitcoin with little high-end equipment.

I started experimenting with a standard windows desktop computer, where I found that I was able to mine somewhere around 5 cents a day in Bitcoin. However, considering that the computer needed about 400 watts to run, I was losing more than I was making.

Recently, the Raspberry Pi 4 was just released.

The new Pi was a significant upgrade from the previous version in that it contained a quad-core 64-bit CPU running at 1.5 GHz with up to 8 GB of memory available.

Needless to say, the new Raspberry Pi had almost the same amount of horsepower as the laptop that I am using at this moment to write this post.

On paper, it certainly seemed possible, but there was only one way to find out - so a quick order to Amazon was made.

A few days later a package arrived with my new Raspberry Pi 4 along with a touch screen kit for it.

My intent was to turn the Pi in a mini-tablet computer with the touch screen serving as both the display and input device for the Pi.

Raspberry Pi with touch screen

The Raspberry Pi is enclosed inside of the screen's enclosure with the screen acting like a shield by plugging into the Pi's GPIO socket in order to supply power to the screen and sending I/O data to the Pi.

The screen display is provided by an HDMI adapter that connects the HDMI out from the Pi to the screen.

All in all, it was a very good screen kit that was very easy to assemble and also included a good number of heat sinks and cooling fans for the Pi.

Attaching heat sinks
Attaching the Pi to the case
Attaching the Pi to the case
Attaching the fan
Attaching the screen
Attaching the screen to the Pi's GPIO
Screen attached
Attaching  the case top of the case
Attaching  the case top of the case
Attaching  HDMI connector

Once the screen was enclosed, I installed the latest version GUI of Raspbian onto a micro SD card and booted up the Pi.

The nice thing about mining from a micro wallet is that there is really nothing special needed to set up the Pi for mining.

Once I did some preliminary set up on the Pi (like setting up the WiFi connection) all I needed to do was to call up the Chromium browser that is included with Rasbian and entered into the URL address line of the browser.

Coinpot requires that you set up an account and provide some authentication steps in order to confirm your identity as a human. Once that is complete you are then provided with a dashboard that gives you the option of mining a number of coins such as Dogecoin, Litecoin, and of course Bitcoin.

Selecting to mine a coin puts you into a mining screen which gives you the option of selecting the amount of CPU you want to dedicate to mining and how many threads you wished to mine.

Playing with the settings, I found that I was able to mine between 2 to 5 hashes a second on Bitcoin with the Pi if I set it to a High CPU setting with 6 threads.

I definitely wasn't going to set the world on fire with a hash rate like that, but I was definitely mining Bitcoin on a Raspberry Pi.

I'm mining Bitcoin!

At the hash rate that the Pi was producing, I was making about 0.00000014 BTC or about 0.001276 USD per day.

From an electrical cost perspective, the Pi was using about 0.13 KWh a day. Based on the electricity rates for my area, that came out to about 0.01 cents a day. 

So I am definitely not making any money out of this deal unless I decide to take the Pi off the grid completely and run it from a solar charger and battery (which is actually pretty feasible with a Raspberry Pi to be completely honest - and that may make for a future post).

But I am actually quite impressed with the fact that I could mine Bitcoin of the Pi - and with that, I consider it a huge success!

No comments:

Post a Comment