I have talked out my Floor Lamp (Ikea Orgel Vreten Floor Lamp) and how I got a Jugaad Plug-in Dimmer made for it. I had an Arduino Yún lying around and had just read up on Temboo. That's when I realized I could use the Arduino to control the lamp from the internet very easily. I noticed that Temboo could fetch tweets and so I got an idea - I could program the Arduino to dim in and dim out the lamp whenever @ZeniaIrani mentioned me in her tweets. I call the project "The Zenomaniac's Lamp"
Here is how I got it done:
Zenomania.ino
(Assign your Twitter keys and key secrets to the four string constants declared in the beginning of the code. Modify the author name in line 123 to your own sweetheart's name)
TembooAccount.h
(Modify the 3 defines to match your own temboo login name, application name and application key. Place this file in the same folder as .ino file)
Here is how I got it done:
- Configured the Arduino Yún to connect to to my WiFi. Installed the latest version of Arduino IDE on my PC.
- Bought a 5V cell phone charger
- Brought the digital from Sunrom: http://www.sunrom.com/249
- Assembled the circuit and installed everything in a plastic lunch box. I used white three cored cable used for electric irons for the AC input and AC output - they are long lasting and look nice. Installed 2 pin socket and plugs on the ends of the wire for easily attaching/detaching of the circuit to the lamp.
- Read up on the instructions and code for fetching tweets here: https://www.temboo.com/arduino/read-a-tweet
- Got a Temboo account. The free account allows you to add only one application. I renamed my default application (My Account > Applications) to "Zenomania" and noted down the application key. The free plan will allow you only 1000 calls per month - meaning you can check your twitter feed only that many times in a given month window before the thing stops working - this is sad!
- Got a Twitter Dev account - visit this link, login with your usual twitter account and create an application. I named mine "Zenomania". The Temboo application running on Arduino Yún requires four things - Access token, Access token secret, API key, API Secret. The API Key and API secret are shown on the API keys tab under the Application Management page. For the Access token and Access token secret, I had to click on "Test OAuth" Button - twitter then asked me to sign in once again with my twitter credentials and then displayed the Access token and secret.
- I added the secrets and API keys to the Temboo read-a-tweet example and downloaded the code to Arduino over the network. The Temboo keys go into TembooAccount.h where as the Twitter keys go into the .ino file. Once I was able to get the example to working, I moved on to the next step.
- I modified the Temboo read-a-tweet code so that instead of fetching tweets from my timeline, it instead fetched tweets that mentioned me. I added a function to shimmer the lamp - cycle through the 16 levels (to and fro) of dimming supported by the sunrom's digital dimmer. From the code I would call the Temboo API to fetch the latest tweet that mentions me every 65 seconds (Twitter has throttling active on all apps - you can fetch data only 15 times in a 15 minutes window before you are blocked until the end of that window). I would then check if the tweet is new and if its by ZeniaIrani. If yes, I enable the lamp to shimmer for the next 65 seconds until I check for tweets again.
- So once ZeniaIrani mentions me in a tweets, it may take upto 65 seconds before the lamp starts blinking. As mentioned earlier, because of limitations imposed by twitter, we can't check the tweets more often otherwise we will start getting HTTP error codes. Similarly, once you run out of 1000 API calls per month, the lamp will stop working till the end of the 30 days period. Temboo might not be that great after all.
![]() |
The Connection Diagram |
![]() |
16 Step dimmer modules from Sunrom. There are also 256 Step ones available that can be controlled using a single UART pin. |
![]() |
A lunch box to put everything in. D'Cold for curing the stuffy nose syndrome. |
![]() |
The Arduino, dimmer and power supply for Arduino all connected. White colored power supply was actually a phone charger. |
![]() |
The Zenomaniac's lamp - All installed, online and working |
The Shimmering Zenomaniac's Lamp
(Assign your Twitter keys and key secrets to the four string constants declared in the beginning of the code. Modify the author name in line 123 to your own sweetheart's name)
1 | /* |
TembooAccount.h
(Modify the 3 defines to match your own temboo login name, application name and application key. Place this file in the same folder as .ino file)
1 | #define TEMBOO_ACCOUNT "lithiumhead" // your Temboo account name |