All things Raspberry Pi and Time Lapse

Posts tagged ‘Amazon’

LED Notification Light Box

The Hypnocube was a great project and I am very happy with it. It is amazing to just turn on and watch it! But I was never able to figure out how to program it to my own custom animations. I have not used that programming language before, and it is quite complex! Then I stumbled across this great tutorial on Instructables where it is shown how to create a project that connects to Twitter and changes color based on the “mood” that it found. The main hardware is an arduino, a shield to connect to wifi, an RGB LED, and a frosted acrylic container. This seemed like a great project, but I decided that I would use it for gmail notifications and other ideas instead. Based on this tutorial here at Adafruit I already knew how to turn on and off the LED to accomplish this using a Rasbperry Pi. And instead of building my own acrylic box I bought this one from Amazon. It came clear, so I also bought some 400 grit sandpaper. By rubbing the sandpaper in a circular path, the box soon had that “frosted” look. The instructables project was where I got the idea on how to frost the acrylic. He was frosting the sheets of acrylic before he made the box, which would have been easier to do I am sure. The tight corners made it difficult to get it totally frosted in some places. But the advantage of my box is that it doesn’t have the glue in the corners. And since it was cheap I am happy with the route that I took. And after spending some time sanding I got all of the hard to get spots enough that it doesn’t show.

The Raspberry Pi has enough pins to individually control 7 normal LEDs. So for my project that means two RGB LED’s and one more regular LED. I put the two RGB LEDs side by side then added two more white LEDs on either side to form a diamond shape. Both white LEDs are controlled together, so they are both on or both off. However since the Raspberry Pi only has one PWM pin, I would only be able to get full values of each of the color. So for example RED would be on, while GREEN and BLUE were off. Or RED and GREEN were on, but BLUE was off. Or all three were on. But I would not be able to get a mixture of those, like RED being at 40% and GREEN at 90% and BLUE at 20%. However there is some software that makes that possible. It basically turns the full values on and off really fast to simulate PWM. The link for that code is here on GitHub. So now I will be able to make any mixture of those RGB values. It works great and is very simple to use.

The next issue was the fact that my Adafruit breadboard wires are really short and that would look pretty terrible to have them all lose. And the LED box would have to be really close to the Raspberry Pi.  Then I thought about a regular network cable and did some research on the type of wire was used in them. Turns out it is very similar to the breadboard wires. So I ask on the Raspberry Pi forum if it would work to use a network cable instead of the short breadboard wires and was told that it should work just fine. Voltage drop was the only issue mentioned as a possible problem, but after measuring it, I can say that there was no voltage drop. A regular Cat5 network cable has 8 wires. And I would be using all of them. The six pins of the RGB LEDs and the one pin for the two white LEDs would use 7 wires. That left the 8th wire to be used for ground. I used a mini breadboard to handle the resistors and the connection to the Raspberry Pi and it works better than I thought it might! So now the LED box can be a few feet away from the Raspberry Pi.

After assembling everything in the box came the time for writing the code. I started with the example from Adafruit, but changed it to suit my LED setup. So now every 5 minutes the script check to see if there is an email, and if so it flashes red and white for about 30 seconds. Another script that I worked on was to get it to fade between the three main colors. That takes about a minute to make a full cycle through the colors and looks pretty amazing.

All of this was fun and awesome, but it had to be run from the command line. I decided to fix that. There is a great tutorial that explains how to install Lighttpd (A lightweight webserver) and PHP here. I just ignored the parts about MySQL as I do not need that right now. Once that was all setup and configured I wrote a simple basic webpage with a button for each of the main colors. I also added a button to turn it all off, and another to fade through all the colors – it calls the script that fades the colors . I accomplished this through a PHP page that executes the correct shell script. So now from any web enabled device that is connected to our wifi network, anyone can turn on the LED box easily and simply.

Below are some pictures showing how the box looks when lit different colors (no these are not just photoshopped to “show” the different colors) and the last one shows the wiring nightmare underneath!

IMG_9939 IMG_9943 IMG_9952 IMG_9953 IMG_9954 IMG_9955 IMG_9957 IMG_9960

And here is a quick screenshot of the web interface to control the LED box…

Screenshot_2013-03-18-22-26-15

Anyone have any other ideas for the LED light box?

Advertisements

Gertboard Arrived!

My gertboard arrived today! So I setup the soldering stuff and went to work on the practice board from Elenco that I bought from Amazon. And I found out real quick that the soldering iron that I have is not high enough quality. The tip did not get evenly hot which made it hard to solder. So I decided to buy a different soldering iron. I bought this one from Adafruit as they have Raspberry Pi and lots of other awesome electronics and DIY kits/parts. So I am assuming that since they say that this soldering iron is a good entry-level tool that it should be worth it. So now the only problem is waiting for that to ship…

I was looking up some instructional videos about the gertboard and came across these three from Element14.

Advice about assembly – Surface mount – Through hole

And as mentioned in this video at approximately 6:10 he says that there was only 10 jumper wires that came with the kit, and there are 12 LEDs. So there is not enough jumper cables to connect all 12 LEDs at the same time. So in addition to the soldering iron I bought a pack of these F/F jumper wires and also a pack of M/M jumper wires.  This gives me the option of creating my own M/F jumper wires by combining one of each. And these come in packs of 40 so I should have plenty!

Adafruit is a really awesome website. And Sparkfun is really amazing too!

Here is a picture of what all arrived in the package from Newark. Gertboard on the left. Small components in bags in the center. And some of the bigger chips in anti-static bags on the right.

IMG_0914

Next two images are of the GPIO cable coming out of the case that I posted about previously.

IMG_0909 IMG_0910

The next two images are of the bare Gertboard. First one is the top of the board, and the second is the bottom of the board.

IMG_0912 IMG_0913

RaspLapse Update

It was a little disappointing yesterday because my Raspberry Pi was supposed to ship from Newark/Element14 and it didn’t happen. The new ship date is July 5th July 12. But since this is the second third (or third fourth? I am losing track…) time they have moved the ship date I am not expecting it to ship on the 5th 12th of July.

An update on the Canon Powershot A510 is necessary as well. When the camera arrived it would not keep the date/time when the batteries were removed. This lead me to believe that the date/time battery was dead. After searching online I confirmed my suspicions. So I bought a pack of them from Amazon. It is really important that the camera can keep time when the power is off so when the Raspberry Pi starts it can get the time from the camera. And now with the new battery that will be possible.

Really looking forward to getting the Raspberry Pi and start testing! (Maybe someday I will get one….)

 

EDIT (June 02) – Just finished an online chat with Newark/Element 14 asking about the ship date being moved farther and farther back. His reply was that there was an unexpected development issue and it pushed ship dates back about 1-2 weeks.

Plan B

The Canon Powershot S2 IS will not fit in the enclosure with the cables connected. So after thinking about the requirements for the camera, I decided that CHDK is not a requirement like I originally thought. I can do everything from gphoto2 using scripts. So I ordered a Canon Powershot A510 from Amazon that is much smaller and as near as I can tell will fit in the enclosure. Now just waiting for it to be delivered!

BOM (Bill of Materials)

Here is a list of the materials (that I have though of so far) needed for the year-long time lapse.

First thing is Location. Its all about location, location, location.

1. A RaspberryPi. This is to control the camera and tell it when to take a picture. It would be possible for the camera to take a picture at certain times, but with the Raspberry Pi there will be more control over when the pictures are taken. This should cost $45 after shipping + handling.

2. A power cable to power the Raspberry Pi. I am planning on using an HTC micro USB cable that is here on Amazon that is $4 after shipping + handling.

I ended up going with a Samsung power supply from Amazon because the HTC power supplies did not have good ratings and people said they were not made by HTC. So I am using that Samsung because it had good rating and it is working good.

3. A SD card to use for the Operating System for the Raspberry Pi and to store images from the camera as well. Amazon once again for about $7 after shipping + handling.

4. A camera that is supported by gphoto2 and also by CHDK for taking the photos. The Canon Powershot SX100 or SX110 are the best camera’s that are supported by both gphoto and CHDK. Here is the SX100 listed on Amazon. I got mine for $100 (used – very good condition – had 1500 shots on it when I got it) after shipping + handling. The Canon Powershot A510 should fit in the enclosure and has full support from gphoto2. I bought one from Amazon for $41 after shipping + handling.

5. The third item is a USB cable that connects the camera to the Raspberry Pi. This is also availble on Amazon and mine cost $12 after shipping + handling.

6. An AC power supply is also necessary to power the camera. Once again Amazon seems to be the best. This cost $15 after shipping + handling.

7. A housing for all of these components is a critical point for the survival of the camera in all kinds of weather. An enclosure made for security cameras seemed to be the best option. I originally looking into building myself one using a waterproof container and a bunch of pieces to make it all work. Then I found this enclosure (also Amazon) and it has a heater and a fan to regulate the temperature. And it is IP66 rated. This costs $47 after shipping + handling.

8. A power supply to power the heater/blower in the enclosure is available at Amazon. It is sold by the same supplier as the enclosure and is confirmed to work with this model of enclosure. This cost $36 after shipping + handling.

9. Silica gel is something that comes in packages and I will put several of  these packets in to reduce moisture.

10. A case to hold all of the power cables that plug into the power strip. This needs to be kept dry and it has to be in a separate case because the enclosure that holds the camera and Raspberry Pi is too small to hold all of this as well. This Sockit Box case from Amazon should do the job nicely! It costs $33 dollars which is a little expensive I thought, but it is a very important part of the project.

11. I bought some plastic screws and nuts to hold the Raspberry Pi in the enclosure and keep it from touching the metal sides. This I bought from my local Lowe’s store and it only cost $5 dollars for all of it.

Still need

A power supply for the enclosure. It does not come with one, but requires one for the heater/fan.

A power cord (120V) to be able to run to the enclosure to power all of the electronics.

Conclusion

At this point all of the materials cost $207 and I hope to keep it under $250 with the rest of the materials that are still needed. And no I am not trying to sell Amazon stuff, but they have been consistently the best price for the quality that I need.

Tag Cloud