Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Jayesh Rane
Published

Bitcoin Price Alert System

This system notifies you about the current price of Bitcoin and if the current price of Bitcoin exceeds the selling price it sends an alert.

BeginnerFull instructions provided2 hours470
Bitcoin Price Alert System

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Buzzer
Buzzer
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Connecting wires
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Snappy Ubuntu Core
Snappy Ubuntu Core

Story

Read more

Schematics

Hardware Connection

Buzzer Connection

Code

Code

Python
This code sends the current price of bitcoin and triggers buzzer if selling price of bitcoin is greater than current price of bitcoin
import requests,json,time
from boltiot import  Bolt
api_key="Your Bolt Cloud api key"
device_id="Your Bolt Cloud Device Id"
mybolt=Bolt(api_key,device_id)
selling_price=1000
while (1):
	URL="https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD,JPY,EUR" # REPLACE WITH CORRECT URL
	response = requests.request("GET", URL)
	response = json.loads(response.text)
	current_price = response["USD"]
	#print(current_price)
	if current_price>selling_price:
           print("The Current Price is",current_price)
           print("The Selling Price is",selling_price)
           print("Current Price is greater than the Selling Price")
           response = mybolt.digitalWrite('0', 'HIGH')
           print(response)
           print("LED is ON")
           time.sleep(5)
       	   response = mybolt.digitalWrite('0', 'LOW')
           print("LED is OFF")
           time.sleep(5)

	else:
           print("The Current Price is",current_price)
           print("The Selling Price is",selling_price)
           print("Current Price is less than the Selling Price")
           response = mybolt.digitalWrite('0', 'LOW')
           print(response)
           print("LED is OFF")
           time.sleep(5)

Credits

Jayesh Rane
7 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.