Bitcoin
A software developer going by the name of Satoshi Nakamoto proposed bitcoin in 2008, as an electronic payment system based on mathematical proof. The idea was to produce a means of exchange, independent of any central authority, that could be transferred electronically in a secure, verifiable and immutable way.
Since its launch in 2009, Bitcoin has been a controversial concept. Some people accept it as an anonymous currency, which protects their privacy and also provides a unified platform for all kinds of transactions online. Whereas there are others who shun it saying that it's the currency of the black market.
But, the recent upshoot of the Bitcoin price has made everyone want to invest in it. There are stories about people who paid 25, 000 Bitcoins for a pizza back in 2009-10 and are now regretting that decision. Whereas there are others who are running mining rigs and farms and making millions. But, it is not necessary that the Bitcoin price always stays high. Sometimes it rises and sometimes it falls. Therefore we build a system that tells us when it rises and when it falls.
Price APITo build the Bitcoin Price Alerting system, we will require a method to find the current price of Bitcoin by writing a Python program. Here we have used the following website https://min-api.cryptocompare.com to get the price of Bitcoin. It is a very popular site that provides APIs using which we can fetch various cryptocurrency related data. We have used Single Symbol Price API to get the price of Bitcoin in USD.
Setting up of buzzer
We have connected the buzzer to our Bolt module. The buzzer will be switched ON when the current price of the Bitcoin is greater than the selling price defined by us.
- Fetch the current price of Bitcoin every 30 seconds using the Single Symbol Price API in USD.
- Check if the current price returned by the API is greater than the selling price defined by you. You can define the selling price as a variable in your program.
- If the current price is greater than the selling price, the program should trigger the Bolt Cloud API to switch on the buzzer connected to the Bolt module
- Your program should repeat the steps 1, 2, 3 continuously every 30 seconds.
- You will require some additional Python libraries to be installed to run this project.
These libraries are:
sudo apt-get update
sudo pip3 install boltiot
sudo pip3 install pyOpenSSL ndg-httpsclient pyasnl
sudo pip3 install 'requests[security]'
Comments