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.

Advertisements

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!

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.

A Dry Christmas (Light Show 8 Update)

In the first update for my next Arduino Light Show, I went through some of my experiments with my fountains. After some thought, I had planned on scaling it back but, in the end, I decided to scrap the fountains all together from the next light show. Despite the loss of the fountains, there are still new things to see!

img_20161019_181202

OK, so this is not really new. I made this weird Christmas tree last year. It was rather last minute so I didn’t do much with it. The plan now is to incorporate it into a new Light Show. Actually, it’s going to be the main feature.

I did a little bit of cleaning up. I cut the base into a circle and painted it black, trying hard to avoid painting over the LEDs.

img_20161021_194229

Here’s something new… well, again, sort of. I’ve done LED “spotlights” before by strapping 5mm LEDs to a servo motor. What’s new this time is that I’m using two servo motors per spotlight to make it pan and tilt. I’m also using WS2812B LED modules like on the tree. More movement and color should make the spotlights more interesting than before.

img_20161112_225030

After testing out the concept, I made an army of four.

img_20161119_204021

Some LED tests.

20161119_221619

I painted the spotlights all black as much as I could so that they’ll blend into the darkness.

So that’s the current state of the next Arduino Light Show. I had some other ideas in mind but I wanted to leave lots of time to get what I have here ready and programmed. We’ll see how the next little while goes. Thanks for reading!

The BIG opening update for the next Fountain Show

If everything works out in the very end, this will be one of my best projects to date. And really, with everything that has happened so far, it has been one of my best projects to date even if nothing actually works yet. I’ve experimented and learned a lot and, even with the bouts of wanting to quit, I really want this project to work because, again, it will be my best.

20160711_102151

I made a pool for the fountains out of scrap polypropylene sheets I got from work. I painted it all black because I thought it would benefit the lighting effects, as well as hide any imperfections better.

The white support beam running through the pool is where I would mount the fountain nozzles and LEDs.

20160711_113934

I’m trying my best to keep things organized and clean. I drilled holes for the pump wiring so that there wouldn’t be any excess wiring sitting in the water. I also used a silver marker to label them.

20160711_173741

Things started coming together as I had imagined. I used transparent tubing from the pumps to nozzles mounted on the support beam. The nozzles were made out of tubing that’s slightly more rigid. There’s also a smaller diameter tubing that I hot glued to the end to reduce the opening.

20160711_173830

Looks good so far…

20160711_173902

Heat shrink and electrical tape was good enough insulation with all of the water splashing every where. I decided to try another method of waterproofing certain connections which was to use short pieces of tubing and flooding it with hot glue on both ends. The connection in the picture is the splicing of the fountain wires to my own solid-core wire which is a likely point for failure.

20160711_194459

Once I was satisfied with the tubing, I threw on some more black paint.

20160714_145703

Next were the LEDs. They’re WS2812B modules (the little circle PCBs you find on eBay). I put them in little plastic cups to protect them from getting wet. They’re open on the bottomside but the LEDs are held inside of the cup with lots of hot glue anyway. I didn’t have any issues while testing them with water.

20160715_213212

And here’s where things started falling apart…

I barely ever used paint until recently, so I learned the hard way that it’s not very water proof, at least when applied on smooth plastic surfaces. As soon as the water started flying, the paint started peeling.

The other concern I saw was the aim of the fountains. The nozzles are round and are attached to a round support beam, so, while it looks good by eye, it didn’t turn out very straight. The pumps struggle if the fountain streams are exactly vertical so I tend to shoot them slightly backward so they sort of look vertical when viewing the fountains from the front. Anyways, I have some ideas on how to fix this which you’ll see in a future post.

The pump on the far left didn’t seem to respond so it either got through my quick dry tests before building or I fried it while setting up.

Also, no idea where the foam and bubbles are coming from…

20160715_215635

So clearly I’ve still got a lot of work ahead of me. Main things on the task list:

  • Scrape off all of the black paint on the inside of the pool. The outside black paint is fine.
  • Double check all of the pumps.
  • Replace support beam and nozzles.
  • Add a drain to the pool somehow.

Thanks for reading!

Happy holidays! (Christmas project 2015)

Last year’s Christmas holiday project was the “Make A Wish” fountain show. My original plans for this year was to follow it up with an updated set but I couldn’t find the time or motivation to do it. Instead, I decided to do something simpler.

20151222_190705_001Behold! A modern-style Christmas tree! It’s made out of foam-core board and has eight sides which are lit up by WS2812B addressable LEDs.20151222_190631With the room lights off, you can get a better sense of what I was going for. I am very happy with the way that it came together, considering how little time I gave myself. This was almost all done on a Sunday.20151221_193338It’s one of my larger projects, with the base being 50x66cm and the “tree” standing at 52cm. I’ll have to find somewhere to put it because I would love to work with it next year.20151222_190933_022One amusing observation which I hadn’t planned for was the fantastic pattern the project projects onto the ceiling.

Thanks for visiting my blog! I hope to find some time to write up a year-in-review-style post as I did last year. Stay tuned!