Kushagra Sengar
Created July 13, 2019

Bitcoin-Alert system with Buzzer and Led

This system allows us to regularly get updated with Bitcoin-price whenever and wherever we want.

BeginnerFull instructions provided1 hour18
Bitcoin-Alert system with Buzzer and Led

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Buzzer
Buzzer
×1
LED (generic)
LED (generic)
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Bolt IoT Android App
Bolt IoT Android App

Story

Read more

Schematics

Diagram

Code

Full code

Python
import json
import requests
import time
from boltiot import Bolt

SELLING_PRICE  =  10002.93

API_KEY = "xxxxxxxxxxxxxxx"
DEVICE_ID  = "BOLTxxxxx"
bolt = Bolt(API_KEY, DEVICE_ID)

def get_bitcoin_price():
   URL = "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD" # REPLACE WITH CORRECT URL
   response = requests.request("GET", URL)
   response = json.loads(response.text)
   current_price = response["USD"]
   return current_price
while True:
    market_price = get_bitcoin_price()
    print("Market price is"+ str(market_price))
    print ("Selling price is"+ str(SELLING_PRICE))
    if market_price > SELLING_PRICE:
        bolt.digitalWrite("0", "HIGH")
        bolt.digitalWrite("1", "HIGH")
        bolt.digitalWrite("3", "LOW")
        time.sleep(5)
        bolt.digitalWrite("0", "LOW")
        bolt.digitalWrite("1", "LOW")
    time.sleep(10)

Credits

Kushagra Sengar
4 projects • 0 followers

Comments