D.deevi Naga Mani khanta
Published © GPL3+

CryptoCurrency Alert notification System Using Boltiot

A system to alert the Bitcoin and Ethereum pricing!!!

IntermediateFull instructions provided3 hours548
CryptoCurrency Alert notification System Using Boltiot

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
LED (generic)
LED (generic)
×2
Buzzer
Buzzer
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×7

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
SMS Messaging API
Twilio SMS Messaging API
mailgun

Story

Read more

Schematics

A graphical Representation of Circuit Diagram

2 leds and a Buzzer is used in this circuit

Output Screenshot of the Code

After Running the code your output looks Similar to it

Code

cryptoalert

Python
The main code used to check the bitcoin and ethereum price with the given input
import conf
from boltiot import Sms,Email,Bolt
import json,time
import requests
#top cryptocurrencies are Bitcoin and ethereum so i made according to it
#this product gets input from ther user and perform according to requried amount and currency type

bolt=Bolt(conf.API_KEY,conf.DEVICE_ID)
sms=Sms(conf.SSID,conf.AUTH_TOKEN,conf.TO_NUMBER,conf.FROM_NUMBER)
mailer=Email(conf.MAILGUN_API_KEY,conf.SANDBOX_URL,conf.SENDER_EMAIL,conf.RECIPIENT_EMAIL)
print("Try your CountryISO4217 Code# if not there\nINR\nUSD\nEUR")
Currency=input("Enter the Currency to be Invest:")# to get the Currency type your are investing
selling_price=float(input("Enter the Amount:"))#amount your are investing

def bitcoin_price_check():
    url=("https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms={}".format(currency.upper()))
    response=requests.request("GET",url)#to get the value of botcoin corresponds to Currrency
    response=json.loads(response.text)
    current_price=response[currency.upper()]
    return current_price
def ethereum_price_check():
    url=("https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms={}".format(currency.upper()))
    response=requests.request("GET",url)#to get the value of ethereum corresponds to Currrency
    response=json.loads(response.text)
    current_price=response[currency.upper()]
    return current_price
while True:
    bitcoin_market=bitcoin_price_check()
    ethereum_market=ethereum_price_check()
    print("Market price of Bitcoin is:",bitcoin_market)#Printing The Deatils of the user to Know
    print("Market price of Ethereum is:",ethereum_market)
    print("Selling Price is:",selling_price)
    try:
        if bitcoin_market<selling_price:##If bitcoin is less than sellingprice
            bolt.digitalWrite("0","HIGH")#buzzer and led1 is one
            bolt.digitalWrite("1","HIGH")#led2 is also on
            response1=sms.send_sms("The Bitcoins are at price ={} and Ethereum are at price={} it is the right time to Invest to Get Profit".format(bitcoin_market,ethereum_market))#sms is been send
            print("Status of Sms at Twilo:"+str(response1.status))
            response=mailer.send_email("Alert","The Bitcoins are at price ={} and Ethereum are at price={} it is the right time to Invest to Get Profit".format(bitcoin_market,ethereum_market))#e-mail is been send
        elif ethereum_market<selling_price:#If ethereum is less than sellingprice
            bolt.digitalWrite("0","HIGH")#buzzer and led1 is one
            bolt.digitalWrite("0","LOW")#led2 is off
            response1=sms.send_sms("The Ethereum are at price={} it is the right time to Invest to Get Profit".format(ethereum_market))#sms is been send
            print("Status of Sms at Twilo:"+str(response1.status))
            response=mailer.send_email("Alert","The Ethereum are at price={} it is the right time to Invest to Get Profit".format(ethereum_market))#e-mail is been send
    except Exception as e:
        print("Error occured:below are details")
        print(e)
    time.sleep(10)#led and buzzer glows for 10seconds
    bolt.digitalWrite("0","LOW")
    bolt.digitalWrite("1","LOW")
    time.sleep(60)#every 60 seconds it is been checked
    
            
 

conf

Python
the details needs to access boltwifi module ,twillo,mailgun for alert notification
SSID = 'You can find SSID in your Twilio Dashboard' 
AUTH_TOKEN = 'You can find  on your Twilio Dashboard' 
FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
MAILGUN_API_KEY = 'This is the private API key which you can find on your Mailgun Dashboard' 
SANDBOX_URL= 'You can find this on your Mailgun Dashboard' 
SENDER_EMAIL = 'This would be test@your SANDBOX_URL'
RECIPIENT_EMAIL = 'Enter your Email ID Here'
API_KEY = 'This is your Bolt Cloud account API key'
DEVICE_ID = 'This is the ID of your Bolt device'

Credits

D.deevi Naga Mani khanta
1 project • 0 followers

Comments