Image of eBits Academy computing illustration

Solar-Powered Cryptocurrency Mining - An Educational Project

  • January 20, 2022
  • |
  • Jesper Nielsen

This weekend project builds a small solar-powered Duino-Coin miner as an educational experiment with ESP32, networking, and power supplies. It is a hobby project, not an investment or a promise of income.

If You Have Not Heard of Cryptocurrency

 

 

Cryptocurrency exists digitally. Many systems use cryptography and a shared transaction history to prevent the same value being spent more than once; this does not make files impossible to copy. Can you create extra Duino-Coin by copying a file? No: Duino-Coin is a centralised project whose system manages balances and transactions. It should not be described as a decentralised blockchain like Bitcoin. Read the project’s current documentation for its protocol, operation, and limitations.

CONTENTS

DUINOCOIN

Duino-Coin is a centralised currency that can be mined on Arduinos, ESP8266/32, Raspberry Pis — current board range; check the exact Raspberry Pi model, interfaces and accessory compatibility, computers, and smartphones. To set it up, you need one of these devices. In this project, we will use an ESP32 powered by a solar panel and battery bank.

ACCOUNT SETUP

To create an account/wallet, go to wallet.duinocoin.com in your browser. You will see the screen below; click Create a new wallet.

Now enter your username, password, and email. Use the username and password to log into your wallet later.
Note: you also enter the username in the Arduino code along with your network details, so the miner knows which wallet it belongs to.

ESP32 SETUP

To configure the ESP32 as a cryptocurrency miner, download an .ino script. This requires Arduino IDE to be installed on your computer. If needed, follow this guide: Setting Up ESP32 for Arduino and Platform IO

The following link shows the project releases. The example below uses the historical version 2.7.3; check current documentation, file structure, and compatibility. Download the relevant Sourcecode.ZIP and extract it.

Release Release 2.7.3 · revoxhere/duino-coin (github.com) 

In this example, open duino-coin-2.73 in the folder, then select ESP32_Code

 

You will find an .ino file called ESP32_Code.ino. Double-click it to open it in Arduino IDE.

 

Before building and compiling, enter three details in the code so the ESP32 can connect to your network and the wallet created in Account Setup. At the top of the source code you will find the following. Enter your own details, keeping the quotation marks "".
// Change this to your WiFi SSID
const char* ssid     = "Your WiFi SSID"; 
// Change this to your WiFi password           
const char* password = "Your WiFi password"; 
// Change this to your Duino-Coin username       
const char* ducouser = "Your Duino-Coin username";
// Change this if you want to display a custom rig   
const char* rigname  = "None";                     

MINING TEST

Log into your account to check whether the miner is connected and recognised by your wallet.

The miner named Solar-rig is shown as registered and mining coins. 

BMS (Battery Management System)

For the solar-powered miner, we use this battery holder with an 18650 battery to power the ESP32 during dark hours. This holder has a built-in 3.3v regulator, which can power the ESP32.

The 18650 battery was bought from batterilageret.dk. Batteries with different capacities (mAh) are available. Higher mAh means you can power the ESP32 board for longer. This project uses an 18650 battery with 3120 mAh from batterilageret.dk

BMS Specifications:

5~8V input voltage
3V & 1A output
5V & 2A output
LED indicator (green means fully charged & red means charging)
3 x 3V output ports
3 x 5V output ports

Check that the particular battery holder has appropriate cell protection, charging control, and output regulation. A protection circuit alone is not a charger. Measure the output voltage before connecting ESP32, and observe correct cell polarity. There is a Micro USB input, used here to connect the solar panel — current selection; check compatibility. The USB-A output can power USB-A electronics.

SOLAR PANEL — current selection; check compatibility

The aim is an off-grid system powered entirely by a solar panel — current selection; check compatibility. The following solar panel — current selection; check compatibility was chosen for the project. It is rated up to 6W under specified test conditions. Actual power depends on sunlight, angle, and temperature and must be sufficient for the ESP32 plus losses and any battery charging. Simultaneous operation and charging require a charging module with suitable power-path/load-sharing support; check its documentation.

Solar Panel Specifications:

Maximum power: 6 W
Operating current: 1000mA
Operating voltage: 6V

As shown in the image, the solar panel has a USB-A — current selection; check compatibilityoutput. The connector shape does not guarantee regulated 5V. Check the panel’s maximum open-circuit voltage and the charging module’s allowed input; use a suitable regulator if needed. Only once voltages are compatible should you connect them with a USB-A to Micro-USB cable.

COMPLETE ASSEMBLY

Connecting the solar panel — current selection; check compatibility to the battery shield lets you power the ESP32 during daylight hours, with the 18650 battery taking over afterwards. The images below show a 3D-printed enclosure designed to attach to the back of the panel. Download and print the enclosure, or download the project and change its dimensions using the parameter settings in Fusion 360.

Mowglli/Projekt_kasse_duinocoin: Slicer files and Fusion360 project. The enclosure is parameterised so height, width, and length can be changed (github.com)

OTA

Duino-Coin uses OTA, allowing you to send new code versions to your ESP32 over a supported network. Arduino OTA normally uses local network access; do not expose an unsecured OTA port to the internet. Follow the current firmware documentation and use authentication where supported.
To compile new code for your ESP32 using OTA, go to Tools  -> Port: -> Network ports 

LIMITATIONS

Here, Duino-Coin should be treated as an educational hobby project. The ability to transfer or exchange a balance may change; check the project’s current rules and services. There is no guarantee of value, liquidity, future exchange, or income. Choose the project to learn electronics, not for an expected investment return.

 

 

Leave a comment

Please note, comments need to be approved before they are published.