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!

Advertisements

New project: Timed lights

Every year for Christmas, we have a few strings of lights going on in our house. Aside from the tree, we’ve got a string of lights going down the railing of our stairs. We usually just plug it in whenever it gets dark and then the last person who comes upstairs for the night unplugs it. This year, we got a mechanical timer for it. We’ve got it turning on when it gets dark in the evening, but we’ve also got it going on for whoever’s getting up early in the morning for work. They’ve gotten so used to it that my parents bought a string of lights that looks a little more generic to use throughout the rest of the year. Their plan was just to use it as it’s designed with the on/off switch. Of course, I can’t allow that.
1These are the lights that they got. The packaging was seriously impressive. The battery holder was in a box and, on the outside of the box, there was a Try Me button that let you momentarily toggle it on and off.
3 This is the circuitry for the Try Me button. They were powered with three 1.5v button cell batteries that were in their own enclosure (that white cylindrical piece). I love the big tactile button which I hope to find use for in this project. The third white bit is a connector that you’re asked to remove to dispose of this circuit when you’re ready to use it properly (but why would anyone do that?!).2This is the other side of the connection. It bypasses the switch and is connected directly to the lights so that the button is the only thing that’s in between the battery cells and the lights.

5I decided to try hooking them up with the power I’ll be using from the Arduino. There is a resistor already soldered onto the switch but I was having trouble figuring out the color code (it’s been a while, don’t judge me). I checked with a multimeter and it’s just 8.2 ohms. I tried with the 3.3v and 5v supplies. There is a noticeable difference but 3.3v could still be fine for this project. I can always see what works better when it’s finally installed.

I was thrown off by the wiring that they used. It appears as if it’s uninsulated, but I found out it’s probably insulated by a clear coat varnish. I could probably just scratch it off or solder (which would burn up the insulation) but I feel safer just using the connection at the battery pack.

4I’ve never powered an Arduino directly from a proper barrel jack adapter. I’ve always used batteries, USB power, and USB adapters. I’ve had this adapter for years and I never used it because it’s kind of old and I find it hard to trust. The switch is not accurate because that’s the final position for 9v… between 6 and 7.5. I had to use a multimeter to confirm. I also don’t like the idea of having all of the other jacks floating around so I taped them up with electrical tape to avoid any of them touching. It’s a very low risk situation but it’s all about doing this safely, especially if I’m going to leave it plugged in overnight.

So what am I doing anyway? I’m using an Arduino to switch on some lights at certain times of the day. I’ve already put in an order to my favorite supplier, Dipmicro. I’ll need to get a real time clock, along with parts for the circuitry including the capacitor and oscillator (I already have the resistor). I also picked up a potentiometer for the LCD because the pots I already have are all beaten up.

I think now is the time to put down a list of objectives:

  • Turn on and off the string of lights automatically during specific times during the day.
  • Have an LCD display the current date and time, as well as when the lights are going to change state next.
  • Allow for manual control of lights.
  • Allow change of time periods through use of menu buttons and LCD.
  • Allow enable/disable for weekend automation.

This’ll be a fun challenge. Stay tuned for the first RTC tests when the parts come!