2016-09-03

A few days ago, the urge to create an internetted thingy was upon me. Recently, I had been reading documentation regarding machine to machine communication using MQTT as well as BLE, and then I took a quick look at my tinker pile. The amount of neat things that I purchased for use in a project was far too high.... and then it hit me: LESS HOARDING, MORE MAKING!

What I was craving to make, was a network accessible pixel LED, inside an orb light fixture, that could be controlled using MQTT.

For this build, I used:

  • an orb light fixture from the ReStore
  • an Unwired One single board computer running OpenWRT
  • a single ws2801 pixel LED that was left over from the Glimmer build.

The Build

The Fixture

The orb light fixture appears to be a run of the mill wall or ceiling CFL fixture. If I remember correctly, the orb cost around $5. The cost of computer cases these days is getting out of hand. :)

Take it Apart!

For some reason, the fixture manufacturer decided to put a bunch of unnecessary crap in my new computer case. Fortunately, it only took a few minutes to get the orb in a usable state.

Test the Circuit

ws2801 pixel LEDs are controlled using SPI. On the Unwired One device, there are no GPIO pins that are dedicated to SPI. Instead, the SPI bus is created by loading a kernel module with arguments to determine which GPIO pins will be used for SPI.

Solder Leads to the LED

Once the circuit was working, leads were soldered to the LED so that it could be connected directly to the GPIO headers.

After the soldering was complete, the leads were wrapped in electrical tape.

Make a Notch for the Power Cable

Since the orb is intended to rest on a table, it was necessary to make a notch in the base for the power cord to fit through. Thus ensuring that the orb will be flush on a flat surface. After a bunch of waffling around trying to find my files and metal snips, a grab and twist with some needle nosed pliers did the trick.

Put it Together

After more waffling while trying to determine the best way to make some fancy standoffs for the computer board, I opted to simply hot glue the board to a piece of cardboard, and then hot glue the cardboard to the underside of the orb base.

Fast
Simple
Effective
... and I'm lazy

The LED was also hot glued to the base, pointing upward into the glass orb. /

Now me has ORB!

Have Some Coffee

Technically, this picture is for the morning after the Orb Device had been created, but it does a damn fine job of showing what the orb thingy looks like.

The Code

Enable SPI

As previously stated, the SPI on the board needs to be configured by added a kernel module. In order for the kernel module to be loaded each time the device is restarted, the /etc/rc.local file was edited to launch the following script:

#!/bin/sh

#see http://www.unwireddevices.com/wiki/index.php/Working_with_SPI_(C/C%2B%2B)
#BUS : SPI bus number, can be bus0, bus1, bus2, bus3
#ID : SPI device ID (integer number)
#SCK, MOSI, MISO : GPIO numbers for the corresponding SPI signals
#MODE : SPI mode (0, 1, 2 or 3)
#FREQ : max SPI frequency (Hz)
#CS : GPIO number for the CS signal (optional)
# insmod spi-gpio-custom BUS=ID,SCK,MOSI,MISO,MODE,FREQ,CS

bus="bus1"
id=1
sck=20
mosi=23
miso=18
freq=25000000

cmd="insmod spi-gpio-custom $bus=$id,$sck,$mosi,$miso,0,$freq"
echo $cmd
`$cmd`

Honestly, the entire script can be replaced with one line of code: the final command. However, the script was written while reading the documentation of the process and if I ever need to edit the script, there are hella useful comments in there.

Control the Orb

The code for controlling the orb is written in Python and requires the Paho MQTT library.

code is available at https://gitlab.com/jezra/orb

oh... It would be really nice if I could copy the payload parsing documentation from the README.md in the code repository. Sadly, the lazy dev hasn't yet created that file. Well then, I know what I'm doing later!

Now quit reading, and go make an orb thingy.

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
8 minus 1
Answer:
required
2016-06-09

Recently, I was given a 1 gallon pot with some yellow water lilies in it. The lilies could be planted near the edge of my pond, but my pond is seasonal and the edge is always changing. There is no point in planting a flower on the edge of a pond when, in a few weeks, the edge will be 10 feet from where the flowers were planted.

Gears churned and a plan was hatched. I'll make a floating planter!

Step 1: Gather some supplies

There are quite a few empty 15 gallon pots at my place from all of the trees that I've been getting at Kurt's Garden. Add in some 45° 2" PVC couplers and some scrap PVC pipe, and I was ready to get crafty.

Cut some pipe

A few quick measurements, and a couple minutes with a hack saw and I had 8 short lengths of PVC to work with.

Make a ring

The couplers and pipe lengths where joined together with PVC glue and I soon had a nice ring that a 15 gallon pot will easily fit within.

Prepare the pot

After cutting the bottom off of the 15 gallon pot, 6 cuts were make down the side of the inverted pot to create some flaps. The flaps were folded over each other, drilled, and then bolted together.

At this point, I put the pot into the PVC ring, added soil to the pot and then tested the contraption in the pond. It sank like a brick.... back to the drawing board!

Make the pot wayyyyy shorter

Obviously the pot filled with dirt was too heavy, so the bolt as undone, the pot was shortened, and then folded and bolted again.

Atempt #2

Oh hey look, the new short pot is also sinking.

A few seconds after this picture was taken, I was knee deep in water, pulling the "floating planter" off the bottom of the pond. :/

Floaty platform

Fuck it. A 1 gallon pot in the middle of a circular platform shouldn't have any problem floating.... should it?

With some string and a thumb tack, a few circles were drawn on a piece of plywood and then cut. After the cutting, the wood was painted with exterior grade paint an then hung up to dry.

Make a couple mounting brackets

twist twist, twist twist, snip. A mounting bracket is made! Repeat the process, and there are 2 mounting brackets. Being lazy, only 2 mounting brackets were made to affix the PVC float to the platform.

It floats!

Once the platform and float were attached, the 1 gallon pot was put in the platform's center hole and filled with soil and some lilies (which were a bit eaten by some sheepies), and the planter was placed in the water.

It floats!

Did I mention that the floating planter actually floats? Well it does, and I am quite pleased with the result.

Now quit reading, and go make something float.

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
1 plus 4
Answer:
required
2016-05-04

A few months ago, a special someone told me they were going to be traveling to Petaluma and asked if there was anything I would like them to get for me. As it so happens, one of my favorite beers is brewed in that area: Oyster Stout by HenHouse. Unfortunately, it isn't possible to get Oyster Stout in a bottle. Fortunately, the beer is available in a growler . :)

Wow, what an absolutely amazing and delicious gift! It didn't take more than a weekend to empty the growler and imbibe the glorious nectar. Having a growler from HenHouse Brewery, while being quite awesome, is also somewhat depressing. The growler was empty and it would be a long time before I had the opportunity to fill it again. Obviously I needed to do something to the bottle...

"lamp fever" seems to have infected me lately, so... uh... why not make a lamp?

Okie Dokie!

Cut the bottom off

Sometimes, the urge to make a vessel designed to hold liquids no longer have the ability to hold liquids is just too much for me to handle. Time and a little patience go a long way towards cleanly removing the bottom of a 64oz growler.

Put the cap back on

Everything was flipped upside down, and the cap was filled with a thick layer of J-B Weld. After the J-B Weld had cured, a hole was drilled through the center of the cap. J-B Weld cures quite hard. To make the drilling easier, a ceramic/glass bit used.

Fill the inside

Just to be on the safe side, some high temperature white paint was used to coat the inside of the growler bottle. Without paint, too much light passes through the glass. By diffusing the light with the light paint, the logo doesn't get over powered and will still be quite visible when the lamp is turned on.

Electronics

Kits for a simple hanging lamp are about $18 at most hardware stores. The kits contains a socket with a pull switch, about 15 feet of cord, and some chain for hanging the lamp.

A bit of twisted copper and the original label that came on the growler were added to the pull switch.

Let there be light!

After hanging the lamp in the lamp testing spot by the dart board, the power switch was pulled. Hot damn, that logo looks nice!

All in all, this was quite a fun project, and a soon to be birthday present.

Now quite reading, and ...um... bring me some beer. :)

Comments
2016-08-06 Scone Bone:
What kind of bulb did you use? I feel that some lights might throw light better than others in this kind of setup
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
9 minus 4
Answer:
required
subscribe
 
2016
2015
2014
2013
2012
2011
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008