loading

Want to mine some bitcoins? Want to earn for free? Have a pi not being used?

Then lets mine some bitcoins!

Step 1: What Is BitCoin?

If you don’t know already, Bitcoin is a virtual currency set up in 2009. Bitcoin has grown in reputation over the past few years becoming a very popular as a method to pay for services over the internet. The value has rocketed recently thanks to the huge coverage in the media, for both positive and negative reasons.

There are two ways to get Bitcoin:

-Buying them from an exchange, which is the process of converting local currency to Bitcoin.

-Mining them. Mining is the process of verifying transactions in the blockchain.

As the whole of the Bitcoin system is decentralised, every transaction is publically viewable within what is called the blockchain. This blockchain contains every bitcoin exchanged between users so, as there is no central server, it has to be self governed. This is the job of the miners.

Step 2: Requirements

In order to mine Bitcoin, you will

A pool account

Bitcoin Wallet

Raspberry Pi

Raspbian image SD card

USB Bitcoin miner

Step 3: Creating an Account

There are two things you need to do:

Download a bitcoin wallet

Create a pool account

Set up paymentSet up workers

Download a Bitcoin Wallet

A wallet is a program that sits on your computer and gives you a wallet address, this is a unique string of numbers and letters that you will use to receive bitcoins. Download the client for your computer from https://bitcoin.org/en/download

After installation, you will have to save a file called wallet.dat, keep this file safe, as this contains your unique wallet address within it, including all bitcoins that you will gain. If you lose this file, you cannot recover any bitcoins it contained.

Create a Pool Account Once you have a wallet address, create a pool account. A pool is a huge collection of other people working towards gaining bitcoins. Due to the complexity of mining a bitcoin, it has become unrealistic to solo mine–the act of processing millions of numbers to solve the block problem. Working as a group, or pool, lets everyone have a chance of earning some Bitcoin. There are many pools around, in this tutorial I’ll be using one called Slush’s pool: https://bitcoin.org/en/download

Set Up Payment

Once you have created a pool account, you'll need to enter your unique wallet address into the Bitcoin payout address.

Create Worker Account

Next step is to create a worker login account. Within your pool account you have the ability to create something called a worker for each of your bitcoin miners, so you're able to monitor them all separately just in case one should fail.

Each worker has its own login name and password. Whilst you are on My Accountclick Register New Worker and give it a name, for example; worker, and a password. Now you're ready to set your Raspberry Pi mining for Bitcoin.

Step 4: Setting Up the Raspberry Pi

Start with a fresh Raspbian install, if you don’t know who to do this, read the tutorial How to Install NOOBS on a Raspberry Pi With a Mac.

If you plan on running more than one Bitcoin miner at the same time, it is best to use a powered USB hub. Take into account the power rating as mining will need a lot of power, as much as one mp per miner.

With your USB miner attached to your Raspberry Pi, let’s get everything installed.

Step 5: Installing Required Libraries

The miner to be installed comes as source files, which means that the program must be compiled into a binary before it can be run. To make a program, in this case BFGMiner, many dependencies are required.

Dependencies are additional software, or libraries the program needs in order to compile properly, as it has been developed using them to make the software more efficient. Hopefully you will be seeing the Raspbian desktop, so double click on LXTerminaland type in the following:

1) sudo apt-get update

2) sudo apt-get install autoconf autogen libtool uthash-dev libjansson-dev libcurl4-openssl-dev libusb-dev libncurses-dev git-core –y

This process will take a few minutes to complete.

Step 6: Installing BFGMiner

Once all the dependencies have been installed, now it is time to download and install BFGMiner, so type the following into LXTerminal. It’s normal for these to take a few minutes to complete so some patience is needed.

git clone https://github.com/luke-jr/bfgminer.git
cd bfgminer

./autogen.sh

./configure

make

You will be greeted with a screen that looks similar to the following:

Step 7: Start Mining Bitcoin

Now you’re ready to start mining. To do this, providing you're using Slush’s pool, you’ll use the following command:

./bfgminer -o stratum.bitcoin.cz:3333 -O username.worker:password -S all

The username section is composed of two parts, the username that you use to login to the pool, and worker which is the worker name you gave when you registered the worker. Finally, the password that was set when you created the worker.

That’s a lot of numbers, so I’ll make some of them a bit clearer.
Current mining speed, typically calculated in megahashes or gigahashes. The number of hashes a second that can be calculated the better. A hash is an algorithm of converting numbers and letters into an undecryptable set of characters. So a miner is used to process millions of numbers in an effort to match the hash to guess the original number. The more hashes that can be processed the faster it is able to solve the problem.

Number of accepted shares. A share on a pool is to show the miner has successfully worked out a given problem, so the more shares you can process the better your reward from the pool.

Detailed information on accepted shares and pool updates. This is a running log of what is currently happening with the miners and basic pool information, such as messages of updates and when new blocks are found.

More information can be found at the BFGminer github site.

Step 8: Conclusion

Following these steps will leave you with a very energy efficient bitcoin miner, as a Raspberry Pi only uses four watts of power, and a miner is typically 2.5W. Mining used to be done with computers consuming over 700W for the same process so to make a jump in savings helps repay the cost of the hardware we are using.

All there is to do now is to sit back and watch the money slowly build up. Though it is important that you understand that Bitcoin value fluctuates wildly, it is extremely volatile, so invest at your own risk.

You can also put up LCDs. Connect more Pis for getting better speed :D

For more information there are a number of websites and forums available, such ashttps://bitcointalk.org/,to help get you started.

did not work for me, got to the part where you make and was not recognised.
<p>interesting article.<br>I was just wondering, with an average usb miner costing say 50 USD and an Rpi say 40 USD, did you already break even?<br>I really have no idea how long it would take to mine a bitcoin r wether that is even a predictable time</p>
<p>from what I've read it should take 70 years to break even</p>
<p>What usb bitcoin miner did you use?</p>
<p>Can you do this project without a USB block erupter/miner?</p>
<p>Everything went smooth until the make command then I got &quot;No targets specified and no makefile found&quot;</p>
<p>how much BTC would i make with four RPIs - model 1 1st model??</p>
<p>you can't mine bitcoin with the raspberry pi, the pi is only used to host the miners so they don't need to be tethered to a computer</p>
<p>autoreconf pakage required</p>
<p>What USB miners would anyone suggest? Something cheap; I'm not trying to support myself on this or anything</p>
<p>http://www.ebay.com/itm/Avalon-Nano-3-Newest-USB-3-6Gh-s-Asic-Bitcoin-Miner-/262410771297?hash=item3d18e69b61:g:3s0AAOSwlHRXItdU</p>
Any idea how I could add a PC CPU to the raspberry pi?
<p>Just lop off the Broadcom unit and slab on an i7-6700k with some superglue! Probably won't run any faster but it will look ultra cool. :)</p>
<p>Thanks for sharing this! Maybe your next instructable could be how to make this profitable ;)</p>
<p>How much sd cards and usb miners do I need for every Pi? There are four usb`s in the picture, but I don`t sure if I can get enough.</p>
<p>Link to the acrylic enclosure you used to house the eight Raspberry Pis?</p>
<p>http://www.lab7.io/rpi-cluster-1/</p>
<p>To see how much you can make on mining check out </p><p>https://bitcoinwisdom.com/bitcoin/difficulty - at the moment you can generate about 10 US cents worth of bitcoins per month with 1.3Gh/s as shown on the display on the picture in the article. </p>
<p>Hah. At SDG&amp;E current average electricity costs ($.21 per kwH) it would cost about $.21 per kwH (assuming 6.5 watts usage 24 hours per day), so you'd be losing 11 cents per month. Break-even is somewhere around 14 to 15 cents per kwH (assuming the 10 US cents per month earnings is correct).</p>
<p>how about using solar power...</p>
<p>You will most likely find more money on the streets. By far more money if you don't invest in high end mining equipment.</p>
can this setup process work to mine scrypt coins like lite and doge assuming you bought the scrypt asic hardware? I know people are doing it but no one has the same miner for scrypt it seems
<p>It would be cost-effective if you live someplace where electricity is used for heating. At least in the winter, or perhaps for some commercial processes.</p>
<p>You must mention in your article that mining is not profitable anymore, unless you have free electricity (that is stealing it), but in that case stealing money should be considered as more effective solution :)</p>
<p>I have free electricity and I'm not stealing it. It's included in my rent :)</p>
<p>Well, it's not really free. That cost is included in your rent.</p>
<p>I get electricity from the sun. Filthy electricity thief, that I am. Sorry, sun!</p>
<p>I think this is a great little thing to do. While you will never make money off of it; it's cool just to say you were a part of it. Conversation starter with your nerdy friends. I've got some coming in; if you want you could become a part of a multipool which will focus on whatever digital currency that is most profitable. </p>
What sort of money per day/week are you looking at so far?
<p>$0.02 per month per USB device. Unless you get free electricity, you will be making a loss.</p>
<p>Even with free electricity you'll need about 84 YEARS to make up the cost (if my math is correct) of USB miners. Each USB miner costs $24. According to current difficulty to make $1 a month, you'll need 43 miners, that's a $1000. I'm not even counting cost of RPis here. </p>
<p>I am curious, too, what the unit &quot;mp&quot; means. Although you say it's a unit of power, did you mean unit of current, and mean to say &quot;as much as 1 Amp&quot;? </p>
<p>Looks pretty good. What would need to be changed to use cgminer ?</p>
<p>&quot;as much as one mp per miner&quot; I'm not quite sure what you mean here. mp is not a unit of power, or even of current. Perhaps you mean mA, but that's not much power at 5 mW. The raspi can supply 100 mA of current to each USB port, so it would probably be more than that.</p>
The author probably meant to say &quot;Amp&quot; and the &quot;A&quot; got left off. it happens.
Oh wow, you're definitely right! I was looking at the little m as a prefix meaning mili, but he obviously just meant 1 Amp. Thanks!
Still, it probably uses more than 1mA. He asked a valid question
<p>Nice write up. I have to ask, is it work using a RPi for mining? Even with a cluster of RPis, I wonder if using graphics cards are a better solution.</p>
The Rpi is the controller and the data link between the miners (asics) and the pool/blockchain. I run a Rpi with a bigger asic than what is in the picture but for me in the UK there is no real chance of a profit unless the bitcoin price rockets again.
<p>OK that makes a bit more sense. Do you have any information on the ASICS you use? </p>
<p>Block Erupter ASIC usb miners and the ones like them will never pay for themselves in terms of the return on your investment because they have a ridiculously-low hash-rate. A hashing rate is how powerful the device can crunch numbers. Even a cluster of these things wouldn't be enough for a return on investment because they are no longer efficient/powerful enough to compete with the other ASIC mining devices that are exponentially more efficient/powerful. Which, also means they are more expensive. However, you may use a Pi as a controller for ASIC devices that are supported. Most ASIC devices have their own embedded controller, now-a-days, though.</p>
I use a new R-box 2 which when overclockwd runs at 140ghs which is good considering it's listed at 100-110ghs. If I'm lucky I might pull &pound;2.50 out every 10-12 days. like I said no money in it now.
<p>They are &quot;USB Block Erupters&quot; (that is how they spell it) if you want to google them.</p>
<p>A graphics card producing the same 333MH/s as these modules will use around 150W. The USB modules use 2.5W. You will also have an extra 100W for the PC.</p>
<p>With such low power could you set up a solar bank for power production and cut out that cost?</p>
<p>What a great project and a fun way to start mining.</p>
<p>Excellent write up and explanations. It's a cool project. What I don't understand is it appears that diy bitminers seem to be investing to contribute to the bitcoin process but it won't ever break even. What's worse, as the system requires ever increasing hash rates which makes this equipment obsolete. </p><p>I'm not meaning to troll. Is it more of a &quot; I can do this because it's kinda neat&quot; thing?</p>
<p>Interesting project. What kind of rate are you seeing for your setup (Bitcoins / day) and how long do you expect it to take until you see a return on your investment at the current Bitcoin valuation? If more people start doing the same thing will that cut into your Bitcoin rate or are there plenty of jobs?</p>
Any idea of kWh usage versus bitcoin production?
<p>Each USB module is 2.5W, and gets 333MH/s, or $0.02 in bitcoin per month . Add about 10-20W for the Pi, USB hubs and PSU losses and work out your cost of electricity from that.</p>

About This Instructable

427,304views

1,406favorites

License:

More by ssarthak598:DIY Smart Home Monitoring Bottle Arduino Video Game (The DIY Gift) Is My Fridge Door Open?! 
Add instructable to: