Skip to content

Archive for January, 2013

26
Jan

Matrix – LED style

As a certified LED nut, I’ve often watched those scrolling signs so many businesses have for advertising. While I have no aspiration to advertise anything from the Wanch that way, they’ve long intrigued me.

When I spotted some very economical Arduino LED matrix shields on eBay, I couldn’t control my mouse and ended up ordering some of them.

eBay link for reference

The dreamer in me was envisioning a display about the size of a football stadium. No, I don’t know why. In truth, these displays are about 1.2″ square. In a dark environment (like a man cave) you can easily read them up to about 30 feet away.

It must also have something to do with POV, persistence of vision, because the letters, if you scroll them across the displays look like italics.

LED Matrix

This is a “kit” or DIY as they refer to it and as far as kits go, putting it together is fairly mindless if you have any electronics and soldering skills at all. There’s no schematic, parts list, or anything. But you have one electrolytic cap (polarized so watch it) and an IC socket that can be put in either way but match the notch to the notch on the silk screen.

Something you want to watch for if you order LED matrix shields is that they are designed to be used with common cathode displays. There’s a large number of these displays that are common anode and the Arduino library will give you some fits with those.

The only thing confusing about assembly is which way to insert the matrix.

DSC 0577

If you look at the matrix there is some writing and a little bump on the center bottom edge under the writing. That’s the way to put it in the socket.

I went searching for a library since these things are pretty common and found the “LedControl.h” library. So I grabbed it, ran some of the examples. And found the display was off. Letters and stuff were backwards and lots of little “issues”. Apparently the site I downloaded it from had a “modified” version. For whatever reason.

This led me to the Arduino site and I found a link to the original LEDControl.h library which I downloaded and tried out with complete success. Sort of.

Seems the designers of these boards kind of messed up if you want to connect up several modules to make a larger display…

When you see below is the orientation of the display. (0,0) is top left corner in the photo.

DSC 0582

So if you want to make a larger matrix (something Neo would even like), you end up with this:

IMG 0296

Or raw circuit boards:

IMG 0313

Ah..there’s a GAP twixt the displays. The boards do have connectors as you can see to feed from one to another and you can have 8 matrix displays wired up. But you get gaps. Not good…

What you really want is something like this so you can set them side by side:

IMG 0314

So cable from the Arduino in the top left, out bottom left to top right and so on. Then when you put them together you end up with this:

IMG 0307

The headers that come with the boards are 90 degree ones and if you have a number of boards you can see how the cables will extend off the ends. I used (and removed) these connectors after building the first shield. I used straight ones that extend from the back and mine are wired like this:

IMG 0311

This makes connecting them up together much easier. I used some 6 pin DuPoint cables because I didn’t have any five pin ones…

Of course you are faced with the problem of displaying stuff with a complete new orientation for single LED’s, rows or columns. I was originally going to add some functions to the library but I thought better of it and wrote them into my sketch.

A video of a dual display scrolling the word “Arduino” is shown here:

Arduino_Scroll.m4v

So now you need a link to the LED Control library on the Arduino site.

For LED Control code you have setLed, setRow, setColumn. I wrote code that rotates those 90 degrees counter clockwise and I called them “showSingle90, showRow90, showColumn90”. The code isn’t pretty, hasn’t be optimized much but it works and will allow you to use multiple displays.

If you want the LEDControl Library and some example sketches that I wrote (not just the big one below) here is a link for the library I’m using and sketches I wrote. Just install the library and then select some of the examples.

At the end of the day, I have to say these things are a hoot to work with.

15
Jan

Garbage Mate – Version 2

Since October 2012 I’ve been running the “Garbage Mate” to let me know what garbage cans get taken to the road.

IMG 3344

Version 1 used an Arduino UNO, ethernet shield, and DS1307 RTC. It would call the NTP server once every 24hrs to update the time and for the most part it worked pretty good. However, as has been my experience with NTP servers and the DS1307. At some point the time goes out. The last couple of days it managed to lose 10 minutes someplace.

In spite of the fact it was updating it’s clock from a known source, the DS1307 still maintained its 10 minute error. I have zero idea why but as I said, when updating the DS1307 I’ve had problems in other areas. I since decided that fiddling around with wireless, ethernet and NTP servers is a waste of my time.

Since I created my “Arduino Clock” and revamped the house address both with GPS receivers, these little modules are my new best friends:

GPS

I’ve read that you have to use them outdoors not indoors, cloud cover will “blind” them but my experience so far is, they work indoors perfectly. I commonly get between 8 and 11 satellites and errors in encoding are only encountered when starting them up (they do take a while to warm up).

Therefore, for 2013, out with the old, in with the new! I started with a case that I was going to mount the whole thing in:

IMG 0278

Although the case was designed to have all the switches and stuff mounted in the removable end panels, I needed more room for the display. So in the side it went, along with the three LED’s to indicate the three garbage cans.

Rather than shoving leads into the Arduino headers, I used an expansion board (V5):

IMG 0279

Then I added in all the Dupont wiring harness to the various components:

IMG 0287

For the LED’s I just cut the ends of the Dupont cable and soldered on the resistors and LED’s. If I ever take this apart, I can always use this as a plug in test circuit! The GPS is held in place with a zap strap. I used a tie down to hold the zap strap. The LED display fits tightly and really didn’t need any additional hardware to hold it in, but I used some double sided foam tape to ensure it stays in place.

IMG 0288

I had some ideas of writing in code so that if a holiday befell the garbage pickup day, I’d “adjust” the pickup date. However because my routines calculate in a “cycle”, it’s pretty tough to do this. I thought about writing in “exceptions” except that each year I’d have to write in some new ones.

Carol pointed out to me that the only time the holidays change the pickup day is for New Years and Christmas day. She said we could easily remember those.

However since this was “version 2” I thought of a change any way. Normally the LED’s come on the day BEFORE the pickup so absent minded me can see them and hopefully react in time. However once I run the cans out to the road, it’d be nice if the LED’s would shut off.

I thought about using some new NRF24L01’s I got and putting one on the bottom of each of the cans so as soon as they got out of range they’d turn off the LED’s. So three cans, three Arduinos, three times as many problems when the automated dumpsters drop the cans on the driveway…;-) Instead I added a pushbutton. When the cans go out, I press it, LED’s go out. And yes, if I made a mistake, another push will reset it.

So the unit looks much nicer now (not so hacker like) and the GPS is grabbing 9 satellites almost all the time, in the corner of the house, through two floors, walls, ceiling and roof. Gezz those things are a hoot to use. Now if they’d make them just a little cheaper…

IMG 0283

12
Jan

Lights! Camera! Shadow!

I received a nice shiny new Canon A4000IS to replace my aging point and shoot Canon. While my old Canon only sported a 4X optical zoom, 10 megapixels and fairly good macro for closeups, the new A4000 bet it hands down in both areas. Sort of.

Before I start in on that, if you happen to own one of these cameras and you do any indoor shooting at all, you might find your pictures, for some unexplained reason, develop a distinct yellow cast to them. From what I’ve read, this is common for a lot of point and shoot cameras. It comes from the fact that the “AWB” (auto white balance) doesn’t always detect what type of light through yonder room shines.

Outside in daylight, no problem. But inside with CFL’s, LED’s and halogen, I got heaps of yellow. Even using the auto correction in iPhoto made it worse. Here’s an example of “auto” mode.

IMG 0007

Put the camera into PROGRAM mode and select the tungsten light:

IMG 0017

Substantial difference. While you’re in “program mode” if you’re shooting indoors, change the ASA to 200. My experience is that if you leave the ASA in “auto” mode (this thing has more auto modes than a car dealer) Canon loves to ramp up the ASA to…anything between 100 and 800. Quality starts to drop off pretty badly at anything over 400 in my opinion. So I have program mode set to ASA 200.

Also in program mode, you’ll find that the shots at the settings I suggested will always produce a shutter speed of 1/60. Whereas in anything else, it’s all over the place. Judging from the quality of the enlargement, that’s not always a good place either.

I should also mention that I read a LOT of review sites that show the indoor pictures that look “loverly”. They give you the speed, ASA and focal length they used to obtain the image. After spending a whole evening trying to duplicate their settings with my own setup, I came to the probably not so brilliant conclusion that they aren’t using the point and shoot in point and shoot mode at all. They are getting as close to manual as they can and hitting it with studio lights. As if we point and shoot buyers will have that in our camera bag. I now have a healthy disrespect for those so called “reviews”. Fluff. Just fluff.

Any way, I’m less than impressed with Canon’s processor, the Digidiot 4 or 5 or whatever number is supposed to be state the art. More like state of the “ark”. Sigh…

So, back to the topic of macro. The A4000 has what I’d class as a superb macro and it was designed by engineers who should be taken out back and flogged with the camera. When you get into “really” close proximity to your subject (Canon designers take note: this is what MACRO is FOR), there’s a problem. Not outdoors, but in low light.

Take a look at the typical lens position in macro:

Canon A4000

Now imagine something small right in front of the lens:

IMG 0240

HEY! What’s that shadow? It’s the extended lens. I was about 1/2″ from the circuit board. Can you say, DUMB. Sure you can. I did. Did no one notice this during testing? Really? Guess you’re supposed to limit yourself to taking macro images of flowers in direct sunlight. Swell.

Thus, the question became how to light the subject for macro shots. I had an epiphany and thought I’d give some white strip LED’s I have a try. Temp of them is same as daylight (supposedly) but I left it with a tungsten setting any way.

IMG 0246

You can see the depth of field was about “nil” for how close I was. The LED’s have a distinct blue cast to them but since I turned the flash off, that was the end of the main problem.

I am using “Program” mode and I selected the custom “white balance” and let the camera figure out what it was “supposed” to be doing. Surprisingly enough, it did it correctly. Probably a different engineer worked on that part. Like one who knew what he was doing. He probably got a job with Apple now.

IMG 0273

That fixed the LED’s bluish tint in a heartbeat. The lens was about 3/8″ from the circuit board when I took the photo. Again you can see the depth of field and you notice some lens barrel depth of field at that distance. Not a deal breaker to me though.

Unlike the “professional reviews”, I’m going to show you my setup to get that shot. I promise anyone with the same settings (Program/ASA200/Custom White Balance/1M 5000K LED strip) can reproduce this exactly.

IMG 0277

The “professional” set up is on an 8 1/2″ x 11″ piece of paper. I run the 12V LED’s off my bench supply at 12.2Vdc.

The A4000 is now discontinued and replaced with a “touch screen” version. The ELPH 320 HS. The HS doesn’t stand for “holy smoke or hot stuff” either. When I tried the 320HS camera out before I got the A4000, I found I was tapping, dragging, etc about 85% of the time and using the camera 15% of the time. Getting to any settings in the camera is painful too many times. So for Canon and their idea of a “touch screen” interface, I heartedly give them a complete FAIL.

Ultimately, I’m guessing they moved the lens/flash guy out of that area when they realized he was “challenged”. And they moved him to “interface design” to revitalize him. I got news for Canon if they haven’t clued in yet. He’s still challenged.

How long has Canon been in the camera business? With all the advances in electronics and other technology the best Canon can manage is adding WiFi and sporting an interface that mirrors MSDOS 2.0. I’m really going to go out on a limb and hope the guy who failed with the lens/flash/interface doesn’t decide we need the “ANY” key.

You know, “Press ANY key to continue”…

4
Jan

POP3 Email Checker – Display

My POP3 email checker has been running faithfully for three months 24/7 and working like a charm. I revamped the LED’s on the display a couple of times to neaten it up but that’s been the only change. Cosmetic. When dealing with code, one can see that as a good thing.

Surfing on eBay a while back I noticed something called a “LED Mail Alert E-Mail WebMail Notifier USB Port Laptop PC Mouse Printer Hub“. If you’ve ever used eBay you’ll notice that sellers tend to use the shotgun approach in their listing titles so as to “attract” as many search hits as possible. Like using META tags in a web site.

Email checker

However, in that approach you get the uneasy feeling that the lister really doesn’t have a clue as to what the heck they are selling. One glance at the photo and you know said device has squat to do with a “mouse printer hub”. In generic terms we call this listing title a FAIL.

Finding detailed information about this device is a challenge. Since it’s from Asia, those companies have more in common with Xerox (you know what they are famous for), than original ideas and concepts. Where you do find a “manual” and I use that term loosely because Babblefish apparently doesn’t do a great conversion to English, assuming it had something intelligent to start with, you find er..confusion. Big time.

Or to put it another way, if carpenters built houses the same way Asians write owners manuals, the first woodpecker that came along would have completely destroyed civilization. Nuff said.

Turns out that some of these things have been filtering to North America over the last year or more and some of the early buyers managed to figure them out. For various OS’s at that. I found a couple of references to an Ardunio based control for them, and one even for a Mac. None of which I could make function. Besides I wasn’t about to dedicate a whole USB host shield to flashy lights.

Essentially you send these “email..yadda yadda..yadda” things a specific string via USB and they can control an RGB LED instead to let you know “You’ve Got Mail!”. Or something. Also turns out there seems to be a couple versions of the device. Perhaps that’s the reason I couldn’t get it going via a USB host on the Arduino.

The main reason I picked up a couple of these, was A; they were cheap, B; I wanted the case. What was inside didn’t matter.

This is what I got for a few bucks. The LED box and the MINI-CD. I did try to install the software on Windows but it still didn’t work. The manual even says that POP3 checking might not work. Big surprise. Again, not a big deal any way.

IMG 0220

As Dave (from EEVBLOG) says, “Don’t turn it on, take it apart!”. So I did…

When you open up the little box, you find, oddly enough, a little circuit board:

IMG 0221

Notice there is an empty LED location above the RGB LED. No idea what that was for. But you can see there are some support components missing for it. There’s a controller chip to convert from USB to RGB. There was no indication of a part number on the IC so I assume a PIC chip of some sort. The board is USB9528-V1.0. Whatever that means.

Basically I cut out the controller chip and wired the USB cable up to the RGB 5050 leads. Then I wired that cable to my Arduino POP checker to replace the LED’s on a bread board.

When my POP3 checker is looking for email:

IMG 0236

All pretty green.

When it finds email that I actually want to be aware of, it flashes the Red portion:

IMG 0233

I have this rig downstairs and not in the office so if I’m watching the telly (if NCAA football or golf is on), I know someting impotent awived. I find this very useful.

Which kind of makes me wonder about its actual use. According to the manual, you plug the box into your computer and it flashes the green light when you get mail or you need to check your IM (instant messenger). The light can be set to flash to show how many emails in your InBox, in the colour of your choice. Considering the spam my email account gets the thing would be like a disco ball here. IM or Skype aren’t used by myself, but it will alert you that someone wants you as well. Might be good if you don’t feel wanted.

So now I think it’s trendy, like a duck.

2
Jan

Garage Address – revisited…again…

The house address has been running since September 2012, 24/7. It’s using ethernet, wireless router, DHCP, DS1307, LCD I2C, and an NNTP server pool to keep itself accurate. I have to admit for the most part, it’s been pretty solid. I’ve had to reboot it about six or eight times in that time period, so once a month or so.

Of course it’s a house address so if it doesn’t shut off or “forgets” to light up one night, there’s no Mayan End Of The World (oh wait, that didn’t happen any way)… I just check it as I leave the garage to make sure it’s running and that’s it.

After working on the studio clock with the GPS, I started to appreciate the simplicity of that little GPS. Someone even wrote a TimeZone library (I wrote my code to do it), but it was gnawing at the back of my lobotomy scar. Today I decided to simplify the garage set up so I took out the ethernet shield, removed the wireless router and redid the code so it would use the same little GPS.

IMG 0229

The LCD display shows the “power” (top left) going to the MOSFET that controls the brightness of the house display. It’s set using a pot that doesn’t need to be in the circuit for testing so that portion of it is missing. The brightness is scaled from 0 to 10. The 4″ seven segment display is so darn bright that anything over 3 or 4 for brightness and it’s more of an eyeball laser. So I have it set at about 10-15% brightness.

The arrow on the second line shows the DST setting (fall back (left arrow) or spring ahead (right arrow)). And it works nicely. With the ethernet NNTP version I used to check once a day for DST. With the GPS I can check every second. The satellite never gets upset.

The 09 in the bottom left corner is the number of satellites it’s found. I find this varies between 7 and 12. Depends on cloud cover. If the “sats” drop below 4 I stop the time update.

For time keeping, I could use a DS1307 (got lots of them now), but really, I’d just as soon use one of these MT3299 GPS units and be done with it. Course, I can’t monitor the door or address over the network any more, nor turn it on and off from a remote location. Which I didn’t do any way.

But I have some NRF24L01’s coming in the mail. So…who knows what’s in the future.