Intro: Available Lamp
Whenever i'm gaming I tend to lose track of the time. So I was looking for a way to notify myself in a subtle way. I taught of a lamp that emitted a color to tell me that I have an appointment or that my schedule is free. If the lamp is emitting a green color, it means my schedule is clear for the coming two hours. When i'm not available it emmits a red light. If an event is more than two hours away it emmits a white light. The orginal intention was to let the color fade from green to red. So it was more clear to me that I have to stop the activity en get ready for my appointment. And if my schedule is free for the day it wil emmit a white light.
The lamp connects to a webservice wich gets the minutes remaining to my next event. In the current code it emmits a green light when its 2 hours before my event en a red light during the event.
Instead of designing a lamp myself I searched Instructables for the perfect design and I found one right here (user: BarbaraD43) this person made a design with similar functionality to mine. I fell in love with the design and used it in this project.
What are we going to need:
- 1 Arduino uno
- 1 Arduino ethernet Shield
- 1 Breadboard
- 1 RGB ledstrip
- 3 mosfets
- Multiple jumper cables
- 1 Ethernet cable
- 1 power adapter
- Multiplex thickness 3 mm
- Acrylic thickness 3 mm
- CNC laser cutting machine
- A google account to get the calendar events
- Arduino software
- A php IDE
- A webserver (I used MAMP for this Project)
Step 1: Step 1 : Design
Like I said before this project is based on a other project, which you can find here on Instructables. The pictures on this instructable are of my try to recreate the awesome design. If you want the design for the lasercutter you can find it here.
Step 2: Step 2 : Hardware
The hardware setup is based on the Adafruit RGB tutorial the only diffrence with that one is that I attached a Ethernetshield to my arduino so it can communicate with the webservice.
Step 3: Step 3 Arduino Sketch
The sketch is based on the colorswirl from adafruit which you can find in the adafruit tutorial. I implemented the ethernet code from the arduino site so that it connects to my webservice. The complete sketch is available here.
Step 4: Step 4 : Webservice
Okay, Now lets connect it to the google calendar. to do that you need to have acces to the goole API. I used the PHP quickstart and changed it to work in a browser and that it only returns one event. The code is available here. But you need to go trough some stepds to acces the api. Wich steps excactly? Let let google explain that ;) Follow the instructions which are available via the next URL : Link to google API quickstart
The txt file is the PHP code i used. But you need to use composer to get al needed code from the google API.
Step 5: Step 5 : Bring It Al Together
So if everything goes as it should your lamp will be shining like mine.
In the video you can see the lamp in action. On the laptop you can see me draging a event to change the color. If an event within two hours it shows a green light if the event is right now it shows a red color. If the event is further away than 2 hours it shows a white light.
I'm very happy with the result. But if you have a smaller breadboard available, use that one. Mine is to big so closing the case isn't that easy.
the next stem for me is tho make the lamp work via WIFI.