Monday, December 23, 2013

Bitcoin Mining with Block Erupter ASIC Miner in Ubuntu

With the new rise of Bitcoin prices yet again more and more people invest in buying coins and mining hardware. This drives the prices up, not only of the coins themselves but the hardware too.
There are still people who consider bitcoin as a learning process, hobby or simply don't have the money to invest thousands of Euros in mining hardware, but would like to mine efficiently. The solution can be the Block Erupter Bitcoin miner.


Block Erupter is a small USB ASIC miner (Application Specific Integrated Circuit) that consumes very low power and gives a reasonable hash rate in return (roughly half of that of a modern GPU, but at a fraction of the cost!). It is small, "plug and play" and makes a perfect gift or hobby investment for enthusiasts.
In Europe the price of these miners has climbed quite strong after the price of Bitcoins went high (800-1000€ range), a Block Erupter was selling for around 25€ at the beginning of November where it is selling at around 75€ at mid December.




Technical Specifications


Dimensions: 2x4 cm (WxH; without USB connector)
Connection: USB port
Power Usage: 2.5W (5V DC, 500-510mA)
Hash Rate: 300-336 MH/s
Price: Varies, cheapest new devices is ~50€ as of 2013 Dec 15 (ebay)
Additional: Green LED indicates the status (LED on=standby, LED blinking=share is found/hashing)

(Reference see [1])

Mining with cgminer


In this example I will describe how to mine using cgminer [2] software under Ubuntu 12.10. If your Ubuntu is newer, it is not a problem, the steps should also work on the newer system. 

The device is "plug and play" under Linux, it doesn't require any drivers to be installed (unlike in Windows) so it is pretty easy to set up. Individual problems (missing packages and such) may arise during installation, however these are rather easy to solve. If you are having problems, leave a comment and I will get back to you ASAP to find the problem and help you get going.
  1. Download the latest cgminer.tar version from: http://ck.kolivas.org/apps/cgminer/
  2. Open a terminal (CTRL+T) and navigate to your download folder, by default
    cd Downloads
  3. Untar the file
    tar -xjvf cgminer-x.x.x.tar.bz2
  4. Go into the newly created directory
    cd  cgminer-x.x.x.tar.bz2
  5. ./configure --enable-icarus
  6. If you got any errors at the end of configuration, check them and see what package(s) are you missing. Install them with sudo apt-get install <package-name> OR from the synaptic package manager (sudo synaptic from he terminal)
    After eliminating the errors run
    sudo make && sudo make install
  7. Copy the example configuration file into a new configuration file that contains your pool's details.
    cp example.conf yourconfig.conf
  8. Now edit the config file you just created. This will have lines in it with pool address, worker name and passwords. Fill these out and save them.
    gedit yourconfig.conf
  9. Then to run cgminer, but note that you have to be root in order for Ubuntu to recognize the USB miner, so
    sudo cgminer --config yourconfig.conf 
  10. Alternatively, if you do not want to use a config file you can also run cgminer with
    sudo cgminer -o pooladdress:port -u minername -p port
Block Erupter mining under my Ubuntu machine

Suggestions


Now the down side, the Block Erupter gets hot in normal operating conditions. And by hot I mean HOT. After about 5 minutes of testing it almost burned my finger when I touched it. Hence it is advised to invest into cooling to prolong the lifetime of the miner.


Additional:
  • Powered USB Hub (each Block Erupter requires ~0.5A)
  • Cooling fan
  • Heat sinks
  • OPTIONAL: Raspberry Pi to control the miner(s)

Powered USB Hub


Make sure it can supply enough power to the miners. Each miner takes 0.5A at 5V DC giving 2.5 Watts of power consumption (Power=Voltage*Current). Hence a 5 USB port hub should get at least 5*0.5A=2.5A of current in order to supply enough power if 5 miners are connected. Even better, it is advised to get one with a slightly higher rating, say 3A supply for 5 miners. On the other side if you need 2.5A and you only have 2, it won't work.

Cooling


Passive Cooling
Generally preferred in power electronics as there are no components to fail (in the cooling system). Efficiency is lower than that of forced air or liquid cooling, but the miner should be built so that it can function out of the box as well. Although I doubt that the Block Erupter would live too long if running extensively without some cooling measures.

Forced Air Cooling
Installing a small fan to provide airflow over the miner is a common technique. USB fans are the easiest to use as they are "plug and play", however it is going to take 1 of the USB ports
A12V DC CPU fan can also do the job, and most likely provide better cooling performance as well. However, a CPU fan requires a separate 12V DC power supply. While practically it can run off from 5V DC, the airflow will be severely limited.


I have seen many people using a fan such as this one, I assume it does a nice job.

 

Personal Experience


I have decided to cover the top of my Block Erupter in heat sinks to increase heat transfer to the environment. I have ordered some small Copper heat sinks from eBay with some thermal paste sticker on the back for easy application. I will mount these on the front side of my miner and then direct a small USB fan on it as well. I hope to keep the temperature of the miner as low as possible using this method.


USB fan (source:Amazon.com)


Update: Unfortunately, my heat sinks didn't arrive from eBay so I have decided to give up this plan. Instead I have found a small USB fan I bought previously that I can use here.  (see image on the left)
The fan  produces quite a strong air flow so I have decided to have  a go at it.





I have removed the outer case so I am left with the inside only that allows me to better direct the airflow over the Block Erupter.
It is a little noisy, but I am running it in the basement so it doesn't bother anyone.
This fan keeps the ASIC miner at room temperature without any problem, it doesn't heat anywhere as much as without the fan.

As a footnote I noticed that when operating the miner from a USB port on my laptop it heats up  much faster than when powering it via an USB hub. Also I noticed that (at least when plugged into my laptop) the miner heats up even when I am not mining with it, LED lighting.

 

Conclusion


Is it worth to buy a Bloc Erupter? It depends why you want to buy it. It could be considered more of a hobby rather than a serious income. With the ~300 MH/s one will not get rich, it is just enough to make up for the price of electricity and the initial investment. 

Unfortunately I do not have any data on the lifetime of the small miners, nor could I find anything related online. So I cannot clearly state whether they are worth their money (on a purely economical basis) or not. I will record my progress of using my Block Erupter and update this article depending on my findings. One thing is for sure, it is a fun thing to have around, showing your support and liking of the Bitcoin community and possibly spreading the word about Bitcoins to your friends.