1 (edited by IoT 2018-09-25 12:48:23)

Topic: Raspberry Pi Actuator Control and URALS blockchain.

In this article I will go over to demonstrate of using Raspberry Pi computer with URALS blokchain to build working Control DC.

https://i.imgur.com/g5WW3tD.jpg

Why a Raspberry Pi?
Raspberry Pi is an inexpensive computing hardware platform that generates little heat, draws little power, and can run silently 24 hours a day.

Goal
Use a Raspberry Pi 3 to read in blockchain transaction data and control LEDs, relay, DC Motors  or similar mechanism.

Share

Re: Raspberry Pi Actuator Control and URALS blockchain.

Definitions
Micro SD card (8 gb or higher)
Monitor with a HDMI cable
Power Supply with a micro USB cable
USB Keyboard
Raspberry Pi 3
https://i.imgur.com/TOXzfmn.jpg

Breadboard
https://i.imgur.com/bG9SoiA.jpg

A breadboard enables you to connect other components(switches, LEDs, resistors etc), especially to the GPIO pins without soldering.

Resistor
https://i.imgur.com/X7EaIV9.jpg

In our project to test the work, we will connect the LED. To prevent destroy LEDs we must use resistor. An LED can only pass so much current before it will destroy.  A standard LED usually has a voltage drop of around 1.7v and the value of the resistor can be chosen to pass 20mA or less. Assuming an input of 5v, that the resistor should be 165 ohm or more, I chose 330 ohm.

LED light

https://i.imgur.com/zWTsWt5.jpg

Relay module
https://i.imgur.com/vse36y7.jpg?1
A relay module board. This board has built in protection circuit so you do not damage your Raspberry Pi.
Also note that there are 5v and 3.3v modules, I am using 5v module.

Female-to-female jumper leads and
Male-to-male jumper leads

https://i.imgur.com/f7cWt1L.jpg

Push Button

https://i.imgur.com/pwx0gjX.jpg

Share

Re: Raspberry Pi Actuator Control and URALS blockchain.

Installing the Raspbian Operating System A Step-By-Step Guide

  • Download the latest Raspbian OS

You can download the latest Raspbian OS here https://www.raspberrypi.org/downloads/raspbian/
unzip .zip downloads to get the image file (.img) to write to your microSD card.

  • Format the microSD card

Set up the microSD card into the microSD card adapter and plug that into the computer.
Download and install SD Formatter https://www.sdcard.org/downloads/
Open SD Formatter app and click Format in the bottom right corner.
When the format is complete, close the window.

  • Writing an image to the SD card

Download Etcher https://etcher.io/ and install it.
Open Etcher and select the Raspberry Pi .img to write to the SD card.
Once the operating system is installed on the SD card, remove the card reader from your computer and insert the microSD card into the card slot on the underside of the Raspberry Pi.

  • Installing the Raspbian OS

Connect your USB keyboard and USB mouse into USB ports. Plug the HDMI cable into the monitor and other end of the cable into the Raspberry Pi. Plug in the power on your Pi. Then, the Raspbian Home screen will be loaded. You will need to configure your Pi system and setup WiFi or you can use ethernet cable to connect to internet.

Share

Re: Raspberry Pi Actuator Control and URALS blockchain.

URALS node on Raspberry Pi 3

First of all you need to know the IP-address that the router gave out to your Pi.
Start your browser and enter router address (usually 192.168.0.1 or 192.168.1.1). You will now see your router's website. Enter login and password. In the menu's somewhere there is a list of connected devices(DHCP). They all have a IP-address. Take note of the one called Raspberry.

Download putty www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Install and open it.
Enter the IP-address of the Pi at the Host Name and press Open. When you see a prompt of user and password enter 'pi' as login and 'raspberry' as password (if you don't chenge it).

It's recommended to change default passwords.
This can be done from command line.
type
passwd
Now you'll be prompted to enter the current password, the new password, and then retype the new password.

Type the following commands to update your Pi
sudo apt-get update
sudo apt-get upgrade

Download the latest compiled binary of URALS for ARM processors https://github.com/JohnMnemonick/UralsCoin/releases
type on the command line
wget github.com/JohnMnemonick/UralsCoin/releases/download/1.1.0.13/urals-1.1.0.13-arm-linux-hf.tar.gz

wait while loading and un-archive the file, type this on the command line
tar -xvzf urals-1.1.0.13-arm-linux-hf.tar.gz -C /urals

Run your URALS daemon
./uralsd

You get an error because the program should set dependencies

type
sudo apt-get install libboost-program-options1.62-dev
sudo apt-get install libboost-chrono1.62.0
sudo apt-get install libdb5.3++-dev
sudo apt-get install libevent-pthreads-2.0-5

Run URALS again
./uralsd

It will configure itself and download the blockchain. Be patient, it will take a long time and will only happen the first time.

Start up another putty and type:
top

The CPU is 100% all the time. When its done it is just about 10%.

Get new accounts
./urals-cli getaccountaddress pool
./urals-cli getaccountaddress trigger


To be continued....

Share