Charlieplexed 4×4 Matrix w/Attiny85

Between the light show and EERef, I haven’t had any time to really think about how to use these Attiny85’s I recently bought. After some image searching for inspiration, I settled on a 4×4 matrix using the charlieplexing technique.

IMG_1164Since the final thing would be soldered, I really wanted to hammer out the details on paper to make sure I got things right the first time. I did some sketching to make sure the schematic makes sense… As an experiment project like this, I didn’t bother prototyping on a breadboard so my plans had to be right. I sketched out the perfboard layout on some grid paper (not pictured) which is always a massive help.
IMG_1162
Soldering went perfectly fine. I’m really happy with it.IMG_1163I manually tested each LED by connecting a hot and ground wire to the appropriate pins on the socket, and it works as it should. I ordered some headers and terminal blocks last night so it should have a way to connect power by the end of the week. I did some simple tests with the Attiny85 (powered by poking wires at it) and that worked as well. Programming will continue on while I wait for the terminal block. A final update will be posted when it’s all done. Thanks for reading!

Advertisements

And so it begins… Light Show #5!

First thing’s first: The Arduino Light Show project now has its own webpage. It has all of the updated information on the project, including a reorganization of the version numbers. I’ve started on a new show that will be version #5.

This show is going back to the basics. It will more or less be version 2, but with an expanded amount of “ground” LEDs and will use different methods of construction. I’m hoping it will be more polished this time around.
1_layoutI went through different layouts of the ground LEDs but this one ended up being it. There are four rows of different colors and one reduced back row of white LEDs that will mostly be used as a flash/strobe light whenever that’s needed.2_cutOnce I got the layout confirmed, I chopped the board so that it would be just large enough to hold all of the LEDs. It’s just slightly larger than a breadboard.3_solderLEDsSoldering the LEDs on took about an hour. Each LED will be addressable (not multiplexed) so one leg goes to the ground bus while the other leg will get a resistor and wire to go to the Arduino. I thought about using headers to make things easier but I think almost everything will be soldered.4_testLEDsI tested all of the LEDs and, after closing a few missed connections, they are all fine.5_solderresistorsThe next day, I soldered a resistor to each LED. The blue and red LEDs have 620-ohm resistors while the rest have 220-ohm resistors. I did a little testing to see how each color looks on the two resistor options (admittedly after soldering, which wasn’t the greatest idea). To make sure that one color doesn’t overpower the rest, these were the resistor-LED combos that worked the best. Unfortunately, the green LEDs are dim no matter what but hopefully it won’t look too bad in the end.

The next step is to solder wires to each LED that will go to the Arduino, and then figure out how I want to insulate everything. I’ll probably end up pretty much pouring hot glue all over it…

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!

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.

Name Tag Project: Completed using Plan C

The LED name tag project is complete! Two things went wrong so I fell back on backup plans. The end result is a simpler version of what it was supposed to be. The original plan was to have a standalone LED name tag, powered by an Atmega328 circuit. I didn’t have a capacitor for the voltage regulator so it wouldn’t have its own power supply, and something went wonky with the Atmega328 circuit. There’s more on that below.

IMG_0741To fix the no-voltage-regulator problem, I went back to the Desk Lighting Project to steal some power from it. In that project, I said that it was expandable simply by soldering on a couple of wires to the dip switch board. One of the switches now controls the power to the LED name tag.
IMG_0742The next step was to set up the Atmega328 chip. I’ve had great success in other projects where it worked right off the bat. This time, it didn’t. Taking out and plugging back in some capacitors got it going but it eventually started going all weird on me. The program sequences would get stuck in a for-loop forever or skip lines of code. It worked fine when it was running on the Arduino Uno. After about half an hour of trying to figure out what was wrong, I gave up and decided to let the switch control it. There won’t be any patterns, unfortunately. I have a feeling it’s the oscillator so I’ll order some more whenever I feel like it, along with those capacitors I need for the voltage regulator. I’ll take a break on these Atmega328 powered projects for a while.
IMG_0743It looks nice on the desk among my random things. In person, it looks better the further you are away from it. I think it may look better with diffused LEDs but I’m still satisfied with it.

Thanks for reading! I’ll be working on updating my Featured Projects page, as well as a post summarizing my recent projects and what I’m up to next.

Shelf Lighting System

After the nice result of the Desk Lighting System project, my brother wanted me to do the same for some shelves in the basement. It quickly turned into a larger project than I was anticipating. This was honestly one of the most stressful projects I’ve worked on in a while as I spent 7 hours non-stop for two days getting it up. The lights we got was a 5 meter white LED strip. I had to go back the next day for two reasons: I bought the wrong power supply (had AC output), and I researched more and saw I would need a mosfet transistor (some explanations on this later).

IMG_0738The first day was literally spent cutting the strip and soldering them back together. It took a long time because the pads on the strip are really small when you cut them so they broke off or the solder gave me a hard time by refusing to flow on the pad. Once that was done, I taped them on all of the shelves. That was all of day one.IMG_0733Day two was another frustrating mess. I got the circuit working using an Arduino Uno board. The final project would have a standalone Atmega328p circuit and a voltage regulator. Before I move on, I want to explain exactly what the Atmega chip is for since I didn’t use it in my last lighting project.

My brother requested a dimmer. To do that, I’d need to use the PWM, or Pulse Width Modulation, pin on the Atmega microcontroller. Basically PWM is adjusting the duty cycle of the output signal so it changes the intensity of the light as we see it. To get a dimmer light, the duty cycle is decreased, or the time on becomes less than the time off in one cycle.

To make things more complicated, the LED strip runs off of 12v, which cannot be supplied directly to the Atmega chip. That’s where the voltage regulator and  mosfet transistor comes in. The voltage regulator is a constant 5v regulator that is required for the microcontroller. The mosfet transistor is used in this case as a switch to open or close the ground connection of the LED strip. The positive connection of the LED strip goes to the 12v source. When a signal is sent to the mosfet [gate], the “switch” closes, turning the lights on. PWM still works as it’s basically opening and closing the switch really fast.

Now back to the pictures…IMG_0735I tried soldering it together. That failed. I don’t know if it’s a failure of connecting it properly or if it was because I had a wrong capacitor (which I discovered after, when I decided to just breadboard it).
IMG_0736So yeah, I took the easy way out on this one. My main worry is that something is going to fall off because it’s mounted sideways. I taped as many connections as I could so it should hold up. I’ll probably keep a close eye on it for the next few days to see how it works out in use… even though I don’t want to. I’m exhausted from this project.

IMG_0737The switch and dimmer potentiometer are solid in place. And yes, it’s another food container.

IMG_0732The final result.

Good riddance… I mean, it’s pretty amazing that everything came together in three days, but the stress was intense trying to get it to work. I have a fear that something will give.

On to the next one.