1. Story Behind
I’m an electronic engineer, and do some investment in stocks during my spare time. So I plan to combine these two parts and DIY a stocks-monitoring device.
You can watch another demo I used to made first to know my idea: ↓
Then in this tutorial I’m going to share a simple edition to get the real-time price of US stocks and set alert to help you take better action.
2. Part List
- HY2.0 4-pin cable x1
- RJ45 Ethernet cable x1
- Interchanger/ router with PoE x1
Squama Ethernet PoE is an Arduino development board with Ethernet function, built-inATSAMD21 micro-controller and W5500 network chip. The PoE tape mounted on the board provides power supply through network interface, so that you don’t need additional power device and cable.
- Squama Ethernet PoE includes an ethernet board and a PoE Tape.
- A Type-C cabe is necessary for code uploading.
- if you don’t have a network device with PoE, it is also OK to give power supply through a Type-C cable.
Connect the modules as picture shown: ↓
This application is going to achieve two functions:
- 1. The buzzer rings when the stock price you are watching reaches the target line.
- 2. A red light flashes on the board when the stocks price you are watching goes up, and a green light flashes when it goes down.
First, you can download codes for the application from following link: https://github.com/Longan-Labs/Squama_US_Stock_Price_Buzzer ↓
And then, you need to open it with Arduino IDE, and upload the codes onto Squama Ethernet PoE.
After uploaded, you can see datas in Serial Monitor as picture shows. ↓
The codes above gets the real-time stock price of Apple Inc. If you want to get that of some other companies, just change the code to the company’s stock number at line 168. ↓
// end //