Introduction: Supervisor Eric Inspired LED Cube (People of Earth)

About: I am a Ham Radio operator, computer geek, robotic hobbyist. I've been "playing" with microcontrolers for the last several years, basic stamps, arduinos, and arduino like controllers, Raspberry PI, PICs & PICax…

Who or what is Supervisor Eric - and why would you build this.

Supervisor Eric is a BOX or Cube or something from the TBS show "People of Earth".

Which is a funny little show about people who are abducted by aliens - for the most part the aliens are pretty much idiots. I think early in season two, a flying cube named Eric took over the alien mission - He is known as Supervisor Eric. It's not real clear if he is a being inside of the cube, an A.I., or just what it is. Eric has his own agenda and even brainwashes member of the abduction support group, but that is another whole story.

I saw Eric and thought, that is kind of neat - and it would be really simple to make one - So I made one.

Unfortunately there is not a lot of information about him - so I have to go with this is a fan inspired "Supervisor Eric" - Mine doesn't and will never fly (I'm pretty sure that was just special effects in the show anyway.)

Also I don't really know how big it is - my guess is about 7" cube with about a 3" eye. My build turned out to be about 5" cube, with about a 2" eye.

I used a WeMos D1 Mini for the controller, with a WS2812 LED - this gives me the ability to change the color of the eye.

In the show I've seen three different color eyes so far - Blue which seems to be his normal color, red which appears when he is up to something or mad or angry, and green when he is preforming a scan of something.

For one of the sketches I made - I have his expressions, another sketch I am using MQTT and getting the cheerlights color from twitter. I also made a IFTTT applet that lets me use Google Home/Google Assistant to change his moods - using dweet.io - There will be more about this below.

Step 1: Tools and Parts Needed....

The hardware for this project is very simple - for the electronics some basic soldering skills will be needed.

1 Set 44mm Glass Lens Reflector Cup And Fixed Frame for 20W-100W LED Lens Hot $2.60

WS2812B RGB Shield for WeMos D1 Mini $1.75

WeMos D1 Mini ModeMCU 4M WiFi Development Board ESP8266 $3.40

We need a 5" (12.7cm) cube - The thickness is about 1/8". (about 3.175mm).

I tried a 7" cardboard box at first, but ended up laser cutting some MDF board. The dfx file is included in my github repository.

I also used some tissue paper to cover the WS2812 shield.

Shop around a little, these may or may not be the best prices, eBay, Aliexpress and even Amazon have some of the best prices.

Some other things you may need -

Flat black spray paint, wood glue, sand paper, and small file.

You'll also need some small wood screws.

Some tools needed - soldering iron, screw driver, file, needle nose pliers.

Access to a small drill press (or small drill), laser cutter, or cnc machine will make things much easier to complete this project.

For Power

My original idea was to use a small battery pack - it didn't fit, so I ended up making a small hole in the back and used a old cell phone charger for power.

A small battery pack (18650 perhaps) may work, the D1 mini is a 3 volt controller - so you need to watch which pins you use for power. There is a regulator on the USB connector, so that is by far the easiest way to power it.

Step 2: Early Steps to Building....

I believe the Lens is used for cars, maybe house hold lighting. I'm not sure - it comes with no LED in it however. So one of the first things I did was to make sure the WS2812 shield would even work with it - I used a rubber band to hold all the parts together - it worked - but wasn't great. I was able to run some test code and produce some different effects.

Later, I decided to add a mirror - I like it, but ultimately it still wasn't quite what I was looking for, and was hard to keep the mirror from sliding.

As you can also see at one point I was just going to use a card board box - I was really not happy with how this looked. it wasn't clean, but it did say that I really did need to have something laser cut.

Most of this was me just coming to realize that my original idea of needing something cut was right!

Step 3: Laser Cut the Cube and Paint!

Thanks to my friends at Rabbit Laser, USA - I was able to get the cube cut. The whole thing took less than 5 mins to do. I believe we were using a 60 watt laser at 60% power, and I believe we slowed it down for so it could cut the edges a bit better.

If you don't have friends with laser cutters, try looking at maker spaces, or even public libraries. Many have laser machines, The libraries around here only charge for material used. Some libraries are completely free to use if you bring your own material. They are great resources for makers on a budget. Getting laser time is another story however, and sometimes you have to be on a wait list.

For me not much was needed in the way of cleaning rough edges or anything like that. I probably could have/should have sanded the pieces a little - but didn't.

I did a rough fitting, to make sure the pieces would all fit. and layed them out a larger piece of cardboard.

I numbered the insides, so I could put the cube back together later - The reality is, 4 of the pieces are the same, and 2 are different (Top and Bottom) the 4 that are the same make up the sides - of these 4 one has a 2inche hole cut in it for the lens. I believe it was easier to put it together after I numbered the pieces - this isn't 100% needed.

I flipped the pieces over, and applied a coat of flat black paint to them.

I repeated painting the pieces three more times, each time I waited for the coat before to dry.

Step 4: Glue the Cube Together....

After a few hours of letting the paint dry - I glued the bottom, and three of the sides together.

I didn't use any clamps for this - and just held the pieces together by hand until the glue dried enough to hold them - it didn't take long, maybe 5 or 6 mins. It would have been better to use clamps I think - but I didn't have any big enough for this project. So it was nice to know that holding it worked.

I found it easier to just lay glue on the inside of the box at the seams, I used my finger to push the glue where it needed to be.

I set these parts aside to let the glue dry.....

Step 5: Putting the Lens and Electronics in the Hole....

While I was waiting for half of my cube to dry,

I drilled some small holes, in the four corner pieces of the lens bezel that didn't have holes. Why you might ask - The holes that are in the bezel are large, too large really. I needed to use very small screws so they wouldn't go all the way though the wood (Not poking out of the other side). So it was almost easier to just make my own holes. The bezel is pretty thin metal, and didn't take much to drill.

It was also at this point that I bent up a couple of the larger holes - I'll be using these to hold the electronics more or less in place.

I went ahead and put the lens bezel in place. And screwed it down with some very small screws - so far so go.

I found a couple of bread/wire ties and put them on one of the holes I bent up. I put the LENs in the bezel, and placed the back cover over the LENS. I placed a small piece of tissue paper (found in a box that had a new pair of shoes in it) on the back cover - and put the WS2812 board on top of that. Using the wire ties, to hold it in place. I then put the D1 mini on the WS2812.

After a while and much to my enjoyment, the WS2812 and tissue paper worked their way into the back cover - The WS2812 is really just a little small for the opening on the back cover, so it was no surprise.

What was a surprise was how well it made the "EYE" look with the tissue paper inside. I was really happy with that surprise.

I set this aside and waited for a my other pieces to dry - it didn't take long, may a half hour, maybe an hour.

Step 6: Glue in the Eye...

I didn't take any pictures of this part --(Bad me)

Anyways, after the glue was mostly dry I put the front (eye) in place (With the electronics already in it).

Since all the sides where on the box now, it was a little harder to get the glue into, but it wasn't bad. Again, I used my fingers to get the glue where I wanted it, and spread it over the joints.

This time I had to hold it in place quite a bit longer - I'm not real sure why, maybe have 10 or 15 mins the glue had set enough to put the box down and let it finish drying.

* You might be asking about the top!

So I left the top off (and unglued) so that if I need to change or add, or put different electronics in the box, I could do it easy. The top just lifts off, and everything is pretty there.

A new/better design might be for a hinged top or hinged side, but I am happy with the way the cube turned out.

Step 7: D1 Mini Programming

There are a few requirements before we can start to program the D1 Mini.

None of these steps are hard...but they do need to be done.

1st we need to install the ESP8266 Boards into the Arduino Board Manager. For this follow the instructions found here: http://esp8266.github.io/Arduino/versions/2.0.0/do...

If you have already installed the ESP8266 boards, you can skip this step.

Now we need to install the Adafruit_Neopixel library https://github.com/adafruit/Adafruit_NeoPixel

Probably the easiest way to do this is from the library manager in the Arduino 1.6.5 and later IDEs

Open the library manager,and in the search block type adafruit and neopixel.

Again, if you have aready do this you can skip it.

The above is common to the sketches I have made for this.

Depending on what or how you want to use your "Eric" will depend on what needs to be installed now.

(You probably should install both of these libraries just because, but....)

If you want to use the MQTT version (This version subscribes to a cheerlights MQTT stream) - It will change the color of the WS2812 LED according to the Cheerlight. * Cheerlights are a IoT project created by Hans Scharler that allows people lights all across the world to synchronize to one color by tweeting #cheerlights *

I've used Cheerlights in a number of my projects, Thanks to the MQTT stream the projects have become easier to make.

For this version you need the PubSubClient library. https://github.com/knolleary/pubsubclient

I am pretty sure this library is also in the library manager.

My other sketches use IFTTT and Dweet.io - They are a little different in I am asking Google Home to change Eric's Moods or Modes.

To use the dweet sketches you need the arduino-dweet.io library - https://github.com/quentinpigne/arduino-dweet.io This is an older library (2015), and almost certainly IS NOT in the library manager. So you have to install it manually. There are couple of ways to do this - I prefer, downloading the files, unzipping and renaming (removing the -master), dragging the folder into my libraries folder. You may have to restart the IDE this way.

I know that is a lot of steps, and there is a simpler way - From the IDE you can click the Sketch tab, go down to include library and click on Add .ZIP library - find your downloaded file, and that should be it.

I don't know why I never really liked to install libraries like that - but it is simple.

Now that you have the libraries needed, we can program our D1 mini.

Finally my code can be found here: https://github.com/kd8bxp/EricBotAICube

Step 8: The MQTT Sketches....

What is MQTT? MQTT stands for MQ Telemetry Transport. It is a publish/subscribe, extremely simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable networks. The design principles are to minimise network bandwidth and device resource requirements whilst also attempting to ensure reliability and some degree of assurance of delivery. These principles also turn out to make the protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of Things” world of connected devices, and for mobile applications where bandwidth and battery power are at a premium.

http://mqtt.org/faq

So in other words, my device subscribes or listens to something another device publishes.

One piece of code that is handy to use for MQTT is

uint32_t chipid=ESP.getChipId();
char clientid[25]; snprintf(clientid,25,"EricBotAI-%08X",chipid);

What this does is make a unique device name for the MQTT broker, it uses part of the ESP8266 MAC address to do this. A while this is 100% guarantee to be unique, so far it seems to have worked.

Otherwise the rest of the code is pretty straight forward, we listen for a color from the MQTT broker, we check to see if that is valid color - we set the neopixel to that color, and start the process over again.

For what we are doing a public broker is being used, and no type of security - this is fine for what we are doing, but may not be good for some projects.

There are three MQTT sketches included, and they all do pretty much the same thing - the biggest difference is how they display the colors from Cheerlights.

One displays the color with rapid blinking (see the video posted earlier) It's almost strobe like (ericbotai_neopixel_mqtt) - I used this very same type of rapid blinking for my Halloween projects in the past, and the effect is very good (For those) - it's not so good for this project however.

One just displays the color solid - and only changes (if it loses MQTT) or if the color has changed. (ericbotai_neopixel_mqtt_solid_color).

Probably my favorite of the three is the Breathe Effect - this takes the color and dims it to nothing, and slowly brings it up to full brightness, it is a neat effect that looks really nice inside the cube.

(ericbotai_neopixel_mqtt_breathe_effect)

All three are the same sketch with just a few changes for each "effect".

Step 9: Google Home, IFTTT and Dweet.io Sketches....

So first off, let's start by saying these sketches aren't as stable as I'd like them to be.

And even thou I've included the watch dog time functions and yield functions, I am still getting random WDT errors - it seems to be when they are sitting on one color for any time. I've really not had too much luck with either adding more WDT functions or removing the ones I do have.

That being said, the idea was to make Eric a little more interactive - Using My Google Home/Google Assistant I am able to say "Ok Google Eric Angry mode" and have the LED turn from whatever to red.

Dweet.io is how my message is carried to Eric - if you don't know what Dweet.io is be sure to click on the link and check it out. In simple terms it's a web api that devices can either publish to or listen to. Each call has it's own device name. It's also Free to use, which is a big bonus! Since it's a web call, it's easy to setup IFTTT to use it.

https://dweet.io/dweet/for/ericcube?mood={{TextFie...

Where {{TextField}} is going to be what Google Home heard.

So if take the above example "Ok Google Eric angry mode" - The web call would look like:

https://dweet.io/dweet/for/ericcube?mood=angry

The API output would look like this JSON string:

{"this":"succeeded","by":"dweeting","the":"dweet","with":{"thing":"ericcube","created":"2018-01-11T00:14:20.309Z","content":{"mood":"angry"},"transaction":"22b1264c-db06-4ebf-a806-8142665f3b9d"}}

The Arduino sketch - gets the whole JSON string - but thanks to a handy function called "remove" we are able to just remove most of the begging. And then remove the ending.....There probably is a better way to remove the end, because what ended up happing was I didn't read the man page close enough for "remove" and now everything is truncated at 6 characters. So if you say "normal" mode - it becomes "norma" - this is fine, it doesn't really matter - the software takes care of it....but it's still not right :-)

So I can say - "Eric angry mode" and this will turn the LED RED, "Eric happy mode" or "Eric normal mode" and the LED will be BLUE, "Eric scanner mode" and the LED will turn GREEN, and just for fun (And because in one episode, Eric did charge and his LED went out) "Eric charge mode" or "Eric black mode" and his LED will go out.

And finally just for fun we have "Eric party mode".

There are two sketches that use Dweet.io both sketches are pretty much the same. Just the LED effects are slightly different.

I'm not real happy with either LED effect however (except for maybe party mode).

ericbotai_neopixel_pulse_effect_dweet uses more or less the same code from the breathe effect sketch - with slightly different timings (both because of the changes to the sketch, and the WDT functions) - the effect is less breathe and more of a pulse effect.

ericbotai_neopixel_solid_color_dweet is pretty much as it say, it displays the colors (solid) - party mode is the disco effect.

You can add or change the effects, just remember the responses are only 6 characters long.

In both sketches - line 64 is where you can change the "thing" name, just remember to also change the web call to the same "thing" - if we all use the same name, we can all change each others "Eric"

Step 10: Final Thoughts and a Few More Pictures!

Here are a few more pictures from my build that just didn't seem to fit anywhere.....

One thing I'd like to say - I did end up cut a small notch out of the back of my cube, and run the charger/cord in that notch for power - over all it doesn't detract from the cube - but had I known I was going to do that I would have liked to have it laser cut out.

My bezel is also a little different - my bezel ended up being flush against the box - I don't think it looks bad like this - and it's a good way to say - I was inspired but not a direct copy of "Eric"

I plan on adding a MP3 player with some of "Eric's" words of wisdom....that may not happen very quickly thou - I haven't found any recordings of "Eric" so I'll have to make my own.

Finally, With the use of MQTT or Dweet the possibility of making this a desktop notification system, (Like a color for a tweet, or different colors for the weather in the morning, ect). It shouldn't be too hard to take some of the base code and mix it to make all kinds of cool things.

And Really Finally - I can see maybe making a HAL 9000 wall display using this same LENS and slightly different programming.

LED Contest 2017

Participated in the
LED Contest 2017

Epilog Challenge 9

Participated in the
Epilog Challenge 9

Arduino Contest 2017

Participated in the
Arduino Contest 2017