The Box project, completed!

With the Box project, or temperature/humidity monitor (part 2, I guess), sitting on a breadboard for some time, I dedicated all of today of transferring it all into the final box. I’m very happy with it despite how simple it seems. I also have a new build material.

IMG_0942I started soldering things on using a plan I drew up. This is the first time I’ve actually planned out a PCB and it worked extremely well. I don’t have to think as much as I go along.
IMG_0943Base Atmega stuff in and some resistors for the LEDs and buttons… Because it was so organized this time, it seemed a lot neater.
IMG_0945Organization was really key to the success of this project. It’s probably bad, but I was kind of surprised. There were many connections that could go wrong, and one did but I caught it and it was smooth sailing on from there.

IMG_0946I love using hot glue now and I expect to use it a lot more. Most of this project is made up of thin jumper wires so I didn’t like the connection to the perfboard on its own. The hot glue added a better base.
IMG_0947It also helped a lot with soldering. I glued them into place before soldering so I didn’t have to position my helping hands to hold the wire as I solder.
IMG_0948The first test was just powering on the LCD. I was super happy! I slowly got the other parts online and it turned out to be all good.
IMG_0950The last part was getting it all into the box. I was getting worried it would end up like my Frank robot which was basically the same thing on wheels. In that project, I couldn’t get a lid on so there were just all of these wires flying out of the top. I was actually laughing trying to find a place for the RTC. I found humor in trying to shove it in for some reason. Maybe I was just really happy too.
IMG_0953That’s it! It’s powered with a backup battery I bought for my phone, but it also works with my USB wall warts and PC USB ports.

The following video shows what control I have over it now that everything’s enclosed. Enjoy!

Advertisements

The Box: Prototyping

So “The Box” project is back, taking on a less ambitious form this time. I’m not going to try and cram every part I have into a box. It’s just going to be a simple temperature and humidity monitor with a clock and some LEDs. It’s nothing fancy, but I’m hoping I end up with a polished final product.IMG_0826I’ve begun prototyping all of the elements of the project together and I think I have a solid base right now. Let me walk through how the prototype currently works.

IMG_0831The system greets you when it’s first powered on. There is actually a reason for this which will be explained shortly.
IMG_0832This is the main screen. The clock can be toggled between 12 and 24 hour formats. The bottom line alternates between the temperature and humidity readings every three seconds.IMG_0835There’s the button to toggle the clock. The system is powered by a 9v power adapter into a 5v regulator. The brains is an Atmega328p microcontroller.IMG_0834Those two perfboards have the temperature/humidity sensor and the real time clock. Oh look, some LEDs!

The LEDs go back and forth signalling a complete second. It’s done using delays which provides a break for the LCD and sensor updating. While the LEDs are going back and forth, it isn’t actually using the RTC. It’s simply delayed so that a cycle back and forth takes a second.  This takes us to the reasoning for the power on screen with the “Hi”. What’s actually going on is there’s a delay so that you can always read the “Hi”, then it waits for the next second change by the RTC. This process syncs the start of the program with the start of a clock second. That way, every time the program loops back to the beginning, it starts at the top of a second since each loop of the program takes a second to complete.

Check out this video to see the prototype in action:

Animatronic Head project, now “The Box”

In my five project Project Lineup, I had an animatronic head project listed there. I want to move away from the usual roaming robots because I get tired with them too quickly. In the past, I’ve seen people make cool robot faces with LED matrix eyes and servos that moved it around to follow and interact with you. I wanted to try something like that.

The Shelf Lighting System project sort of drained me as I’m finding it hard to be creative. I ended up with this after 15 minutes:This is a crappy version of what I had in mind but still somewhat close, which made me even more unmotivated just looking at it. That’s why I made the change to “The Box”.

The main purpose of this project is to put to use all of the parts I currently have. The picture above shows them all: 2×16 blue LCD, RGB LED, 8-ohm speaker, photoresistor, sound sensor, temperature/humidity sensor, and a Real Time Clock. The animatronic head was going to have these parts anyway, but taking away the servos and unique form factor, compared to a box, will make things easier for me.

The kicker for this project is that it will have an accompanying Visual Basic Windows program, although it won’t be necessary to use it all the time. I’ll have info on that when I get around to starting it.

A quick note about the temperature/humidity sensor… I just found out that the prototyping PCB I used actually has a second layer that connects pads on the board. It’s hidden under the silkscreen so I didn’t know until now. It looks like there’s a shorted connection so I’m going to try and salvage the sensor and put it back on a board like the one used for the RTC.

I’ll begin testing each thing and then start combining it all together.

Saturday Night Soldering

With the real time clock (RTC) stripped from the Light Timer Project with the success of the modification earlier today, I decided to solder it to free up the breadboard. I was going to get a socket for the chip but I just went for it and soldered it directly. I know that the heat and static can mess up any IC if you solder it directly but I took my time and tried not to leave the heat on it for too long. Even if things went wrong, it’s not an expensive mistake.

Anyways, success! Today was a good day.IMG_20140215_214218I plugged it in and set in the time. It worked without any issues.IMG_20140215_214339I’m getting used to these boards with individual pads now that I have a thinner conical tip on my iron. I just need to control the amount of solder I’m putting a little better.

That’s enough for one day. I’ll be starting the prototyping for the LED nametags soon. I need to find some material (cardboard) for it.

Light Timer Project: Beta testing

Yup, I’m calling it in beta now. After the work done today, I don’t have any other plans or expect any changes to be made. Testing will continue through the weekend, which should be enough time to confirm everything works completely.

1The biggest change was simplifying the logic for the alarms. Each hour and minute has it’s own variable and I originally was checking what hour it was, then look at the minutes, and react appropriately. It became complicated very quickly so I tried something else. Basically, the logic works with the total minutes of every time (the hour multiplied by 60, plus the minutes), instead of the hour and minute values separately. It made the logic a lot simpler to figure out. The code will be released once I’m satisfied it works fine so you’ll see what I did.

2Another change I made was the LCD brightness is now controlled by the code instead of the hardware potentiometer. I had to move the LCD digital inputs somewhere else to free up a PWM pin. Although I said I’m not planning on any other changes, I am willing to move around the button input pins to free up two more PWM pins if I come up with something else that would need it. Anyway, on the default screen with the time and date, the LCD dims five seconds after you press any button or return from the menu. In the menu, it stays on full brightness.

The last change I made was the menu now times out after 10 seconds after the last button press and returns to the default screen. As I mentioned in a previous post, the alarm processing is done when it’s on the default screen so it’s important that it’s not left idling in the menu. I still have to make sure it works on all of the menus but so far it’s been fine.

Now that the guts are nearing completion, I’m trying to figure out how I’m going to package it. I don’t want to use cardboard because I want it to look more presentable this time. The last resort is cardboard covered in coloured construction paper, but I’d really like to find another way.

Light Timer Project: First draft of code

I posted about this project about a week ago. I’m building a system to turn a string of lights on and off during certain time periods during the day. To recap, here are the main 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.

Bugs pop up from time to time, but I’m slowly going through them. It’ll be a few days before I can say these objectives are complete.

I haven’t been documenting the progress very well because I get excited after finishing one piece of it and then hurry onto the next. Here’s what I’ve got up to this point.

1Before I received the parts for the real time clock (which I’ll now be calling RTC), I was playing around with the LCD I already had from Greg the robot. When I got the parts and tried hooking it up alongside the LCD, the RTC didn’t work. After a couple hours of frustration, I pulled it all apart and started over. It was just a connection problem and had nothing to do with the LCD. It’s easier to work with one thing at a time.

2Once I confirmed that the RTC was working and that it kept going after the Arduino was unplugged, I wrapped it all up in electrical tape. The coin battery lasts for years (I think I read 9 years somewhere) so I won’t be needing to get to anything wrapped up in there any time soon. After that, I reconnected the LCD, along with the buttons I was playing with.

3Programming took a solid 4 hours. The biggest issue was getting the logic right to turn on the light (the blue LED I’m using for the testing phase). There is a library that would accomplish this, but I already had an idea of how I was going to go about it.

Along the way, I made a few notes that will probably be posted somewhere near the panel:

  • The time will remain correct if powered off. However, any changes through the menu (schedule, weekend setting, override) will be lost.
  • It expects you to enter times when you’ll be around and it’s dark. You cannot set time ranges overnight or around noon.
  • Be sure to completely exit out of the menu as the light timer will not function until it is on the default screen (Default screen displays time and date). [I will address this by having the menu timeout after some time.]

So there’s still some more work to do! Stay tuned!