|All News -> Projects|
|Written by Nicholas McClanahan|
|Monday, 19 December 2011 16:39|
The Tannenbaum Ticker is a Christmas tree ornament that changes color based on how your stocks are doing
US and international stocks, commodities, and bonds can be tracked, including market-wide and industry indexes Trade data is polled every 30 seconds during the trading day. The ticker goes from dark red ( > 4% drop from open), to green (within 0.2% of open), to blue ( > 4% increase from open). There's also a 'short mode' to track short positions. First, I'll answer a few questions, then I'll show you how to make your own!
How does it work?
PartsYou'll need a few parts to build your Tannenbaum Ticker;
1 - A Christmas Ornament, an RGB LED, 47 ohm resistor, and hookup wire
I'm using a clear plastic ornament I got at Michaels for $2 or $3. You can use a glass ornament, but when the LED lights up, any chips or scrapes on the inside coating of the ornament will show through and it won't look as nice. The tape will diffuse the LED to make it look more even when it lights up.
The LED is common anode, you can grab one for $1.60 here. The 47 ohm resistor limits the current flow so the LED lasts a long time.
2. Propeller Platform and E-Net Module
You could also build this project on a breadboard, although it would be a bit unwieldy. The E-Net Module is based on the ENC28J60 chip.
ToolsAssembly took me about thirty minutes, and takes a little soldering. If you've never soldered before, there are a bunch of great instructables to guide you, like this one. You'll need a few tools:
Preparing the OrnamentIf you're using a clear plastic ornament, you'll need to stick something in the inside to diffuse the LED. I found some opaque tape - I just cut it into 1" squares and stuck it all along both halves of the inside;
Then, I used a dremel to put a small hole through the plastic;
Connecting the LEDThe LED has four leads, they're connected to each of the colors like this;
Solder pin 4 (the anode) to your 47 ohm resistor, then solder it to V33 on your E-Net module;
The wire connected to pin 3 (the longest pin), should connect to P25 on your E-Net module, Pin 2 goes to P27 on the E-Net module, and Pin 1 goes to P23.
Insert the LED partway into the ornament and squirt in some hot glue. Hold the LED in place until the glue cools down. Be sure that the leads on the LED aren't touching each other - just fold them 90 degrees apart in the hole;
Drop the E-Net module on top of the Propeller Platform USB, and you're ready to start loading up the software!
Picking StocksIt's time to decide what stocks to track! Start by downloading the software and unzipping it to your desktop. Open Stock_001.spin and scroll down to the bottom. See the lines;
This is the webpage that contains our stock quote. Change the line:
For example, the ticker for the Dow Jones Crude Oil Index is 'DJUBSCL', so change that line to;
Here are a few more tickers to get you started;
IP settingsThe Tannenbaum Ticker doesn't support DHCP, so you'll need to configure it to work on your local network. Open up Page_Reader_004.spin, there are four settings you may need to change;
for ip_addr, you should be able to choose an unused IP address on your network. Subnet is usually 255.155.155.0 and gateway and dns are usually the address of your router. If you don't know those settings, you can just copy your computer's config. In Windows, open up the command prompt and type ipconfig /all . In Linux, you can use route -n .
Tracking Other StuffThe Tannenbaum Ticker can be used to grab other data off the Internet! Just find a page with the data you want to use and point your project to it. In the same place we changed the stock ticker, we'll change it to the URL we want to grab data from;
to the page you want to track. Be sure to also update IP with the IP address of the server you want to connect to.
Not all web pages work well - you want to grab data from a page that is short (under 3 kb) and contains the data you want to track in an attribute. For example, if our data were in the page like this;
We could grab the value of the status attribute in our program with;
and every time our program runs
That's it! I had a lot of fun putting this project together, let me know if you have any questions or comments!