IOTA News

Purpose of this program: the payment of IOTA coins to a specific address will switch a little motor on until the paid coins have been used (1 second = 1 IOTA).

This article is based on my article “For beginners: Switch a light on with the payment of IOTAs using a Raspberry Pi”.

Contact me if you are stuck. Also please let me know if you see anything that needs improvement.

1. Hardware Setup

1.1 Components

  • Raspberry Pi 3 (or 2) with the following components: WiFi, 32GB Micro SD card, Power supply.
  • 1 Channel DC 5V Relay Switch Board Module for Arduino Raspberry Pi ARM AVR
  • Breadboard wires (F/M and M/M)
  • Mini DC motor. I searched for the cheapest motor in eBay. The motor I purchased is 6V which means you need a resistor or use the motor for a short time only when using a 9V battery
  • 9V Battery

In addition, you will need for the setup: USB keyboard, USB mouse and HDMI cable.

1.2 Assembly

Look carefully at the diagram.

  1. The output side of the relay decides the on/off operation. If the orange cable (as seen in the diagram below) is connected to the bottom, then it is OFF/ON. If you connect the orange cable to the upper slot the operation will be ON/OFF.
  2. Once you turn the Raspberry on, the red light on the relay should light up. The green light will only light up if the relay is activated.

2. Software setup

On your computer do the following:

  1. Download and install SD card formater on your computer: https://www.sdcard.org and format the SD card.
  2. Download Raspbian (NOOBS): https://www.raspberrypi.org/downloads/noobs/ . You can download NOOBS lite.
  3. Copy the NOOB content to the micro SD card (only copy the content inside the downloaded folder and not the folder itself).

Remove the micro SD card from your computer and insert it into the Raspberry Pi.

Connect to the Raspberry Pi:

  • Monitor using the HDMI cable
  • Mouse and keyboard
  • Power cable

Power up the Raspberry Pi and install the full version of Raspbian.

After reboot, select menu →Preferences → Raspberry Pi configuration, then select tab Interfaces and enable: SSH, SPI and VNC.

If you prefer to connect remotely to the Raspberry Pi perform the following steps:

On the Raspberry open the terminal and use the following codes:

sudo apt-get update

sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

To get the raspberry Pi ip address (for example 192.168.1.20), type in the terminal: ifconfig

Reboot the Raspberry Pi:

sudo reboot

On your computer download the VNC viewer: https://www.realvnc.com/en/connect/download/viewer/ and follow the instructions.

Once installed use the Raspberry Pi IP address as well as username and password to log into your Raspberry.

3. Installation of Python

1. Ensure your Raspberry Pi is running the latest version of all the software. Run the following two commands on your Raspberry Pi to update it.

sudo apt-get update

sudo apt-get upgrade

2. Install the python2.7-dev package

sudo apt-get install python2.7-dev

4. Testing the motor

Let us test if the installation was so far successful.

Read the Full Article

This post was originally published on https://medium.com/coinmonks?source=rss—-721b17443fd5—4. The IOTA-News Community curates, examines, and summarizes news from external services while producing its own original material. Copyrights from external sources will be credited as they pertain to their corresponding owners. The purpose is to make use of 3rd party content or pictures as either allusion or promotional endorsement of mentioned sites. If you have a claim of copyright infringement with respect to material, please mail to support[at]iota-news.com. IOTA-News.com is a community run website and is NOT affiliated with the IOTA Foundation in any way.

 

source: https://iota-news.com/for-beginners-switch-a-motor-on-off-using-a-raspberry-pi-and-iota/

TheBitcoinNews.com is here for you 24/7 to keep you informed on everything crypto. Like what we do? Tip us some Satoshi with the exciting new Lightning Network Tippin.me tool!