Skip to content

Archive for October, 2013


JHD629 JDH204A Contrast Fix

Sometime in the last year or so I picked up some LCDs 4×20 for the Arduino. Since I wasn’t always buying from the same source, I typically got different LCDs from time to time.

One particular batch of 4x20s was marked JDH629-204A on the back and JDH 204A on the front.

IMG 4194

I wasn’t using these displays on a parallel connection but with I2C backpacks. YWRobot, WideHK, AdaFruit backpacks to name a few. However, there was a contrast adjustment problem. The backpacks with contrast controls did nothing. The LCD modules were made with fixed contrast. Bone heads.

On the surface, the contrast wasn’t all that bad but, well, when you know something is supposed to be adjustable (according to the data sheet) and it’s not, you have to fix it.

I remember at the time I contacted the eBay seller and complained of the contrast control, or lack thereof. Of course, they knew nothing about it. No surprise there either. Many of the Arduino bits and pieces sellers on eBay have no clue about what they are flogging. So I tossed them into the parts bin until I got time to look at them.

Months have gone by and I finally needed to use one and so…out it came and then I instantly remembered the contrast issue. If you do a search for JDH204 contrast you’ll find all kinds of wrong information on how to “fix” it. Guys have swapped the power pins around (not a good idea) or added in a resistor (R1 on the back of the JDH204A PCB).

As it turns out, R17 is the culprit that’s setting the contrast. Adding a resistor to R1 does nothing. R17 is a 1K, one side is the “contrast” the other is gnd.

To fix the display, you need to remove R17 and solder in one jumper. In the photo you can see I removed R17. Then you solder a jumper from the RIGHT PAD of R1 to the RIGHT PAD of R17. The left side pads of R17 and R1 are not used.

IMG 4191

Looking from the top edge of the board shows this a little clearer.

IMG 4190

The area you find R17 and R1 are top right on the back of the PCB. You can just make out my jumper at the top right corner of the PCB.

IMG 4195

Once this is done, you’ll have contrast from normal:

IMG 4192

To major contrast:

IMG 4193

And of course, you can lighten the contrast so much the printing doesn’t show at all.

Thus if you have one of these problem displays, want to use a backpack, control the contrast, you can with this simple modification.


Hayday – Tom Timer

HayDay is a very popular game from SuperCell in Finland. Essentially you run a farm to grow crops, feed livestock, fish and market your products to a “virtual” store as well as sell goods to your neighbours or fill boat orders.


Supercell comes up with updates every now and then to keep the interest in the game current.

As with most games, there are two monetary denominations. One is basically farm coinage, the other is “diamonds”. Where HayDay differs from a lot of games is that while you can use real money to buy diamonds, you can also earn them by mining or opening “treasure” chests on your own or a neighbours property.

Of course growing, selling and filling orders is the basis of the whole game. To that end, depending on what you are growing or making (pies, fish & chips, dairy products, etc) each item takes a specific brew of other items to make and “x” amount of time to process. While you can speed it up with diamonds, most choose to let it progress naturally.

When a big paddle wheeler shows up to earn you some coins, the faster you fill the boat, the more coins you receive. Novel concept…:-) But if you don’t have that many items in your barn or silo (the two storage locations you have for stuff), then you may run out of time to fill the order.

You have two options. You can sell stuff in your market to others, and ask for “help” to fill your boat. Some of the visitors will help, many will simply take what you sell and go on their way.

The second option is to use some diamonds and buy the services of “Tom”. Tom is your virtual gopher. Every two hours you get to tell him what to go look for. He’ll run off the screen for a second or two and come back to inform you of what he has found. You’ll have the option of buying the quality of the item at the rock bottom price OR you can tell him to wait and either find more of the same item (max of 9 items) or look for something different.

Thus, every two hours you send him on his shopping errand.

You don’t get him permanently, but you can rent him with diamonds for a day, week or longer. So you want to use him as much as you can. Every two hours.

Ergo, the HayDay Tom Timer I built.

IMG 4187

This is an Arduino UNO R3, LCD 16×2 on I2C, 4×4 keypad running on the I2C bus via a PCF8574 breakout shield, and a piezo speaker for the alarm. An AC to DC power adapter keeps things running.

To start the “countdown” timer, type in the numbers exactly like you’d do on a stove timer. Thus 200 becomes two hours. So HHMM is the format and then press the “D” button to start the count down. When the display reaches 0, the alarm will sound in one second intervals until it’s cancelled.

While not exactly a caesium based clock, it works good enough for, well, just about any general timing function you’d want to use it for.

However, until my Tom “rental” period runs out, it’s my Tom Timer.


Six LED Logic Monitor

I was wandering through fleaBay the other day and found a new “product” for Arduinos. Basically a 6 LED “blink” circuit:

Example Circuit

Circuit wise it’s not a difficult thing to build and it caught my eye. And at the same time I could see that with the ground pin fixed on the board you’re limited to where you can put this board to monitor anything. You can see they have GND connected via a pin, so the board only detects a HIGH output state. If you need it to show when the output is LOW, ah, nope.

Simple Ciruit

Needless to say I started thinking that a lot of times I’d like to be able to monitor some outputs without having to wire up a breadboard breakout full of LED’s, relays or whatever. The equally simple circuit I came up with is this:

Circuit 2

So I grabbed some perf board, six pin header, some 1K resistors, two different coloured LED’s and started in on it.

I cut the perfboard down with a nibbler to the size I needed. I’ll just solder the SMT components between the pads.

IMG 4151

The front side of the assembled board:

IMG 4155

The backside of the assembled board:

IMG 4156

You can see the “rails” I used for the 5V and GDN lines, the trigger point I used a jumper to get to the pins. Obviously designing a PC board would make this look MUCH neater but what the heck, I only needed one, I don’t plan on going into production on these.

Testing for a LOW only output, only plug in the Vcc (+5) line:

IMG 4158

Testing for a HIGH output, only use the GND line:

IMG 4159

Want to test for HIGH and LOW? Plug in the 5V and the GND line. Basically a poor mans logic probe with nothing more than 12 resistors and 12 LED’s.

I realized, after I built it, that I don’t even have to plug it in. I can run some Dupont jumper leads off the bottom of the six pin header and go to any Arduino pin and this is like having six logic probes connected.

Of course this is not a REAL logic probe. Those would have op-amp or IC driven front ends and be able to test for HIGH, LOW with no loading of the Arduino output pins at all. This is more of an ON/OFF type tester but so far I’m finding it quite handy for testing.


Quadracopter – Blade Nano QX

I’m kind of a big fan of the eFlite Blade series. I have an mSR and 120SR that I fly with my Spektrum DX6i. For indoors the mSR is a relatively good flyer, even though it sounds like a mad wasp. The SR120, not much fun indoors since it wants some wide open spaces.

I was watching some videos of guys flying some rather larger helicopters with a movie camera hanging off the bottom between the skids. The videos were breathtaking to say the least and the guys flying these were using point of view headsets so they could “see” what the copter was seeing. Slick.

It was then that I found a company that was doing the same but with something called a Quadracopter. I’d seen an ARDrone last year, four motor flying slab of styrofoam for around the $300 mark and while it was okay, it really didn’t do much for me.

Of course one thing leads to another, I call them bunny trails, and the next thing I found was something called a DJI Phantom. They strap a GoPro to the bottom of it and the videos are, for the most part, amazing. Course the price of the quadracopter and the GoPro tops a grand, and a lot of guys use FatShark to get a FPV when it’s flying. Pretty slick setup and I’d really love to try one. Unfortunately, a little too pricey for me.

Then I found what has to be the worlds smallest quadracopter. Blade makes it. The Nano QX. It almost fits in the palm of your hand, can do flips (on purpose) and goes about 30knots flat out. Best part? It’s dirt cheap and uses the same batteries as the mSR. So I ordered one.

IMG 4096

I ordered the “bind and fly” version since I was going to use my DX6i to control it. When the box arrived I couldn’t believe just how small this thing is. I got some spare batteries with it, spare props, and canopy. I scanned the internet for how to setup the DX6i with it since the instructions on doing so were a little vague. I happened across RC Pro Reviews and they have all the settings listed there in an easy to follow format.

IMG 4097

I have the DX6i set up in stability mode for 50% control, 70% control and 100% in agility should I feel the need to test my skills. Oddly enough you set up the DX6i in ACRO mode not HELI mode as one might think (the manual suggests you do it that way too).

In stability mode, the thing almost fly itself. I swear anyone within a single battery could fly the thing. It’s that easy. In agility mode, and I’ve flown it there to, well, best to be outside. Since I fly mostly indoors, I use a beginner setting and it works perfectly. The right amount of control.

The nice thing with this copter over the mSR is you can bump things without taking chunks out of the things you bump. You can even stick it to the ceiling and it doesn’t leave a mark. Who ever came up with this design should get an award at the very least.

Battery life, flying outdoors in a pattern, I was getting 6 minutes (I have a timer on the DX6i I use). About then you’d better be coming in for a landing because at about 6:15 it loses the battle to gravity when the shut down happens. These are 1S 150mAh cells. Indoors there is significant motor whine noise, outside you’d be hard pressed to hear it from any appreciable distance.

Outside I found I could fly about 60-80 feet away from me and at that point, I really don’t have much of a clue what direction it’s pointing. Imagine trying to read a pocket book from 80 feet away. Unless you have the eyesight of a raptor, this thing gets small. Fast. None the less I was doing high speed sweeping turns and figure eights around the lamp standard and the neighbours tree in the front yard.

That’s when I noticed something. On the mSR or 120SR when you turn left, the copter sort of fights you a bit. They just don’t do it all that well (counter clockwise turns). When you turn clockwise, they perform much better. No doubt the way the rotor works. With the Nano QX, turning either way doesn’t seem to affect it at all. On stability mode, let go of the “cyclic” stick and it levels itself.

As far as I am concerned the Nano QX is a hoot to fly, takes a beating like the mSR and even flying in 5-8mph gusts wasn’t any trouble at all. Just a fabulous little performer. +1 to Blade for another home run.


NGD – Ugly Betty

I was in a music store last summer, SurfSide Music in White Rock, and happened across a lot of not so run of the mill guitars. Which, I have to say is a refreshing change from all the fodder you see in most music stores.

I don’t remember what exactly I was doing in there that day, but I remember picking a lot of guitars off the wall and trying them out. Most either had a sound that didn’t catch my ears or didn’t feel like much. I avoided some of the guitars, well, because, they were a little “off colour” so to speak.

Robbie, who owns the stores suggested I try some of the “off colour” ones and so I grabbed some of the Di Pinto guitars he had there. The “ugliest” one was the flaming pink Galaxy IV. While some guys would argue that point, to me, it won’t change what I think of the colour of it.

As I played it, you know, I couldn’t understand how something this ugly could sound this good. The guitar was an easy player, fabulous sustain and more pickup combinations than anything I’d ever seen.

None the less, it was so off colour, I couldn’t bring myself to buy it. If you’re a guitarist you probably guess where this is going.

For the past year, I couldn’t get that sound out of my head. So 14 months later, I cut a deal with Robbie since he still had the guitar (apparently other people aren’t flaming pink lovers either).


The guitar is now affectionally called “Ugly Betty”. It’s the weirdest guitar I’ve ever owned. Apart from being a retro vision, the pickup combinations modify the sound from “jazz” to “surf guitar twang” and in between. The painted neck I was expecting to be difficult (like the painted neck on a Gibson is) but my hand just glides up and down it.

The guitar responds dynamically to your playing style. Go at it lightly and purrs like an acoustic, hammer on it and it barks right back at ya. I don’t have any other guitar that does that.

If there’s a drawback to it, there are exactly two. First is the middle pickups (two of them) are right were I like to pick and I have a nasty habit of catching the pups with my pick. So I’ve had to train myself to pick between those two pickups. Which I might add seems to be the sweet spot for the best sound any way.

The second is the wire wound strings. I’ve never been a fan of wire wound so I play flats. Apart from my Baritone, this is the only guitar that I have left wire wounds on. I love the sound of it, changing it to flats would change that. So I leave it alone. Imagine that.

When I first seen Di Pinto’s a few years back I sort of toyed with the idea of buying one. However my rule is that unless I can play the guitar I won’t buy it, and I would have had to mail order one. Surfside Music changed that because they carried the guitars. There were three Di Pinto’s in the store. There’s only two now.

It’s just me and Ugly Betty. Perfect match.


GarbageMate – Revisited..yet again…

I almost want to start this off like a comic book. As in, “When we last left our hero he was up to his nibble in binary bits!” But, unless you watched TV in the 60’s, you’d probably have never heard that tag line. So I’ll just start.

When I last left my Arduno GarbageMate it was looking like this:

IMG 4067

The main transmitting station is sending out the data, my Arduino MEGA with TFT display is just showing it, and calculating the cycle of events to know what can goes out to the road for collection.

I did make one change to the main clock source code that sends out the time/date info. I put a CRC byte in the string of data it sends. Why? Because of the way serial works. There were some times where I would disconnect one of the Arduino’s that reads the clock info over RF and it would display “junk”. Or I’d get some interference from the workbench on modules I was testing. This way I can verify that the data received is correct and complete. Works peachy.

However, the longer I looked at this pathetic display, the more I was disgusted with it. I’ve designed hundreds of UI (user interfaces) over the years and this one was just plain ugly.

Since I’d written scheduling programs for the Mac before that included calendar functions (like cycles, Julian dates, calculating the day the month starts on, daylight saving time), I hunted down some of my Mac code and translated it to Arduino. Easier than I thought it would be.

So now my GarbageMate 3.0 looks like this:

IMG 4144

Easy to read from almost across the room, you see the calendar month (shaded blocks are the days of the previous or next month), the current day is outlined in red. Although garbage day is really Wed, I draw in the colour of the garbage can that has to go out in the Tuesday column. Hey, I’m retired, I’d never get up early enough in the morning to get the can out Wed morning.

The only thing that “might” be considered missing in the display is the year. However, if I can’t figure out the year, I’m probably in a lot of trouble any way…

All of the TFT drawing is on a 3.2″ HR ColdTears display using Henning Karlsen’s TFT library.

If you’re thinking that I got all fancy and wonder how I erase the highlighted day and then show the next day, rest your mind. I do it the easy way. At midnight I wipe the whole display and redraw it.

This is what I have to put in a case now:

IMG 4111

A MEGA, TFT shield, TFT and an RF1100-232 module. At least now it looks like something.


The LED…is dead…

Quite some time ago, I removed all the halogen lighting (9 x MR-16 50W’s) from my work bench area and replaced them with “equivalent” LED (3 x 3W) bulbs. The main reason I did this was that the track lighting holders have a safety glass that was falling out, yes, not of just one but on all nine. No doubt the few years of heat started to affect the bulb holders.

That and the heat emanating from nine Halogen bulbs is rather volcanic to work under. I didn’t tan, I fried.

The bulbs I replaced the Halogens with were from eBay, touted as “just as bright as” and under $10 each. Of course I was only momentarily deluded into thinking the LED’s 9 watts would be as bright as a 50 watt Halogen. So if you’re reading this and thinking, yeah they’d be as bright, forget it. Not even in the same country, let alone the same ballpark.

I figure, oh maybe a 20-25 watt Halogen. Heavy on the maybe. I’ve seen 17 watt Par38’s that come “close” to a 80 watt Halogen, but the LED beams are too focused so light doesn’t spread much. LED’s need a good lens set up to get beyond the usual less than 20 degrees of spread. I have seen ones on eBay of late that advertise 120 degree spread. I figure the three LED’s in the bulb must be mounted so they point out sideways.

Any way, tonight one of the LED’s starts to “flicker”. Just like an old incandescent. Wow. And then all the magic leaked out of it. Just trying to get it out of the MR-16 socket destroyed it. Okay, I helped it a little…

In the photo you can see the 3 x 3w LED’s. And a LARGE plastic lens in front of them. And yes, they run dang hot too. Not as hot as Halogen but still hot enough to melt plastic.

IMG 4135

MR-16’s are 12VAC powered so I took the screws out of the socket to see if the power converter in the LED’s was shot. Here’s the two token shots of the power conversion stage:

IMG 4137

IMG 4138

With most of these LED’s the big electrolytic capacitor is the part that fries. Not in this case though. in this case, the heat and probably a bad connection got to the LED and it cooked itself.

IMG 4139

Not hard to see the discolouration on the PC board. I left on the two plastic “tear drop” lens and to the left you can see the LED just sort of melted it’s way right into the plastic. Nice.

After removing the rest of the pieces, here’s the raw board:

IMG 4140

You can see the plastic retainer melted and malformed, the burned area and be aware that these lights are not really all that great. In longevity or brightness. But you don’t get much off eBay for under $10 sometimes.

Safe to say that LED’s aren’t going to replace those heat generating Halogens any time soon.

Now there’s some new LED lighting called COB (chip on board) that offers lower thermal resistance, sports 120 degree spread and a 5 watt version, according to specs is 520 lumens. Which is pretty darn good. I see a 12 watt COB LED sports 700 lumens. Now that’s better but still a 50W MR-16 Halogen puts out 825 lumens initially, 900 at center beam.

Maybe someday they’ll get this worked out. Still, I’d take either one of these over a CFL bulb. Any day.