Light Automation Revision

The old Light Timer/Automation project has been running well for the past few months. It was some time after, I played around with Attiny85 microcontrollers which have less pins. Since the project only uses two (now three) pins, I decided to do another revision of the project, swapping out the Atmega328 with an Attiny85.IMG_1243 (Custom)It started out with some prototying on a breadboard with the Uno. The potentiometer is a dimmer for the lights. One of the issues I had was that the lights were a bit too bright so I wanted an option to make them dimmer. The potentiometer allows me to do that without having to reprogram the chip, although in hindsight, I probably should have put one for the sensor sensitivity. I have to go through a few nights to see how it reacts as I wrote up new code but used the existing photoresistor.
IMG_1244 (Custom)This was the perfboard layout, though there were some mistakes and things missing that I fixed along the way.IMG_1245 (Custom)This is the old board. It feels good to strip it down even further…IMG_1247 (Custom)This is the new board. It’s a lot smaller and with a new enclosure (food container). The old one still had unwired buttons from the original light automation system with the LCD menu.IMG_1246 (Custom)When I swapped out the board for the new one, it wasn’t working properly. Sometimes it would function fine, but I’d come back to it to see it dead. After some poking around with my multimeter, I realized it was the power supply connector. It connects to the board using a 9v battery connector. This particular power supply has a bunch of other jacks which I tested and were still working fine. I decided to just chop off of the connectors which I didn’t like floating around anyway, and have this power supply dedicated to this project. I quickly soldered the supply wires to the board and it works just fine now.

Hopefully it’ll look good tonight. Thanks for reading!

Light Timer Modification… Complete!

That went a lot smoother than I was expecting. This was more or less an overnight project. I started last night and completely finished and installed  today around 2pm. Here’s some pictures and details of the process.1The first thing I wanted to do was to get the photoresistor/light sensor working. It works fine, but I’ll have to monitor it for the next few days to make sure the sensitivity is appropriate.2The next step was to test out the Atmega circuit. It went well on the breadboard. The green LED is a power indicator and the push button is to reset the chip.3The sensor works in my completely darkened room. I’ll have to see how it reacts in the hallway.
4The final step was transferring everything onto a soldered prototyping board. I had this larger one lying around for a while. The more room to work with, the better.5I soldered the socket and power connections first.7The process continued until it was complete. I much prefer using these prototyping boards that already have rails/traces.6It was great to see it work as it did on the breadboard on the first power up. The adapter was giving the Arduino Uno board 9v. It’s a variable adapter so I dropped it down to 5v (hovers between 5.1v to 5.6v). I was thinking about adding a 5v regulator but I believe it will work fine since the adapter should be doing that already. I have more 9v battery connectors than I do AA/AAA cell holders so I’ll eventually have to start using the regulators in my projects.

So that’s it for the light timer modification! I plan on taking the real time clock circuit off of the breadboard and solder it onto a small prototyping board. It’ll likely be in use in the animatronic head project. I’m set to order more of the chips for the name tag project. Check out my previous post on a full list of my current projects. Thanks for reading!

Featured Projects Page update + Light Timer debugging

I’ve updated the Featured Projects page with my most recent projects, with a couple more to be added. Eventually, all projects will have their own page like the Temperature and Humidity Monitor. The Featured Projects page also includes the current status of each project. Unless my projects are completely scrapped, they’re usually ongoing in some degree.

Anyways, you’ll notice for the Light Timer, I’ve listed it as in need of repair. I previously posted that it’s been working daily for us and I recently stripped it for parts. Since it lost the LCD, it didn’t need a menu anymore so I took all of that code out of the program. Since then, it’s been running fine except that it stays on after the PM off time. It also has issues with the real-time clock (RTC).

Today, I retaped the RTC circuit because I think something on the breadboard was coming loose, causing the errors. I also simplified the logic for the lights. It was a little more complicated because it had to figure out what the next action was to display on the LCD (the next time the lights were to turn on or off). At this point in the afternoon, the lights should be off anyway so I’ll have to wait until tonight to see if my modifications fixed the problem. I’ll be happy to change that status if all goes well.

Light Timer project: Dumbed down

1It’s been almost three weeks with the light timer project sitting out in the hallway doing its thing. Since putting it there, I haven’t touched the menu once. As you saw in my last post, I’m trying to organize myself and figure out what projects I want to work on. I just started some real work on the new light show and I needed a breadboard. With that, I decided to strip down the Light Timer project to the bare minimum.

The LCD was taken out of the project so the menu features were no longer needed. It took me about 10 minutes to strip out the menu code from the program. To communicate any errors from the real time clock, the lights will blink forever. This came in handy immediately as, for some reason, the clock keeps losing the time when the Arduino is unpowered for more than a few minutes. It should be able to retain the time with the coin battery in there but it seems to only last maybe a minute or so now. Once the Arduino is powered with the plug, the clock is fine. The blinking is quite jarring, actually, and I’m now thinking I probably should have used pin 13, the on-board LED. Oh well.

So an update on the new light show will come soon. I’ve got a plan that’s working itself out right now. It’s familiar to the first light show project, but perhaps a little cleaner this time around (though time will tell to be certain on that).

Light Timer Project: The Last Connection

1I got a new soldering iron for Christmas which gave me the motivation to do some more work on this project. I’ve always shied away from soldering in my projects because I’ve only owned a crappy $15 irons until now. I didn’t like having that breadboard hanging off of the control unit so I went back at it with my new soldering iron and came out with something a lot closer to what I had in mind in the first place.3The LCD still doesn’t have a cut out but that’s fine. Like I’ve said before, another reason why I didn’t want to put the buttons directly on it was because it was a tight squeeze with all of the wiring and components jammed in there. My concern right now is a bit paranoid, but I’m afraid of a short or something breaking just because of how tightly packed it all is. So far, it seems fine. It won’t be kicked around or vibrating so things should stay in place. I’ll continue to have it running while I’m around just to keep an eye on it. I want to be confident in it before I leave it plugged in overnight.


This is the final final product. I hope.

Light Timer Project: Completion

The Light Timer Project is now complete and ready to install. Except it won’t be, at least not right now. I will probably keep it packed up until next year when we can incorporate it into some Christmas decorations.

1This is not the way I pictured the final product but I’m still satisfied with it. It’s a tight fit inside of the case which is why it didn’t turn out as compact as I wanted it to.

2The LCD does not have a cut out, it’s just being seen through the transparent cover. The buttons remain on the breadboard because it’s a mess inside the case so any wires that can escape are lucky.

3Since I probably won’t be using it this year, I wrapped the string lights around the case expecting to throw it on a shelf and let it collect some dust. I realized that it made a really neat glowing effect off of the case. It makes for a really nice desk lamp at times when I don’t need my room completely lit up.
4So that’s the end of another project. If you want to see the construction log, just click the “Light Timer” category on the sidebar. Here are a few more things to wrap this one up.

Product Features

  • Displays current date and time.
  • Automatically turns on and off a set of lights during a certain period of time in the morning and evening.
  • Allows for user to adjust the time ranges in the morning and evening.
  • Allows for user to turn off schedule on the weekend.
  • Allows for user to manually turn on and off lights.
  • Displays a custom message on specific dates.
  • Fades in and out LCD backlight and controlled lights.
  • Times out menu after 10 seconds of inactivity.
  • Dims LCD backlight after 15 seconds of inactivity for power saving.


The code is up for download as-is. It may become unavailable at any time.  It is not meant to be copy and pasted into your project. Instead, it’s there to help you get an idea of what I did to accomplish certain tasks. Some ways I go about things may not be optimal but it worked for me. If you use any of the code and would like to give credit, please link back to this blog post. If you have any reasonable questions, leave a comment. Thanks.


Light Timer Project: Squashing bugs

A lot of bugs were coming out to play over the weekend and I hope that the copy of code I have now is free of any major ones. In addition, I managed to add in a couple of more features, though it’s starting to become that really unnecessary “fluff” but whatever.

To make things a little less jarring and to make use of the PWM pins, the lights and the LCD backlight now fade on and off when they need to. It’s a little thing that helps the project look a little more polished.

The other addition is that I can now post messages that will alternate with the usual info displayed on the bottom line. Right now, the messages are just holidays, and the only holidays I’ve got are Christmas (and eve), New Years (and eve), and Canada Day since most other holidays are ones that are like the third Monday of the month and so on. I wanted to have an alternating line to display more information, so this is the first step toward that. It may or may not change by the time I install the lights, but at least something’s been done to open up the idea.

Other than those two additions, the rest of the weekend was just debugging bugs that showed up in the time/alarm logic. I’ve also got a plan for the enclosure. It’s a food container.

I’ve got two cheap soldering irons that I haven’t used in months because they really beaten up. I need to do some soldering to package this project up so I tried cleaning up the tips. I’m writing off the one with the bent tip (I don’t even know how that happened anyway). I’d really like to buy one of those Hakko soldering stations everyone’s been raving about, though the Weller WES51 has always been on my wishlist before I heard about the Hakko iron. I also need to get one of those helping/third hand things.

So if the soldering works out, I can start transferring stuff into the enclosure. I’m hoping to show progress on that very soon.