The 15×6 LED Matrix

Last wasn’t a very good year for projects (and this year honestly doesn’t look much different¬†ūüėź). Over the course of the year, I was trying to work up to a grand Christmas fountain show with an LED matrix backdrop. I got the backdrop worked out but nothing else… and even with the matrix actually working, I had no motivation to do anything with it.

It’s just been sitting around, collecting dust, and being a massive waste of space so, before I start pulling it apart, I figured I’d make a quick post to show it off.

For the power supply, I used one of those power supply boxes from China where you feed it 120v ac and it spits out 5v. I wanted the project to have its own voltmeter display (inspired by something I saw at Toronto’s Maker Festival last year) so I got that in place. I also wanted a large e-stop button but, in the end, I ended up with a simple switch.

Here is the completed 5v power supply. This one is rated at 2A but you can get ones that can put out many more times that current. These short terminal blocks make it easy to connect and disconnect things.

The matrix is setup on some foam core. One of the three panels was already a year old and was used in my 2016 Christmas light show. I made two identical ones and wired them together. The support pieces are made of scrap PVC pipe I managed to get. Everything else is tape and hot glue.

Here it is from the back, powered up. The glow from the front is also nice, but I realize if I were to do something like this again, I’d want a material that’s a little more transparent to get more light in front.

With the effort put into it, I’m actually quite proud of how it turned out. I just don’t like the amount of space it’s currently taking up while not having any motivation to anything with it so I’ll be pulling it apart. I’ll keep the panels seperated, and maybe use my sketchy 5v power supply in another project.

Advertisements

TTC Light Map Build!

On December 17, 2017, the Toronto Transit Commission opened its new subway extension. With free rides on opening day, I had no excuse not to go check it out!

Along the way, they were handing out little goodies. One of the hot items many people were grabbing up were opening day subway map posters. For the longest time, I wanted to buy one of the subway maps they sell and fit it with LEDs but I never got around to it. Since a map was literally put into my hands, the motivation instantly came to get this project done.

Materials

1 x Subway map

2 x Sheets of black foam core board

75 x WS2812b LEDs

1 x Atmega328p Breakout Board (An old custom PCB of mine!)

1 x USBTinyISP MicroUSB module

1 x Toggle switch

1 x 5v 2A Power Supply Adapter

The Build

The process was straight-forward: Cut out the station holes, hot glue all of the WS2812B modules down, and then solder them all together. I did find that the module ends up getting hot enough to remelt the hot glue while soldering but it was still manageable even with small gooey messes along the way.

I initially put down Line 1, just to see how it would look before I did the rest of the system:

Despite the really unclean holes, it looked good enough to continue.

Lots of soldering and hot glue was involved…

I did run into issues on the first power on after soldering all of the LEDs. Reflowing some of the joints and replacing some of the wire fixed it.

The system uses an Atmega328p with a USBTinyISP microUSB module I picked up on eBay some time ago. It’s my first project using one of these. I’m definitely getting back on eBay to order more because they’re a dream to work with and it combines with my Atmega PCB perfectly.

I’m very happy with the way this project turned out. It feels great to kick off the new year this way!

Videos

I tweeted a video of it in action.¬†It’s also up on YouTube.

I’m planning on getting some hooks to hang it on my wall. I’m not sure what it will display once it’s up but for now it’s just playing the Demo Reel example sketch from the FastLED library.

Tutorial: ESP8266 + PHP and MySQL Database

I see it in the view counts, comments, and emails asking for information about my ESP8266 and MySQL project I made two years ago. People are having trouble with their ESP8266 and MySQL Database projects. The reasons why I haven’t posted about it since then is because I haven’t been doing much with the ESP8266, and the project is so old that the way it’s programmed¬†is dated. Development for the ESP8266 has evolved so much and has made it easier. You no longer have to deal with AT commands with Arduino libraries out there that handle it for you.

I’m going to do a quick tutorial to explain how I’ve been doing my ESP8266 with MySQL project. It’s not going to have much code but more explaining so you get what’s happening.

Some links for you

The ESP8266 blog post that everyone is showing up to see: https://mwhprojects.wordpress.com/2015/01/18/esp8266-with-a-mysql-database/

The Github repo for this, though sort of irrelevant at this point because it’s outdated:¬†https://github.com/mwhprojects/Arduino-ESP8266

The recent NodeMCU project that showed me what’s new with the ESP8266:¬†https://mwhprojects.wordpress.com/category/projects-2/nodemcu/garage-monitor/

The Github repo for that: https://github.com/mwhprojects/NodeMCU-MySQL

GETing values and INSERTing them

Here’s what happens in the code uploaded onto the ESP8266/NodeMCU (see Github):

  1. The ESP8266 connects to the webhost.
  2. The switch values are read.
  3. These switch values are then inserted into a URL which the ESP8266 tries to load.
  4. Repeat.

I think that step three is what people are most interested in, so let me explain that a little further. PHP has the GET method, which basically reads variables that are in the URL itself. For instance, if we have a URL like: example.com/page.php?val1=1&val2=2, we could use PHP to get the values of val1 and val2. In PHP, we’d use $_GET[‘val1’]; to use in our logic, and again for val2.

Once we have the values, we can then use PHP to connect up to a MySQL database and insert them (and whatever else you’d like) into the database table.

In the PHP code (see Github), the file begins with code that checks for variables in the URL as explained above. If there is, it uses the GET method to get the variables and then inserts them into the MySQL database table.

Just a heads up, the deep sleep in the NodeMCU hasn’t been working for me, as I explained with my NodeMCU project posts. Keep that in mind if you plan on adopting the code. Heck, let me know what happens with your project as it could just be something with my hardware.

So now what?

Like good old XDA… YOU TELL ME.

I’m not an expert with the ESP8266 but I’d like to help if I can. Please let me know if there’s any clarifications I should make to this post or any more specifics on what problems you’re having with a similar project.

Thanks a lot for reading and good luck with your projects!

DIY Digital Clock: Take 2!

What time is it?

Time to make a new clock!

About a year ago, I designed and assembled my own custom made clock. You couldn’t say it was in an enclosure since its guts were spilled out on both sides of a piece of foam core. I felt like, a year later, it was time to redo it and put it into a proper enclosure.

So, what time is it? Time to build us a new clock!

The Guts

1

I tend to get carried away and too focused to take proper progress pictures. This is literally the first picture I have from the electronics part.

Soldering all of those LEDs and components took a full day. I used hot glue to try to keep multiple wires in place to solder as fast as I could but it didn’t do the best job to hold them in. At time, the glue would fall away from the PCB. Still, it’s better than fiddling with one wire at a time.

The only difference from the prototype build is a lower resistor value for the LED resistors.

Putting Together a Box

2

Foam core is a favorite in my “lab”. It’s all I use these days because all it takes is a knife to cut and it’s inexpensive and accessible (Dollarama rocks). I built a simple black box with a white cover place. I was hoping with a lower resistor value on the LEDs, they’d be able to shine through the white foam core.

3

With the soldered parts and the enclosure ready, it was time to put it all together.

4

I glued a piece of foam core behind the control board to isolate the connections on the back with the display connections. I ended up mounting the two display panels on it’s own piece of foam core anyway so I guess that wasn’t really necessary. The display foam core backing fits tight with no need for pin or glues to hold it in place.

5

The white foam core was still too think for the LEDs so I ended up going back to a plain white sheet of paper. It’s not noticeably brighter than the original prototype with the paper. ¬†The piece of paper is held up by two strips of foam core on either side.

I didn’t like the look of it at this point but it was the end of the weekend so I left it for now.

6

I still like how sleek the black foam core looks, even with a few imperfections here and there from a not-so-sharp knife.

7

After a few days to think about it, I realized simply turning around my diffusing screen pulled the look together.

8

Time to pull the plug on the prototype and enjoy something new.

Thanks for reading!

Putting the Garage Door Monitor on hiatus

img_20170211_080857Let’s take a break

The deep sleep issues haven’t been solved, yet. It seemed like it got better when I put a resistor between D0 and Reset but it still stopped working after a while.¬†After catching a few YouTube videos about the ESP8266 deep sleep, I’ve come to conclusion that I’ll have to rearrange my code big time. I’d rather regroup at this point and try something else.

Since the weather will be getting warmer, maybe I’ll leave the garage door monitor project until the summer. The motivation of the project was from the door problems that stem from the cold weather. I have an enclosed temperature sensor on the way from China so maybe I’ll try my hand at a weather station again.

So I’ll leave it there for now…

Garage Door Monitor likes its sleep

Garage Door Monitor Update #2

The NodeMCU project is still chugging along. I’ve gotten more experiments done which I’ll share with you shortly. Unfortunately, all of this information has left me more indecisive of how I want things. To recap, I want to make something to be able to tell me whether or not my garage door is open or closed without going outside to check. Click here to see¬†the first post about the project.

garage1Problem: Is it dead or does it just like to sleep?

The problem with the NodeMCU working for a while and then giving up on life is still the big one. I’ve done a few overnight tests with a few tweaks (mostly giving it delays/time to do things) with them all resulting in entries stopping after about six hours.

When I use my bench power supply, I’m able to see how much current it’s drawing. When it’s on, it’s pulling about 69mA and peaks to about 71mA when it’s transmitting data. It doesn’t seem like much, but it registers as pulling no current on my power supply when it’s in its deep sleep. Seeing that, it’s hard not to want that sort of power saving on the final build.

More likely than not, I won’t let it go to sleep and have it on all the time. I haven’t actually tested this yet to see if it will stop working again. Stay tuned!

Experiment 1: They still can’t hear each other

I tried to get two NodeMCUs to talk to one another again but it’s still not working out. Basically, I had one that would set up as an access point with a webpage that I’d try to get the other NodeMCU to connect to and read. I could get it to connect once but then it failed at reading any data. After that, I couldn’t get it to connect to the AP NodeMCU anymore. I have no idea what changed in that time.

The alternative solution is to continue sending my data to my webhost, and then having the NodeMCU connect to a webpage I have online which will feed it the information it needs. The webpage it would connect to would give it raw unlabeled data that it knows how to decipher.

Experiment 2: Keeping it local

After banging my head for a few hours, I strayed away into another alternative, which would eliminate the second NodeMCU where I use my phone to see what the NodeMCU in the garage is up to.

It went very well since it was easy to modify the WifiAP example sketch (at least that’s what I think it’s based off of, I’ve been accidentally saving over the example sketches). I was able to see the values on my phone by visiting an IP address once I connected to the NodeMCU. However, the fact that I have to switch my wifi is a bit annoying which makes this an undesirable option. It’s still good to know I can do this though as I¬†could use it in some other project.

So now what?

With everything in mind, I’ve got some updated objectives:

  1. Garage NodeMCU has a limit switch which will tell whether the door is open or not. It will connect to my webhost and send data. This NodeMCU is no longer allowed to go to sleep!
  2. Webhost will present the data to me on a page much like the screenshots I’ve been sharing. It will also have a seperate webpage with raw recent values.
  3. Inside NodeMCU will connect to my wifi network and then to that webpage with the raw recent values. It will take those values and decide what to do. (Light up an LED, make a sound after a few minutes, etc.)

New NodeMCU Project: Garage Door Monitor

The Objective

For whatever reason, our garage door opener doesn’t work reliably when it’s cold. Only the remotes that are inside in the warmth actually work so we have to remember to close the garage from inside the house. Sometimes it’s forgotten and the garage door is left open. There’s no way to see whether or not the door is open from inside the house. Thus, this project came to mind.

The main objective is to create a wireless way to know whether or not the garage door is open.

The Planimg_20170126_190721

The plan is to use two NodeMCU boards. One inside the garage will talk to the other inside the house. The one in the garage will be connected to a limit switch which will be closed when the door is closed. The one inside the home will have some sort of indicator that will tell us whether the door is closed or not. This will likely just be a labelled LED.

These Two Don’t Like Each Other

I received the two NodeMCU boards in two weeks from China. The experiments trying to get them to talk to each other (one as an access point, the other as a client) did not work out.¬†I¬†went hours trying to get something going but I couldn’t, so I went back to something I knew already, which is to have it talk to some PHP code hosted on my website.

The NEW Plan

I wasn’t planning on having the internet involved but I actually think it’s going to be a better idea. This way, I can get something going with just one board and then integrate the second one into the project later. I can check the status of my garage door right from my phone’s web browser from anywhere. The future is here people!

 

The new plan has a couple phases.

Phase 1: Set up one NodeMCU in the garage with the limit switch. The switch will send the status to my website which I can then check to see the status of the door. I can use some PHP code to send me an email if the door has been open unusually long.

Phase 2: Have the second NodeMCU connect to my website and build hardware around it so that anyone that walks in the front door can see whether or not the door is closed.

Progress Update

img_20170129_151905

It’s been going pretty well so far, even with it’s problems. I’ve got two limit switches sending values to a MySQL database hosted on my website. (The full process: It accesses a URL with the switch values inserted into them, and then some PHP code on that page grabs them and inserts them into the MySQL database table.)

BTW, I am using the Arduino IDE to program the NodeMCU.

screenshot_20170130-091040-01

I have no issues with it inserting values. The big issue I’ve been having is I haven’t gotten it running for longer than two hours at a time. I don’t know if it’s something on the server’s end or if the NodeMCU is hanging or something. It took me a while to get it to wake from deep sleep without doing something weird so I suspect it may have something to do with that. If this issue keeps going on, I may stop it from deep sleep and see how that goes. It’ll draw more energy but I’m leaning toward giving it a wall plug.

Keep Following the Project

I hope you enjoyed this first update post about my first NodeMCU project! Stay tuned for more!

screenshot_20170131-174839

If you’ve got Instagram, follow me as I’ve found it to be an easy way to share progress updates as they happen.