Vivid 2018 LED IoT Apparel !

Hello! 

Continuing with the tradition of creating something beautiful and covered in LED lights, this year we have something special!

Previously, we had the LED Jacket with Tearschu, and the LED Dress with Naifel. Taking inspiration from these, and solving a lot of the problems I faced with them, I bring the latest iteration of light up fun.

This year, I have taken a pair of high heel boots, and an umbrella from Daiso, added plenty of pretty lights, and of course, this year marks the first year the entire project is connected to the internet.

 

 

The project was built using mostly the same core components for each item. 

The shoes each have:

  • Lithium Ion Battery (1000mAh)
  • LiIon Charge / Boost circuit MP2636 
  • WeMos D1 Mini
  • A random switch for power
  • A strip of WS2812 LEDs

The umbrella is similar, except instead of the MP2636 boost circuit and 3.7v Lithium battery, I used a 3s LiPo battery, and a 5v step down regulator capable of high current.

 

The physical build was pretty straight forward, hook up everything how you please, battery to boost/charge, from there to the WeMos / LEDs, and then route the wires how you please. For LED placement on the shoes, I went with up along the front as I feel this will look the best having the light cover the most area, and for the umbrella I ran the lights down the spokes of the umbrella.

Unfortunately with my design you cant really CLOSE the umbrella anymore but as this is just for Vivid I am not too fussed 🙂 

To attach the LEDs to the umbrella I initially tried to use hot glue, but it was actually melting through the umbrella, and the parts that didn’t, did not hold very well, so I ended up using clear packing tape, as it does not seem to get in the way of anything and is barely noticeable! 

The LEDs here are hooked up in parallel with each other, so each spoke on the umbrella will be the same.

This slideshow requires JavaScript.

Once it is all made up physically, we can move on to the code.

I was looking into using the McLighting project for control of these, as it has both an internal web interface as well as support for things like MQTT, but I could not get it to work reliably, and it didn’t support running in AP mode, only client mode, which was a big turn off for me.

So what I ended up using was the JSON LED code from BRUH Automation, because I use this for other things at home and it works pretty reliably.

One thing to note here, for my LEDs I had to add the following two lines of code, BEFORE including the libraries, to prevent flickering of the strip. (not sure why this works?)

#define FASTLED_INTERRUPT_RETRY_COUNT 0
#define FASTLED_ALLOW_INTERRUPTS 0

 

(at the verryy top of the sketch)

 

Now my initial plan included taking a small portable router, and a Raspberry Pi 3 out with me to vivid, running a local MQTT server on a local network, with the Pi running Home Assistant (Hass.IO) all locally so I could connect to it to control things. However I ran into many problems attempting to do this, I am not sure if its because I don’t know how to properly setup static IP’s in resin, or just because it hates me, but I kept not being able to connect or it wouldn’t respond to my commands, it just wasn’t working great.

 

One day though, my good friend Mark came over and we needed a project to work on, so what we set up was a private mosquitto MQTT broker, that requires authentication, running in Docker on a Ubuntu Server 18.04 LTS install!

What this meant,  was I now had a secure way of connecting a remote node to my Home Assistant running back home.

 

I went right ahead and adjusted the code on the three items for the new server, forwarded the ports in my router, added the config to my production Home Assistant server, and hey presto, was I glad to see, everything JUST WORKED.

 

I made a view in Home Assistant and threw all the entities into it, and here’s how that looks:

So as you can see, we can control both shoes together, each individually, the umbrella on its own, or everything as a group!

We also can change the animation speed of the various effects.

I will be heading out to vivid to shoot a small video and some photos with this, with my good friend Tsugumi modelling it for me, on the 9th of June 2018 from about 6PM onward, Not sure if I will be at Circular Quay or Darling Harbor yet, keep your eye on my Instagram to find out! 😉 

 

Thanks for reading!!!

Image Recognition for Home Assistant

I was browsing the Home Assistant Community Forums earlier today, when I noticed a post by Robin Cole!

Rob has created a custom component for Home Assistant that allows us to use image classification via Tagbox, on a camera feed that Home Assistant has access to.

Following the instructions on github was pretty straight forward, the only thing I changed was to reference an external image_procesing.yaml rather than having it all in my configuration.yaml as I’m trying to be a bit cleaner.

 

In this case, my docker is running on Windows, the Tagbox instructions were fine for this, I didn’t realise you can just run the image and if its not installed, it will download it 🙂 

 

So now that it’s all setup it appears to be working great! 

As you can see, the component creates a new entity called image_processing.tagbox_name, with a state of the most likely item in the image, and then some attributes of the next most likely, and a count of any specific tags from the config.

I’ll play around with it to see what I can use it for more practically,  I can think of all sorts of things this component will be useful for! From identifying if a car spot is free or taken, to seeing if the bins were already taken out! 

 

I just wish I could specify a region within a camera feed for it to analyse. 

 

Why I play around with Home Automation

Hello, I’m posting this just before bed to clear something up. Apologies if things don’t make sense.

When people find out about my smart home setup, the most common thing I get from people next to “was it expensive” is “you’re really lazy”

Its not about the effort I save by not getting up to flick a light switch.

For me, this is my hobby. I take great joy in setting up different systems to work and play together nicely, for example, most of the sensors in my apartment are on a ZigBee network, while most of the lights are WiFi, even the different brands of bulbs, and then there’s a few Z-Wave devices in the mix.

I go to a lot of trouble and effort to set these things up, to maintain them, its very time and effort consuming.

I am learning HEAPS as I go along, about how things work, how different technologies work together, improving my understanding of code and syntax and even learning new languages.

Theres a huge level of satisfaction I get when something I’ve spend hours, even days working towards, finally works.

Such as the other day when I was at work, not even thinking about the weather outside, and I got a Facebook message telling me the temperature in my bedroom had exceeded 27°c.

This reminded me I could set the thermostat to 23°c befoee I left work, so that when I got home my room was nice and cool.

Or when I walk into the kitchen and the light turns itself on when I enter, turning itself back off when I leave again.

Even simple things like all the lights turn themselves off at 1am in case we have fallen asleep and left them on.

Its all these end results that I work hard to achieve.

The feeling of moving aroundy normal life, and having these things just happen when they need to, makes me feel more free, if I want to watch a movie, I select it on my phone, the tv turns on and starts playing the movie, the lights dim while its playinf, then when it’s finished, the tv turns off and the lights come back up, is amazing, it feels so natural, things happening when I need them, not just when I do them.

So next time you hear that I’ve set up my light to be voice controlled, instead of thinking “that’s so lazy” think more about how it can be helpful, like “wow of your hands are full you can still turn on the lights” or even “wow if you’re tired and don’t want to get out of bed, you can turn them off from there!”

This post isn’t targeted, I’m just attempting to convey my point of view.

If it was a matter of being lazy, I wouldn’t go to the copious amounts of effort that I do in order to setup this stuff.

WiFi speaker upgrade and Home Assistant TTS

A while ago I picked up a wi-fi enabled speaker from Target or Kmart for $50. It was advertised as on special for $80 down from $160, so I figured how bad could it be? Then when scanned in it came up as $50 so even better.

The speaker natively has Spotify connect and DLNA support, I don’t really have anything that streams to DLNA, so Spotify connect was what I had planned for it.
I did hope that I could get Home Assistant talking to it over DLNA but couldn’t find any DLNA components so wasn’t too confident on that.
The speaker itself feels well built, looks pretty decent, and sounds okay. It’s a bit bass heavy, and the PSU always sparks when you connect it (why is it 15v? Why not 12v???)
I used it for a day or two then it kind of got abandoned, as nice as a wifi speaker is, when it’s limited to just Spotify that’s less than amazing.
So fast forward a few weeks, I remembered that I have some Chromecast audio laying around doing nothing.
I had purchased them to test out the multiroom audio playback, something that has always interested me.

But after testing it out I didn’t really have a need for it.

I’m not walking around my apartment enough.

And the tv already has a regular Chromecast.
So the audios were just sitting on my modem in a triangle.
I grabbed one and hooked it up to the aux input on the wifi speaker to see how it sounds, and well, having the ability to stream content from almost any multimedia app, website or device is much more appealing than just Spotify.

Oh right I should mention that the speaker has a tendency to just, enter a sleeping state, where it disconnects from wifi, and doesn’t reconnect until you wake it up (I had to power cycle it ?)

This makes it REALLY annoying to use.
So I set out in a venture to install my Chromecast audio inside the wifi speaker,
What follows is a whole lot of work and overengineering that for the most part ended up being redundant.
I disassembled the wifi speaker and found that it does indeed have the rated speakers, and a fairly sized mainboard.

It had a wifi add on board too.

I left this in there so it will still function as its original purpose.

The plan was to disassemble the Chromecast audio, and solder wires between the aux port on the speaker and the Chromecast.

All the tests I did on this gave me faint audio on the right channel, and slightly louder audio on the right channel.

I couldn’t figure out why this was happening, as I traced all the connections and they were all correct ?

The only thing I can think of was maybe the wire is too high loss ?

Idk it was crappy hook Up wire.

Anyway I ended up just using the Chromecast short 3.5 cable. And melting a hole to plug it into the speaker.
For power I had to be a bit more creative, I wanted to run it off the existing power supply so it would be self contained.

A quick look at the main board of the speaker reveals a header with an i2c? Port on it. Including 3.3v VCC and GND!

I made a quick micro USB to wire lead and hooked up the Chromecast to the 3.3v line to see if that was enough to power it up.

Unfortunately it seems Chromecast needs more current than this port could give.

The Chromecast would power up then keep cycling between orange and white led, I think this is some sort of insufficient power indicator. Else it was just rebooting over and over haha.
Next I tried hooking up a 3.3v to 5v boost converter to see if it was just the low voltage causing the problem, but this has the same effect.

I concluded that this connector probably didn’t have enough current to power the Chromecast, which normally wants at least a good 5v 700-1000mAh of current.
I decided I would have to pull my power from the main +15v input, which obviously has to be stepped down.

So I grabbed a AMS1117 5V voltage regulator, which from memory the data sheet says can handle up to 12v (she’ll be right mate) and can output up to 1amp
Hooking this up between the 15v main input and and h Chromecast seemed to result in the same thing as before though …
It’s at this point I was wishing I had a nice big LM7805 or something.
I did however have an “adjustable voltage regulator module” from aliexpress, which was big and beefy. I wired this up to the 15v and then hooked up my multimeter to its output, it was showing 15v.

I turned it’s pot until it was a stable 5.02v which is close enough and then wired the micro USB to that.

Hooked up the Chromecast and it worked !!!

I shoved it all inside the speaker and reassembled it all.
With the speaker reassembled I gave it a test and all looked great!

Well worked great.
I remembered then, that Home Assistant had the ability to sent TTS to my TV Chromecast, I had disabled discovery of Chromecast because it kept showing up in the main view and nothing was using it,

I wondered if it could send TTS to the Chromecast audio??

So I re enabled discovery of Chromecast and restarted Home Assistant to see if it would pick it up. It did! And I had the option for TTS!

I did some setup stuff in Home Assistant that I didn’t document, but it was pretty straightforward!
Now I can send verbal notifications to the speaker’s by calling the tts service in home assistant, specifying the speaker media_player.wifi_speaker and giving it a message!

I also put another Chromecast Audio hooked up to a small Bluetooth speaker via a 3.5mm cable in the bathroom, so I can have notifications in there (this is also the only room with a sensor node at the moment!)

a notification in there could be: If the humidity reaches 100% and the window is detected as closed, verbally say ‘Please ensure window is opened to prevent mould build up’

or something like that.

 

Home Assistant is also able to message me via Facebook Messenger, which is handy for notifications away from home!
I might do another write up on Home Assistant another time though, once I fully understand it!

 

Thanks for reading 🙂

Some pictures follow:

ESP8266 Arduino Pro Micro 

I was looking everybody’s favorite online store for Atmega32u4 based MCUs for a friend and stumbled upon this little guy:

http://ebay.com.au/itm/191890522764

It sure as heck isn’t a 32u4 but it is rather interesting !

It looks like it’s an esp8266 module in the form factor of an arduino pro micro, I’m a bit put off by the $20~ price tag but it would be interesting to see if they have routed the pins to the corresponding ones as for the pro micro. 

Then you could use it as a drop in replacement without even having to change the code, except you would suddenly have the option to add wifi to your project! 
IoT is definitely getting much easier these days to implement than when this blog first started! Hahaha
No more fumbling around with an Arduino Uno with Ethernet and then little dodgy radios talking to other Unos with the same radio…..

Oh man that was hell 

EasyIoT DS18B20 Temperature Sensor – ESP8266

I needed a temperature node, but I didn’t have a DHT22 temp/humidity sensor!?

So I modified the example sketch for the DHT to use a DS18B20 Digital Temperature Sensor instead!

It works great!

The sensor is connected as shown here:

http://www.hobbytronics.co.uk/ds18b20-arduino

Heres the code:

 

/*

DS18B20 Digital Sensor Node Sketch for EasyIoT Server
Modified by Lewys Martin <[email protected]>
See: blog.lewys.eu for details

Original Code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

V1.0 – first version

Created by Igor Jarc <[email protected]>
See http://iot-playground.com for details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
#include <Esp8266EasyIoT.h>
#include <SoftwareSerial.h>
#include <DallasTemperature.h>
#include <OneWire.h>

#define CHILD_ID_TEMP 1
#define SENSOR_DIGITAL_PIN 2
Esp8266EasyIoT esp;

SoftwareSerial serialEsp(10, 11);

OneWire oneWire(SENSOR_DIGITAL_PIN);
DallasTemperature sensors(&oneWire);

float lastTemp;

Esp8266EasyIoTMsg msgTemp(CHILD_ID_TEMP, V_TEMP);
void setup()
{
serialEsp.begin(9600);
Serial.begin(115200);

Serial.println(“EasyIoTEsp init”);
esp.begin(NULL, 3, &serialEsp, &Serial);
//esp.begin(NULL, &serialEsp);
esp.present(CHILD_ID_TEMP, S_TEMP);

sensors.begin();
}

void loop()
{
while(!esp.process());

sensors.requestTemperatures();
float temperature = (sensors.getTempCByIndex(0));
if (isnan(temperature)) {
Serial.println(“Failed reading temperature from sensor”);
}
else if (temperature != lastTemp)
{
lastTemp = temperature;
esp.send(msgTemp.set(temperature, 1));
Serial.print(“T: “);
Serial.println(temperature);
}
}

And some pictures:
image

image

ESP ARDUINO PERFBOARD THING

I actually managed to produce something that is NEAT

and well laid out (in my opinion)

Parts:

• Arduino Nano
• ESP-01
• 5-3v Level Shifter
•  Perfboard
• Bunch of headers
• Some wire
• Soldering Iron + 0.3mm Solder
• Dremel to clean things and cut things and stuff

 

As you can see in the photos:

The board as a whole:

Whole Board

The board with components removed:

Components Gone

The underside of the board:

Underside

Cleaned edges with Dremel:

(i got a Dremel for christmas btw)
(i got a Dremel for christmas btw)

The things I have to add still:

Also, as you can see, theres a notch missing from the Arduino near the ICSP pins, I used my Dremel to grind that away (theres no traces there as far as i can tell) so that the ESP module fits so perfectly there and the whole package fits inside the dimensions of the perf board 😀

Arduino pin 2 for DHT22, 13 for relay.
Arduino pin 2 for DHT22, 13 for relay.

This node has been added to my EasyIoT Server as a secondary relay node for the time being, but I want to get my hands on a DHT22 to add a temp/humidity sensor to my bedroom 😀

Then I can start expanding to other rooms in the house! MWAHAHAA

MY BEDROOM LIGHT IS NOW CONNECTED TO WIFI

Using a full size Arduino Uno modified to 3.3v, and that weird shield I built, modified to software serial pins 10 and 11, and also to add a power input of 5v that gets regulated to 3.3v on both the shield for the ESP8266, and the arduino for… itself?

It connects to a Raspberry Pi running the latest version of Raspbian and EasyIoT Server, I figured out their API without even a mention of there BEING ONE ON THEIR WEBSITE (they don’t mention it anywhere but i noticed a mention of it in the console log and figured it out)

The ESP8266 01 type connects to the main WiFi, then to the server, from then I can browse to the IP of the server and theres a beautiful interface 😀

The EasyIoT server also supports the RasPi GPIO and the MySensors stuff, so Im gonna use that for things like doors, and temp/humidity sensors

Photos will come soonish:

image

image

image

image

image

Low power Arduino Pro Mini

I butchered up one of the almost-broken Pro Minis I have, its a 16Mhz version so not sure if its going to just run at a lower frequency or be unstable, but all I will need it to do is sleep and wake up every now and then to send a reading from a sensor!

Im going to get some of those NRF24 something radios as they seem to have far better range and support than the things I HAVE been using hahaa,

Basically, I removed BOTH LEDs (forgot there was a PIN13 LED on there D:  could have left that

and the regulator was also removed.

Powered it via 3.3v from my USB TTL adapter and uploaded a blink sketch, probed an LED onto 13 and GDN (yes GDN hueeee)
and it blinks 😀

so I can use this one soon.

DIY Project: Home Automation

Update: This project died when I got a job and can afford off the shelf automation stuff :’)

It might come back when I start adding stuff like blinds and air conditioning control!

 

This project is basically me wanting to be able to automate my house but not wanting to fork over heaps of money for pre made systems.

I’m a bit lazy with details so if there’s any questions you have please comment below!

Newer Update v2.5

Ok, so it just occured to me that I could have bent the antenna down flat so that I wouldn’t have had to make any holes….

 

image
As you can see its all in a box now because reasons plus annoying bright light

I got around to making a few changes, I’ll let the images do the talking for me:

image
Used spare LEDs to attach the fan, deal with it. Box had a USB 125khz RFID reader in it heh
image
Melted the hole for the antenna with soldering iron, then cleaned tip and sliced off excess plastic with stanley knife
image
single channel relay board now in use to save space
image
my god i did a crappy solder job on this one D:
image
dem pro cut outs
image
don’t tell me how crappy the fan cut out is. i know.
image
cables kept getting caught in the fan so i fixed them.
image
close-up of ParaShield with the fan header, and RF module shown.
image
the area that I cut out of the proto shield to fit it over the ethernet jack
image
used a resistor leg for GND to the RF module, now i can tap into GND from that line as well B)
image
blob of blue tack was used to hold things in place while i soldered
image
finally, a nice and snug fit, that looks not like shit! xD

 

A few notable things, white LED on ParaShield (I’m calling it that now) has been replaced with a less bright red one. Transmitter repositioned and wired a little nicer, Ethernet hole cut (Stanley knife, metal cutters and pliers).
Proper helical antenna added to both units, Rx unit now has single channel relay.
Also, I shoved it all in a box and added a 12v fan running off 5v from the ParaShield (may add fan controls/monitoring later) so nothing goes wrong with summertime here.
I’m just waiting for the other 433mhz things to add a manual light switch, and the infrared control unit. Codes all ready but need the RF receiver D:

.

Also, on the app side of things,
I added an all on/off section so when this projects complete, I’ll be able to stand out the front of my house, say something awesome, hit a button, and the whole house lights up or goes dark 😀 XD

image

image

New update V2
So I discovered this thing:
http://www.ebay.com.au/itm/291262467339

I remember reading about this a while ago but didn’t care for arduino or anything much then.
But now I’m looking at this and seeing
This+Relay+PSU = self contained without need for base controller!
Plus, did I mention ITS FOUR FREAKING DOLLARS
how could I NOT order two!

When they arrive I’ll have a play around see if I can figure out how to control them 🙂
Will post here when I do!
In other news: I ordered proper 433mhz antennas for the things, and found the PS move squigy ball.
Will get a box soon for it all haha,
I’m also preparing some LED strip on the front veranda to be controlled by my UI. And I’m developing an android app (will design a tablet version later)
Using Tasker app factory!
Early screenshot attached!

image
Other photos:

image
the two channel relay is sooo bigg D:

Newer update:
I found chunks of a broken PlayStation move controller, for now I’ve soldered some resistor legs to the rgb led breakout board, and have the rgb led on the base station for reasons,

Hopefully further down the track I’ll be able to turn on a mood light fading through, (although once it starts fading how do I stop it…?)

Or even notifications for things!

It also acts as a status light,
On sending an on command it flashes green twice, the off command has two red flashes.
An unused but implemented command gives three orange flashes.

I need to figure out how to flash an error if an unrecognized command is received…

Also I hope to find the sphere from the PS move. And to mount the led on the proto shield, maybe move the rf transmitter to make a cut out for the Ethernet jack,
And then try my luck at designing a special case for it all.
Either adapting an etherten case, or making a shitty one from scratch.
YouTube video showing on/off light
Signal light: http://youtu.be/ejXlYe17N8U

————————————————————-

New update: I got it working again 🙂
Not sure what was wrong but I rewrote the code and now it works hahaha

image

 

image

Its a bit slow probably because of the speed I have the radios set to, but oh well doesn’t matter.
I soldered everything together into a little clump, minimising wires, and made a shield for the transmitter so it sits neatly atop the etherten.

image

I’ll be able to add other things to the proto shield later 🙂

Also. Found a leostick under my bed but I’m having issues uploading code to it. Going to use it to make that light switch if I get it working 😀

LOOK AT ME I BROKE IT SOMEHOW
Went for a trip to jaycar and bought some supplies, and a smaller soldering iron
When I got home I took down the roof unit, attached shorter cables so it would fit in the little box, and put it back together,
But just my luck, it’s not working now!

I send commands but it doesn’t trigger the relay….

I’ll have to connect it and look at serial monitor to see if it’s getting the command

I’ll also add some code and an LED that blinks when it gets a command….
Oh, and maybe the code to light that emergency light if a pin goes low?

I should probably remove all the pin headers and solder right to the board actually…

Or to a proto shield….

The current state of the project consists of an arduino pro mini clone, that listens on the 433mhz band for a command, and turns on a relay depending on the command.

There is a Freetronics Etherten acting as base station, connected to my LAN, and a 433mhz transmitter, this responds to http requests by sending various commands to the ceiling unit.

Its easy to add additional remote units and set up controls for them, which I plan on doing  when I get blinds for my windows.

image

image

I also have a raspberry pi running Rasbian that listens for a button press, which is wired to our 20 year old retro doorbell, when the button is pushed the Pi sends a pushover notification to my phone/pebble, as well as plays a doorbell sound throughout the house  directly connected speakers.

I’m also going to be setting up Asterix or something on this to add Cisco VoIP phones around the house.

I have plans for an analog control panel too, that has physical buttons connected to an arduino, to send commands to the various other arduino around the house.

For example, a light control panel, push one button to send off commands to all lights in the house, or indivuaul etc.

I also will be adding a sensor to the mailbox, probably solar powered, that sends a command in to the house when mail goes in, either emailing me, maybe a photo?
Sending my pebble/phone a notification, or just lighting up an LED on the control panel to indicate new mail!

image