Skip to content

Posts from the ‘Electronics’ Category

21
Jun

Gibson Robot Guitar Battery Replacement

A few years ago, a local music store was blowing out the Gibson SG Robot Guitar. The robot part being the part that allows the guitar to tune itself. The technology was from Tronical and Gibson used it.

For a rather short period of time. I got mine in 2009.

IMG 0403

Of course I’d heard some of the horror stories about the guitar, all electronics being somewhat unreliable and so on. Not to mention a $3500 USD price tag. Which put it out of reach for all but the rather well heeled clientele.

However, the store was blowing these out for less than 30% of their list price. Thus for under $1,000 CDN I could buy a real Gibson SG. At the time, a standard SG without the electronic tuning sold for more. After some investigation, I found that the electronics was used for one thing. Tuning. If somehow that should fail, you could simply unlatch the tuning pegs from their mini-motors and tune it the same old way we all do and press in the pegs to relatch them.

As I saw it, a chance to own a top quality USA made guitar and it didn’t matter a fig if the electronics last two weeks or twenty years. The guitar was still a USA made premium guitar.

As of lately, the tuning has been sort of hit and miss so I started to become somewhat concerned about the electronics. Turns out, the electronics are fine, but Gibson (Tronical) decided in their not so infinite wisdom to use a NiMH battery to power the motorized tuners. Having been dealing with radio controlled models for years, I know about the lifespan of NiMH batteries.

According to Gibson, the batteries are supposed to be good for 200 tunings. Maybe. I doubt that I ever tuned it that much. Probably closer to half of that. I found the battery would never reach a full charge and it dropped pretty fast.

All the ear marks of a NiMH battery that is on its way to the recycle depot. This is what the original battery looks like. When you find it on Gibson’s web store, you’ll also find that it says, “Out Of Stock”. The only remaining source is Tronical and that’s going to cost upwards of a $100 or possibly more with shipping from Germany.

NewImage

Tronical, bless them for this, listed the battery as 2.4V 2200maH. A single NiMH cell is 1.2V. It was sort of obvious they are using a pair of 1.2V AA sized batteries wired in series. I have a number of 1.2V 1300mAH cells in the shop here so I planned to make my own pack.

First, the back of the guitar.

IMG 4708

You can see the Tronical battery and the big red and black power wires clearly under the plastic. There’s a Velcro button on the back of the pack to hold it in place. After you take out the five screws holding the plastic cover on of course…

IMG 4709

The connectors used are press fit, remind me of RC connectors. Try not to short them out when you get them apart.

While I was in there, I checked out the wiring as well. While Gibson makes high quality guitars, their wiring and soldering ability leaves a lot to be worked on. One capacitor had broken away because the leads had been nipped by a wire stripper. Very brittle. Wires were jammed through the solder lugs on the pots and slobbered on. When you pour that much solder on something to hold it; I call it slobbering. So I cleaned up the connections.

I decided to test out my NiMH pack to make sure it was going to work. Hooked up my pack through a couple of 12″ alligator test leads. And got my first surprise when I turned on the MCK. Nothing. No LED’s, no flash. Nothing. I assumed the batteries were dead, but they still had more than half a charge in them.

I disconnected the NiMH pack and plugged in my bench power supply. Set it to 2.4V. It managed to light some of the LED’s. Which tells me that at the lower end of 2.4V you don’t have much life left in the batteries. Closer to 3.12V for a full charge. I decided to see if I could charge my NiMH pack. And got my second surprise.

With the pack connected with 12″ alligator test leads, there was no way it would charge. I immediately thought that there must be some “electronics” in the battery pack. I unwrapped the Tronical battery, and wasn’t surprised to find no markings of any kind of the batteries. And no electronics of any kind.

My conclusion is that the length of those battery wires is crucial for the onboard electronics to not only detect the battery but also to charge it. Note that if you’re doing this yourself. At any rate I figured that the worst case was I’d have to order a replacement battery from Tronical. Best case is my pack would work.

IMG 4710

Now who ever soldered on the battery wires was very good at their job. I used a soldering gun to remove them (could have with a low wattage iron, but easier with a gun).

I soldered the wires on to the tabs of my own battery pack. Then bound the pack in electrical tape.

IMG 4711

Put the battery in, replaced the plastic covering, tested it, connected the charger and..presto. Working like a champ. Cost of replacement? $4 from eBay. And yes, while my batteries might say 1300maH, well, that may or may not be the case. But certainly cheap enough I can throw them out every year and still be ahead of the game.

IMG 4712

19
Jun

MIDI Mate – Arduino

After writing iFCB, iVamp and a number of other MIDI programs, I came to the conclusion that I needed something to assist me in debugging MIDI commands.

Granted a lot of that can be done on a computer, but when you need to do it where the computer isn’t, you either need a laptop or you can pretty much forget it.

I started searching for stand alone MIDI tools and found references to tools like this a Studiomaster MA 36.

NewImage

But it was the more elaborate Elm Video Technologies version that tweaked me to pressing an Arduino into the job.

NewImage

While I could have purchased a whole kit from MIDI Kits, I already have enough Arduino boards around to use. Plus just knowing that a CC, PC or NOTE was transferred really isn’t enough information. I need to know the values. Thus, LED’s don’t work. A display of some kind is required.

Ultimately I decided that I didn’t want a two line LCD display. True they work, but they are kind of limited as to how much information they can display. I’d recently purchased some 1.8″ TFT displays off eBay that used Adafruit’s 7735 library. These displays use SPI and work great.

I built the MIDI interface using the schematic I found on MIDI Kits.

IMG 4691

The TFT display shows the received portion on the top and the “send” portion that I can edit on the bottom:

IMG 4692

The display is in HEX or decimal and I use a lowly Arduino UNO for the whole project. The sketch is roughly 27K so there’s a little bit left for expansion. I use a rotary encoder for editing and it’s the most finicky portion of the project. I have to use the software polling for the rotary because of the Software Serial library I use for the MIDI interface. It works, but definitely not as smooth as using interrupts to decode it.

I’d ordered some plastic cases, water proof as it turned out so I used one for my MIDI Mate:

IMG 4694

I supply power to the board via the external DC power jack or the USB jack if I’m using it by a computer. Works well in either case.

IMG 4700

Since I deal with SYSEX a good amount of the time, I always wanted a SYSEX display. MIDI Mate automatically changes the display to SYSEX when a message is received.

IMG 4702

If you notice the bottom of the display you can see “Sonarcana LLC”. I included all the current MIDI manufacturer ID’s so I know who the SYSEX message belongs to. Unless it’s a universal message, in which case:

IMG 4703

Obviously the TFT display doesn’t allow me to display the full name of some of the companies so I had to abbreviate where required. Still, it does provide some useful information (as well as the hex offset of the data for debugging messages).

Presently there are some design limits. First, the SYSEX for the Arduino library is limited to 255 bytes, unless you change the buffer size. The UNO only has 2K of ram so changing it probably isn’t a good thing to do. If I was using a MEGA then it would be different as they have 8K of RAM.

Secondly, I only display first 64 bytes of the SYSEX message. I was going to allow a “page” through the SYSEX in 64 byte blocks but noticed that the majority of my messages were fairly small. This I can still change though if required.

Lastly, I’m toying with the idea of adding an EEPROM to the I2C bus so I can save the SYSEX coming in, and then send it out after I look at it. I don’t have a specific requirement for that at the moment, but it’s an option I might put in.

In closing, I have built tools in the past that have been useful but I discarded shortly after their intended use. I find the more I use my MIDI Mate, the more I want to use it. It’s just a very nice, portable, MIDI debugging tool. I can emulate an FCB1010 easily, or whatever I need. Where it’s something that MIDI Mate doesn’t do, it’s just a matter of adding to the Arduino sketch.

18
Mar

Under The Microscope

I’m doing more SMD work (that’s using very small surface mounted electronic parts) and checking my work, even with a headset magnifier is difficult. I’d purchased a “budget” USB microscope from fleaBay last year but apparently you don’t get a lot of quality for $12. Surprise…

I’d read that the 5mp cameras with a 50-500x magnification and controllable LED lighting are the best way to view your stuff, so, I ordered a USB microscope:

USB Microscope

Of course when it showed up, the first of note was the total lack of Mac support. There was a MINI CDROM for Windows though and I did manage to install that in VMWare Fusion under WinXP to make sure the thing worked. The software is sort of “iffy” though with a non-intuitive interface. But then I find my Windows application tend to look cartoonish and sport functions they don’t explain. Anywhere, including the “Help” menu. Begs the question of why put in a Help menu in the first place.

For the Mac, there are some software choices, none of which I could find that take advantage of the two push buttons on the microscope. Namely SNAP and ZOOM. I was sort of disappointed until, I realized that when you’re hitting those buttons at a high magnification, you shake things. A lot. Thus, they are really kind of useless.

I found that the Macs PhotoBooth and Quicktime could use the “USB Camera” so all wasn’t lost after all. The third party software for the Mac didn’t really appear to have a lot of options I’d use any way.

While this microscope had good clarity and ample zoom, it also had a problem. A flickering set of LED ring lights inside. There is a POT on the cable that allows you to adjust the brightness, hopefully to get a better photo or image. If I wiggled the cable where it went into the microscope head, the lights would flash on and off. Like an intermittent connection. Not good.

I naturally contacted the eBay seller who offered me $5 to buzz off. Or ship it back at my expense (about half of what I paid for the scope). Eventually we settled on a higher amount and I thought I’d just build my own LED lighting for it.

This thought lasted an entire afternoon. Indeed. It bugged me. So, rather than leave things alone, I ripped it apart to see what the problem was.

I started by taking apart the pot that controlled the LED brightness. Not much to it.

IMG 4559

Getting the main unit apart. I got the silver ring off first (it’s around the unit by the Snap switch in the first image). Once I got that off, the end with the cable in it is sort of glue welded and it was easy to pry off the cable end.

IMG 4560

There was a metal clip that looked like it was trying to cut the cable in half that I removed. You can see the indentation in the cable. I used a zip tie to replace it. When I wriggled those wires the LED’s would flash. I thought it might be the main board or something so I started to look inside:

IMG 4562

I thought Behringer was the only company that used glue to hold little pieces in place. Nope. The blue and yellow wires are from the POT. I checked as best as I could for a bad connection but couldn’t find one.

It was when I started to look closely at the pot, I found the Blue wire was a cold solder joint. I resoldered both connections anyway and now it works just fine.

I put it all back together, used the Handyman’s Secret Weapon to hold the cap on (duct tape).

Previously I said that using the buttons on the unit are pointless because you shake too much (or I do). The best way to do it is to set it up on it’s El Cheapo stand, prefocus it, then slide a printed circuit board underneath the lens and don’t touch the microscope at all. The Mac Quicktime application works better than the PhotoBooth one. In PhotoBooth images are flipped and reversed.

My advice if you get one of these, see if you can find one with a VERY sturdy stand. I’m going to make a stand for mine out of wood. That will hold it very steady. And really that’s about all you need. It actually works quite well and the LED’s brightness control is very handy.

26
Feb

Ford SXT Box Lighting

My brother has a fabulous looking black Ford F-150 SXT. He put a tonneau cover (black) on the box to keep things dry and the side effect was that, at night, it’s next to impossible to see anything inside.

Which makes him unhappy:

IMG 4524

So you either get used to packing a flashlight around in your pocket (or are you just happy to see me?), or he calls his older LED fanatic brother and asks, “Whatcha got to fix this?”

I started sleuthing fleaBay (where else) and found scads of LED strip lights. However, one of the requirements was that the LED’s had to be battery operated. There’s a few companies that sell strip lighting strictly for truck boxes but it’s silly expensive in my opinion. I do have to admit they did steer me in the right direction.

What I saw was the great majority of the installs used three double A battery packs. So about 5.25V with fresh batteries, at about 4.5VDC the LED’s probably won’t work well. Typical draw is 16ma per LED. Thus if you put a lot of LED’s on a 3 cell battery pack, you get less battery life and perhaps not a lot more light either. Fine line.

Oddly enough, 5VDC LED strip lights are rare. I found one or two sellers on eBay that offered them. The seller I ordered them from advertised two lengths both with a USB cable for supplying power to them. One strip is 1.65ft, the other 6.6ft. The USB cable is almost 5ft itself. Which turned out handy later on.

LED USB

I chose the 6.6ft strip because it’s better to have too many than not enough. About $18 USD.

When they finally arrived in the mail, they were waterproof and unlike other waterproof ones I’d ordered, they didn’t stink because of the waterproof coating. Well, not too badly anyway. It went away in a few hours.


WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!

I almost plugged in the string to the USB port on my computer to see if they worked. I say almost because I had a moment of devine intervention telling me NOT to do that!

Instead I plugged them into my home built 5V bench supply that I have a panel of USB connectors on. It can supply 5A at 5VDC through the USB connectors and I have an ammeter on the output to see what the current draw is. A 6.6ft string of these 5050 LED’s pulls 1.65A!

A stock USB port couldn’t supply that kind of current. Max for those, and that’s iffy, is 500ma. Closer to 350-400ma in my experience.

When I looked up the 1.6ft strips the same seller had, I found it used 350ma. So it would be okay to run from USB, but not the 6.6ft!

For a battery box, I decided that I’d use a 4xAA size and modify it. I made it a 3 cell holder and the fourth cell area would be for the switch:

IMG 4523

The switch is a SPDT, 10A and I use one of my helicopter JST battery power connectors so I can disconnect the batteries from the LED’s to change the batteries. The important part is the switch fits right inside the battery pack itself.

We’d decided that we were going to mount the battery pack and LED’s on the plastic box liner itself. Close to the back so it’s easy to reach. I used automotive double sided tape to stick the battery box and the LED’s. True the LED’s come with tape, but the red automotive stuff I use sticks better I believe.

IMG 4526

Where the battery and LED’s are mounted it under the tonneau cover so they stay dry. And even if corrosion sets in, the battery box is under a couple of bucks to replace. We put strips on BOTH sides at the back so it wouldn’t matter which side you were on, there is a set of lights there. Turn on both sets if he needs it.

In operation:

IMG 4527

If you’re counting, there are 12 LED’s and at 16ma per LED, that’s 192ma. The batteries aren’t going to go dead in 10 minutes.

So what’s the illumination like? Well that’s the surprising part. We tested it in the garage at night and it didn’t really seem that bright. Even when I turned off the ceiling lights in the garage it was sort of meagre at best. BUT when we moved the truck outside where there is little to no light, our eyes adjusted to the darkness. When we flipped the LED’s on both sides, HUGE bright inside! Thus, the darker outside, the better!

So what looked like a cave, is now lit up quite nicely:

IMG 4531

The other area that’s dark in the truck is the rear passenger area. The dome light is too far forward to adequately light the rear seats and floor. If you drop something on the floor back there, check for it the next day when the sun comes up. Or find a flashlight.

Since I still had the LED strip with the USB connector attached, and the Ford has a USB plug on the dash, we started looking at using it.

I wish I’d have taken a photo of it, but on the console, there is a rear drink tray that folds down for the rear passengers. Under the tray (it sits right on the floor) there is a recess that’s about 1/2″ high and 9 inches long. I trimmed down the string of LED’s to fit in this recess, ran the cable under the front seats to the dash. The rear LED’s draw 96ma (6 LED’s).

We got a 12V/USB power switch adapter than fits in the cigarette lighter and with a simple flip of a switch, the LED’s light up the whole rear floor area. Works really slick. The drink tray still works the same and doesn’t interfere with anything. Plus even with it down, the LED’s still flood light out on the floor.

All in all, a very illuminating evening with my brother.

18
Feb

ArduWalk

I was taking the garbage out to the road the other night. Course it was one of those cold, rainy, dark nights that occupy much of the winter in our area. The back of the house in the middle has a motion detector outdoor light as does the side middle of the house.

However, those two lights don’t do anything to light up the back corner of the house where the gate is. So it’s a pain to navigate around out there in the dark.

Which of course got me to, well, thinking. I have lots of LED strip lights. Unfortunately, non-waterproof ones as it turns out. I did some rough calculations and I decided I needed two 15 foot strips of water proof LED’s. I didn’t want to have to dig up anything around the sidewalk or put in those silly solar lights on a pole. I’d probably rip those out out the first time I used the weed whacker.

I noticed that where the side walk is darkest there are two bays that over hang the sidewalk. One is for the family room window, the other is for the fireplace. In both cases, neither go all the way down to the sidewalk. My plan, at this point, is to build a subframe under the bay portions and attach the LED strips to that frame. Thus, the LED’s are on order.

Next up, I needed to light them. According to the spec’s of the LED’s, about 12V at 10A. I immediately thought of one of those computer type power supplies. I found a reasonably priced 12V 15A switching power supply on eBay and that’s on order.

Which left, how best to control the lights. I looked at some timers, and then I figured I’d be out there setting the time that I want them to come on and go off. The time to shut off is not a big deal really. But the on time is because in the summer it’s daylight until 10pm. Who needs lights to come on at 5pm. Whereas in December, at 4:30pm it’s already dark. Thus, the timer was out.

I then looked at the dusk to dawn controllers. Kind of pricey little guys aren’t they. My experience with them is that I’d rather not use them.

Then I remember my house address lights. Those come on at sunset, go out at sunrise. And, yes, they are run by, no less than, an Arduino with a GPS and transmitter. Since that master GPS clock transmits the date information around the house, I decided to use its date and time and forego putting in a RTC chip. But I could have used an RTC.

I also thought I’d use one of my Arduino Pro Mini’s so, I coupled it with a relay board, RF transceiver (for the GPS signal from my TimeMate), LCD display, and rotary encoder. I modified a basic sketch from my GarbageMate and I was up and running.

IMG 4509

While I could have had the lights stay on all night (until sunrise), I decided that I’d put in a stop time setting, so that’s what the rotary encoder does. I can set the hours and the minutes to shut off.

Which is the point where I ran into the first snag. For the rotary encoder to be useful, it needs an interrupt routine. I was using the “Encoder.h” and “SoftwareSerial.h” libraries and that wasn’t going to happen. I got redefined vector’s. True, I could have used the transceiver on pins 0 and 1 as the normal serial port, but this is a pain if you do code updates because it overlays the normal serial port from USB.

The solution was found at PJRC. Obviously they’ve had the same problem with SoftwareSerial, so they came up with AltSoftSerial. Safe to say with the rotary encoder library “Rotary.h” it works like a champ.

The relay board is just a standard 5V shield with a 10A relay. If it burns out, it’s cheap enough to replace. The Arduino MINI Pro has no USB port, I use a CP2102 breakout shield to program it.

The control unit, is going to be mounted in the crawl space with a single cable leading outside to the LED’s. A nice small project box would be next on my list.

IMG 4510

Inside the left edge of the box is a DC-DC buck converter. I use scads of these things for Arduino projects because they will take the 7-12DC input and drop it down to the 5V the Arduino needs (at a couple of amps too). Then progressing clockwise around the inside of the box, MINI Pro (328/5V), CC1101 serial transceiver, and relay board. The rotary encoder is sitting outside the box on the right.

I use a terminal block on the outside for the connections in, and out of the box.

IMG 4511

For mounting, I don’t screw in the shields. I use an automotive brand double sided tape (it’s red in colour). I used to use foam tape but it’s not as good. The automotive stuff sets up within a day, and while you can still peel it off, it sticks great. I use multiple layers so the solder connections on the bottom of the boards don’t interfere.

Wired up it now looks like this inside:

IMG 4513

Love those Dupont wire cables. For testing I use my 12VDC bench power supply.

Rather than leave a plain aluminum faceplate, I use Rayven Repo Film through a colour laser printer to create something a little more colourful.

ArduWalk

The left arrow indicates it’s DST time (important to know if you want to calculate sunset and sunrise). The “*” shows that the outdoor lights are ON. I.e. sunset is 5:30pm and the current time is 10:26pm so the LED’s are on for the sidewalk. The sketch checks the time every minute and will shut off the LED’s when the trigger time matches.

I’ve included the sketch with this posting so feel free to use it to create your own ArduWalk. Or whatever you need. That’s what Arduino’s are all about.

24
Jan

PMPO – Peak Music Phantom Output

Having a signal generator on the test bench helps with trouble shooting some of the audio circuits I assemble from time to time, but it would be nice to have a signal tracer as well. As in audio signal tracer.

Initially I had the idea that I’d assemble a token amp around one of those low power TDA chip amps. However when I started to cost out the plan with a case, pots, parts and so on, I thought I’d better check out the “other” source.

Of course, what better source for mislabeled widgets than the eBay supported off shore market. I didn’t need anything with a whack of output power, actually didn’t even need stereo inputs.

I immediately found a plethora of these styles of “iPod” amps for the low cost of about two Starbucks lattes:

IMG 4499

This thing is a MA-170. Whatever that’s supposed to infer. Digital Cinema Sound or DCS (darn cheap sound). Looking at the photos of the rear I found it looked like most of those car stereo power amps:

IMG 4500

Both the back of the amp and the eBay listing claimed this was a 2 x 100 watt amp. Which, incidentally, you could run off a 12VDC 2A wall wart. There was no familiar and standard RMS rating, just this PMPO moniker.

PMPO stands for Peak Music Power Output. It’s supposed to be a measurement of the peak power you could get from the amp in ms (milliseconds). Which is a pretty useless figure because even the shortest musical note lasts longer than the allotted PMPO measurement time. So, write down any number you like. It doesn’t mean squat any way.

You can also lump PMPO in with PEP (peak envelope power), amp ratings in IEC (Behringer used to do this a lot). Folks, if it doesn’t say R.M.S., you have no idea what it is.

If you’ve ever done anything with car stereo power amps or probably any amp at all, you’d probably already know that a 12V 2A supply isn’t going to generate 200 watts of anything. Except maybe warmth when it goes up in smoke.

Of course I knew this going in, but hey, I wanted a budget amp, so that’s exactly what I expected. And got.

When the box finally showed up, it listed the actual specifications on the side of the box. It clearly said, “2 x 4 Watts RMS”. Obviously a slightly smaller, and more realistic number than the 2 x 100 claimed elsewhere.

I contacted the seller and suggested their listing facts were incorrect. No, I didn’t outright say they were lying, I was actually quite nice and gently suggested they update their listing with the accurate information. To my efforts I received a reply that the box was “just any old box” they used for shipping and had no bearing on the contents. Considering the artwork and specs printed on the box were an obvious match for the contents, ya, they were lying.

Therefore, as Dave Jones from the EEVBlog says, “don’t turn it on, take it apart.”. I did.

IMG 4501

Removing the front splined knobs was the first trick. I swear someone must have pounded them on with a sledgehammer. I have a special tool for removing knobs on guitars without leaving scratches and there was zero clearance under these knobs to even use it. I pried the crap out of them with a screw driver then took off the four front mounting screws.

IMG 4502

You can just see an LED to the left of the volume pot, it lights up the translucent ring to show power is on and maybe, smoke to follow…

On the extreme right edge you can see the TAD chip “clamped” to the wall of the case.

IMG 4503

Slotted holes to allow for some “wiggle” room of course. You have to unscrew those two screws, let the clamp plate fall inside the housing to get the thing apart. Because the TDA chip doesn’t fit tight against the casing of the box, they put an aluminum spacer in there. Something else to contend with when you reassemble it.

IMG 4504

Looking at the PCB, there are as many jumpers as there are components. The 4558D op amp for preamp/tone controls, and the TDA chip on the right edge. That stuff that looks like silicon grease on the TDA chip isn’t. It’s silicon. Off shore construction seems to have found more uses for hot melt glue and silicon than Red Green has for duct tape.

IMG 4505

If you had to scratch build this circuit, it would cost more than buying the whole thing as is. So in that respect it’s kind of nice.

However the fact remains that the TDA is a TDA7266sa chip. An obsolete chip and its data sheet says 2 x 7 watt. Even the data sheet doesn’t say 7 watts RMS, PEP or PMPO. Nope, just 2 x7 watts. So you roughly figure RMS is about .707 times the power, well, surprise. You get 4 watts.

When I pointed all these facts out to the eBay seller, well, apparently I am invisible. I am quite happy with the price I paid and the product I got. But trying to pass a scooter off as a Harley is never going to work for me.

17
Dec

iPowerCentral

Seems the wife and go through the same thing this time of year. You know, decorating for Christmas. One feature includes all the indoor lights. I put some around the main entrance into the living room, the tree, around the dinning room hutch, and over the living room window.

Last year I got smart and went to Home Depot and picked up a remote power switch so we could at least control the tree lights without crawling around under it looking for the outlet or the “handy” switch on the power cord.

I happened to be sleuthing through eBay and found a listing for these something called: ALEKO® RLS3 WIRELESS REMOTE CONTROL AC POWER OUTLET 110V PLUG SWITCH OUTLET

In a three pack for less than I paid for the one last year. BIG WIN! I immediately ordered them (buy it now), and had them within five days. Turns out they weren’t shipped from HK, USA or Europe, they came from Alberta (I’m in BC) so, 15 hours away. If the crow has a car to drive.

ALEKO

Notice there are buttons labeled 1-4 and then ALL OFF, ALL ON. But you only receive THREE remote outlets. Made in China. Some ting wong…

No idea why they don’t sell the whole thing in a pack of four, but they don’t.

Any way, they work perfect and the remote works throughout the entire house from furthest points. I even put on on a lamp behind the sofa since it’s an awkward place to get to. So all was well. Til the mind started working…

See, it’s, “Where I’d leave that remote?” or I’m in bed and “Did I turn off all the lights?” or something equally earth shaking. I remember reading something in the Arduino forum about 433mHz control so I decided to see what frequency I was dealing with. I’d bought one of these from eBay so I tried it out:

Freq

Turns out the one I got last year from Home Depot uses 305Mhz, but the NEW ALEKO one uses…433mHz. Ah ha! Maybe, just maybe.

I surfed around and came across an Arduino library for Remote Control Switches. I’m using the 2.5.1 library. I have some of these 433Mhz transmitter and receiver modules from eBay:

433Mhz

So I connected up the receiver, uploaded a receiver sniffer sketch in the examples folder to an Arduino UNO and pressed the remote. The sound of my jaw hitting the floor was deafening. Son of a gun, it worked. I wrote down the number, disconnected the receiver and connected the transmitter, used the sample sketch to “send” an ON and OFF code to one or my remotes. Nothing. And then it occurred to me. Wonder what the range was on these things?

I connected the receiver back up, ran the sniffer sketch again. Did a range check. 30 feet. Max. No walls, no floors. Wait a second, there is no antenna in these things. Hum.

Antenna

I quickly found two antenna’s, soldered them onto the boards. Did the receive test again, easily captured the signal within the house. So I switched to the transmitter and easily controlled all of the outlets from a simple test sketch.

With the brain running at mach 6, I decided that I’d put an ethernet shield on the UNO, write in a web server sketch and that way I could control the remote outlets from anywhere on my LAN. So I did. I hard coded the IP so I wouldn’t have to go looking for it. But it worked well.

As I glanced over at my spare parts box, I could see a DS3231 RTC and unused LCD display.

DS3231

Both running off the I2C interface. I added them to the project. No, I didn’t need a clock or LCD display, but my project was expanding so…

IMG 4328

I re-purposed a project box from a prior experiment (used to be my GarbageMate), and although I don’t use the LED lights, well, it looks pretty. The LCD display is different than most you’ll see. It’s actually GREEN letters on a black background. Whereas most are the other way around. These are from an eBay seller called “WideHK” but the library they provide is so old it won’t compile on Arduino 1.0 or newer.

For those who have a WIDE.HK LCD display, you can download my Arduino Library from here:

LCDI2C4Bit MCP23008 Library

Next up, I decided that I should put in scheduling for the switches. I downloaded the Arduino AlarmTime library. Evidently I’m challenged because after a lot of attempts to get it to work, it wouldn’t. No way. The examples worked, but when I added them to my own sketch, no soap.

Of course I could have sat there and tried to figure out why, but I’ve been programming for 30+ years so rolling my own would be easier in the long run. I wrote the time checks, web interface, handled the input from the browsers, parsed to extract the info I wanted and it works.

IPowerCentral

There are the buttons to turn on and off the remote outlets, plus ALL on or off and, yep, three schedules for the switches. The Disabled means that schedule is OFF not that the switch is disabled.

To set a schedule, just typing in the data and pressing the Submit button. The time does have to be in 24Hr format but that’s not a big deal. My sketch deals with Daylight Savings Time so even that is taken care of.

IPCsetting

I can also set the clock using this method (custom switch number). Once the data is submitted, the screen will refresh and you can see the schedules I’ve programmed in.

IPCresult

For the astute, you may notice that I have slightly different start and end times for the schedules. What I found in testing was that if I sent out too many codes in a short period of time, the remote outlets tended to miss the second or third one. But adding a minute (could have been seconds probably) took care of this completely.

Since the remote outlets lack any ability to report back to the main control to indicate if they are on or off, the Arduino has no way of knowing the state of any outlet.

At this point, it works pretty slick. The only future addition would be writing the schedule settings to EEPROM. That way even with the power outage, the schedules will remain intact. So that’s about the only thing left for another day.

Yea, Arduinos. What a hoot.

27
Nov

iBarometer

The single most addicting thing I have on my work bench is…wait for it…an Arduino.

MEGA, UNO, and MINIPro just unleash the TinkerToy complex in me. I feel like Simon Bar Sinister. That’ll give you something to mull over.

Since I’m an avid golfer, I’m also a sucker for weather stations. I have two AcuRite’s, and recently just bought a third, er I mean turd. Say what?

That’s right. As far as I’m concerned, it’s a turd. But it’s a trending turd I’m seeing so…The one I purchased is this one, ACU-RITE® 0135CCDI:

ACU RITE® 0135CCDI

Comes with AC adapter, screen is always on so you can see it (you can turn it off), according to the package it connects to your “pc” and you can read the data on your computer or your iPad, iPhone. Since the fine print required my glasses that I did not bring, I couldn’t read the print that said, “Windows”. Don’t you hate fine print.

Thus, I don’t have “Windows”. I have five Macs. At any rate, I’ll explain how the “magic” works, because I downloaded and read the manual before becoming throughly disgusted and returning it.

AcuLink System Requirements: PC with always-on Internet. Mobile device with app access (optional).

You need Windows, the main weather station connects to Windows via USB. Your computer must be POWERED ON 24/7 to read the data and then sent to a web site (maybe AcuRite’s web site, I didn’t bother looking) where you sign up for an account. When you want to read the data with your iPad or iPhone, you log onto the “web” page and read the data.

So apart from the fact you need a Windows computer, on 24/7, you don’t actually connect to your own LAN to read the data with a mobile device. You wander out on the world wide wait to do it.

Ask yourself WHY would they do this?

The answer I think is, cost. They can hire any number of minions (apologies to Gru) who can write Win code to parse the data or just send it to the remote server. There after the data is stored in some SQL database. When you connect to said web server, the host then serves your data.

Because first off, your bandwidth doesn’t cost them any money and second everyone knows leaving a computer on 24/7 is energy responsible.

I can think of any number of ways that this would have been better implemented, apparently AcuRite doesn’t have that forward vision. Not exactly a progressive bunch of thinkers there.

If at some point in the future AcuRite decides they can charge you to use “their” service, hey, you supported them by purchasing their product, so like any good politician they’ll assume they have the mandate to do whatever they want.

An energy conscious person might decide that leaving a PC on 24/7 is not the best use of energy nor is it free. AcuRite has the solution for this in their AcuLink Internet Bridge. Which they sell you for about the same price as the weather station. Yep, requires an always on internet, still sends it to their site. Big whoop.

The paranoid may like the idea of Acurite handling the data since they can send you “weather alerts”. Because you know that the AcuRite weather alerts are going to be more accurate than anything you hear on the local TV or radio stations. Big whoop x 2.

As I said, this is a trend I see in a number of new devices that I don’t like. No, not the fact you need Windows, the fact that you need an always on internet connection and someone else manages your data. Maybe their idea is to use your data to create the most accurate and awesome weather station the world has ever seen. That’d be the control fetish of the century.

There’s been a number of people who have successfully decoded the Manchester encoding from various weather stations and as far as I know AcuRite doesn’t publish their protocol. You know, because of that control fetish they have. I briefly considered going that route and getting a station that had been decoded. But where’s the fun in that.

So out came the Arduino MEGA2560, DS3231 RTC, a BMP085 barometer and a ColdTears 5″ TFT display with matching shield. This is NOT an economical project. Matter of fact I wouldn’t really advise anyone other than a dyed in the wool tinkerer with doing it.

Having said that, I did it any way because I have that many spare pieces in my parts bins. The DS3231 and BMP085 are standard I2C devices and I have them wired together and they play nice together.

I added one of my Bluetooth HC-05’s so I can connect to the station and do minor programming changes on it (like setting the clock/date or something), or get a CVS listing of the previous 24 hour pressure readings.

IMG 4262

The Coldtears 5″ display is 800 x 400, and the two reasons I use it is that first it’s BIG, second is that it has a font IC in flash ram on board with eight or so different fonts. So I don’t need any software fonts, I just use the built in ones.

So this is what the display looks like:

IMG 4259

I hard coded the lat and long for the sunrise, sunset calculation. I record inHG/mBars from 900 to 1100. If it goes above or below those, well, that should prove to be interesting. I save the full results from the past 24hrs, and every three hours I check for rising, falling or steady. The icon at the top right will change based on the rate of change in that three hour span.

The graphics are stored on a 1GB MicroSD card on the display.

I’m still trying to figure out weather “prediction”. Acurite seems to have some small degree of success with that in spite of the fact that it is nothing more than a best guess.

And while I’m taking AcuRite to the task, I have two identical AcuRite units outside here. One is in the front yard, one is in the back. They are 4 feet of elevation different. Neither one agrees with the other on barometric pressure. The one in the front reads 29.91, the one in the back reads 29.97, my BMP085 is reading 29.86.

I suspect it has something to do with the altitude correction. There is no way to set the altitude on these barometers so I think it takes a flaming guess at it and “adjusts” itself based on the temp or carrot production. Some where. Is it right? No idea.

What I found was you really want to see the trend and having a weather prediction would be nice but not critical. And to put a nail in that, according to my back yard barometer it’s going to rain, the front yard one says mix of sun and cloud. Gee, does that sound like the weather report you get on TV? I think they have 60 different words or phrases to describe rain.

Ultimately, if you really want to predict weather with any degree of success, it’s going to take a lot more than a backyard weather station. Like maybe a satellite photo or two. Or wait a few years until enough people use AcuRite stations so they can do an “Our Man Flint” weather control scheme.

26
Nov

Get the LED out

Sitting around today with a wicked sinus cold, the postie delivered some LED lights, GU10 and MR16’s that I’d ordered from FleaBay. I’d ordered some before but the market has changed slightly on these so it was time to try something new.

What’s new? It’s the word to describe that fluffy white stuff on the ground at Christmas when you have a head cold. Alright, that was Canuck humour. Sorry if you didn’t get it. Or not. Blame it on my sinus…

Scanning through the LED home lighting bulbs on eBay is like wiping your butt with a hoop. There’s simply no end to it. Every seller has a listing that claims they sell the best product. There’s more total Lumens in those listings than the sun emits in a decade or so.

In my opinion, almost every one of these sellers also has an over productive fantasy life. Roughly on par with the honesty you’d expect at a used car lot. Psst, hey sonny, have I got a deal for you…

If you’ve been following my past observations, er rants, you’ll know that I was trying to find an LED light that actually worked to replace those light emitting energy furnaces called Halogens.

Some of you correctly ascertained that I’m an idiot for doing so. And you’d be 100% correct. But since when did being stupid ever stop anyone from trying to reach a goal? Be a lot less YouTube video’s labeled “fail” if that were the case wouldn’t it? Where’s the fun in that?

So I’ll press on here for your enlightenment.

Last year I saw the emergence of 3 WATT CREE (okay, the sellers said they were CREE but you and I know better don’t we). Various sellers jumped on the LED bandwagon and suddenly we had 3, 6, 9, 12 watt “CREE” LED replacement bulbs to fit GU10, MR16 and E27.

The part they kind of glossed over was the fact that these LED’s were all using 3 WATT LED’s and multiple units to give the wattage. In front of the LED’s was a prefocused piece of plastic, to spread out the beam, which they don’t do very well (25 degrees maybe). They were claiming 600-800 lumens. Sure.

The second part they glossed over was that as the wattage of the LED’s went up, so did the length of the bulb. A lot.

A standard halogen is roughly 2″ x 2″. That’s round and length. The LED’s I got all all 2″ round but 5W LED’s are 2.5″ long. If you have a nice holder that has no wiggle room for the extra length (makes you ask yourself why it doesn’t because all the heat should go someplace; halogens are 300C on the bulb surface), these long LED’s are not really an option. What I found is that most ceiling pot lamps have ample room for putting in the 2.5″ LED 5 WATT bulbs. Not a chance with the 12W LED’s.

So what happens when you leave them in for a while? Well, since they do run hot and you might get less than stellar construction:

IMG 4255

What happened to this one? Well, I guess it liked the socket so much that it kind of fused itself in there and then when I tried to pull it out, the three plastic “rivets” simply broke off from being exposed to the heat over time (I’ve had them for almost a year).

So my first advice, apart from the fact this one of the 3 x 3W CREE jobs that runs HOT (54C), don’t EVER try to take one of these out when it’s powered on. That’s a big aluminum heat sink, conductive and you will do the AC short circuit dance if touches the hot terminal. Trust me, your life is worth more than a $9 LED bulb.

Runs hot you say? It’s LED it shouldn’t run hot…well, it does. I grabbed my IR probe and measured a bunch of different LED’s (the multi-CREE ones). 50C to 59C was the range. So yea, hot. No touchy.

The new generation of LED is the COB, or chip on board LED’s. Supposed to be brighter, better beam spread, and run cooler.

Being the LED daredevil that I am, I ordered from two unrelated eBay sellers (actually I have no clue if they’re related or not), first a 5W LED:

LED5W

And then a 12W uber bright LED:

LED12W

You’ll notice that the 12W version has a hole through the center. No, I don’t know why. Maybe that’s were the LED baker crawled out. Beam angle spread on these is supposed to be 100+ degrees. Closer to about 70 would be my measurement. Lumens on the 12W are supposed to be 700+. The 5W is 450 lumens. I’m going with the 5W seller because it’s closer based on my light meter and a pair of 50W halogens I replaced with them.

Now, about lumens, or the endless search of. If you have one of those “light meters” from FleaBay and it reads lux and FC, keep in mind that 320-500 LUX is about the same level as average office lighting. So lay your meter down where you want the light and measure it. Don’t stick it up next to the bulb and say, “Wow that’s super bright!”

The further the light has to travel, the more it spreads out and gets darker.

Notice that both bulbs have reflectors inside to spread the light. LED lighting is naturally very focused. Think of a flashlight. How much light actually reflects behind it? Now look at your typical tungsten bulb. The light comes from all over and it’s a source of heat. The light will reflect off the walls, ceiling, floor, grandpas bald head and so on.

Heat? Ah yea. Remember when those CFL environmentally unfriendly things were pimped like the neighbourhood kids ride? Sure you got “light”, and there’s some question about the amount of light, but what you lost was heat. On your typical tungsten bulb, 90% of the energy consumed is converted to heat. Ever stand under a halogen ceiling light? Toasty. And of course, nice in the winter, not so wanted in the summer. So it’s a good thing we don’t need lights as much in the summer. Isn’t it?

And lastly, lets go to “temperature”. Yes there is a lighting temperature. Cool white is 5500-6000K, warm white is 2700-3000K (note that both of these will vary so it’s just for a comparison here). There is a new light that’s about 4000K that they call “natural” light. 4800K is direct sunlight.

All of these LED bulbs tend to vary. The warm will look like a tungsten, the cool will look blueish to you.

I grabbed my IR meter and tested the 5W vs the 12W temps. 5W came in a 43C, the 12W came in at 54C. The 5W reflectors seem MUCH better built than the 12W versions. No, I didn’t rip one apart to verify that. But when I was changing lights I was muscling the 5W versions pretty good and they stood up. The 12W felt less “solid” to me.

We decided to replace the three halogens above the fireplace with three cool white LED’s. The halogens were connected to a Leviton Mural dimmer:

Mural Dimmer

With this dimmer you can set the amount of brightness that the lights will go up to when you switch them on and they will gently fade out when you turn them off. Which brings up some interesting things we found out today…

I’d replaced TWO of the three halogen bulbs with LED’s and then I disconnected the third halogen bulb the two LED’s started to flash about once a second. Looked like an Arduino “blink” sketch. if I reconnected the halogen, the LED’s stopped flashing. Tells me that the dimmer circuit needs to detect some feedback current to keep itself off, or it “fires”. The LED’s won’t do that. So even when the dimmer is “off” there’s some residual juice being used.

The LED’s I’d installed were NOT the ones than can be dimmed. So perhaps this would have made a difference.

At any rate the halogens were didn’t really do much for the painting on the wall, nor did they spread out far enough to even cover it. The cool white 5W LED’s were far better.

IMG 4253

Evidently the wife has always hated these “dimmer” switches we put in when we rebuilt the kitchen a few years back, so I replaced the other dimmer that ran the kitchen 5″ halogen pot lights. Whoa. First thing, with a standard ON/OFF switch the halogen are significantly brighter.

Which lead me to assume that regardless of the setting on the Leviton dimmers, there is no way to set them for maximum during a fade up. When I checked the Leviton manual, you have to double tap the top to get full brightness, or double tap the bottom to get a fast off. Sheesh.

None the less, no more tappy, and really some of the halogens you want full on any way. Not sure why we even put in dimmers.

I then took two LED’s and put them over the sink (wife said standing under the halogens was toasty on the noggin’). Here’s what they look like:

IMG 4258

The LED’s 5W again, disperse the light (warm white) and are not as focused as the halogens. She’s a happy camper now. Depending, I might change the 5W cool whites over the fireplace to warm white.

The work bench area has nine 12W LED lights now on a track light system, four are pointed down directly over the bench, the others spread around the room. So in the photo, that’s warm white on the right, cool white on the left.

IMG 4251

So what used to use 450 watts of power to light the room, now uses 108 watts. That’s a significant reduction in power. And heat.

Note that all of the photos were taken with no flash. Just the available light from the LED’s. When I checked the bench with my LUX meter, I read from 360 to 490 on the top of the bench. And it seems like ample light, for a change. With the halogens, I didn’t measure the light at the bench, but I can say that I NEVER needed any heat on in the room, even in the winter. With the LED’s I do. So maybe…hum, there’s a trade off.

So here’s my observation, for what it’s worth. If you plan on replacing halogens with LED’s, you need COB LED’s, minimum would be 5 WATT units and plan on installing 3 to 5 of them to give yourself the same working light. Keep in mind that there is a large difference in the comfort factor between cool and warm white. The cool white is more clinical.

I measured some of the other house lighting. A standard 4 foot, 2 tube florescent is 400 lux, three CFL’s are barely 200. All measured at bench height from the light source.

The one thing I haven’t mentioned is warranty. This is a $9 LED bulb from Asia via eBay. Really, you can’t use the word warranty and eBay in the same sentence. Lifespan of the bulb is reported to be 50,000 hours. Which you may treat the same as the report of pigs flying.

12
Nov

Rigol DS1052E Upgrade

It was about three years back when I watched Dave Jones from EEVBlog do a rant on an oscilloscope. I’d been thinking of one of those DSO Nano scopes. Dave was driving in his car and doing the scope rant (episode #86) and I guess it struck home because I didn’t buy one. Why? Cause Dave said they were junk.

Dave’s a sharp cookie, much brighter than I’d ever hope to be with electronics, so I was smart enough to avoid those DSO scopes. But I still wanted a scope. I then started looking through some of Daves older posts and found #37 where he talked about a Rigol 1052E.

So I bought one. It’s a great scope, decent software, LOUD fan. And. It. Drives. Me. Nuts.

Then early last year (2012) I found EEVBlog #70. Turn your DS1052E (50Mhz) into a DS1102E (100Mhz). It was all done in software. Turns out the folks at Rigol use pretty much the same motherboard and just apply a software patch to change the model that the scope thinks it is. At that time it needed a Windows computer (it’s all Macs here), some patch files and you could brick the scope if you’re not careful.

I passed on this at the time.

About a month ago, I needed a 100Mhz scope. Wouldn’t you know it.

So back I went and found a huge forum with a LOT of messages about everything from guys who bricked their scopes to guys who it worked perfectly for. Someone even write a special patch that worked via USB so you didn’t have to use a RS232 terminal to do it. I’d installed Windows XP in VMWare’s Fusion on my workbench Mac so…in for a penny…

I read everything I could find first. And there’s some good information on the steps to do it right. I only wanted to do it once. Right. I read, re-read and downloaded all the patches, made sure I understood the order and away I went. Took me about half an hour. And it worked perfectly. No issues at all.

My DS1052E is now a DS1102E. I did the tasks I had to get done with the scope and then…I noticed that I still HATED the fan noise. There’s some amazing products coming out of Asia, simple quiet fans are not one of them. So back to the forums I headed and low and behold, I found a LOT of guys hated that fan. So they swapped them out. Plus did a little work inside the DS1052E to ensure longer life…(heatsink on the 7905 reg).

I found the service manual for the DS1052E and read about how to take it apart. Four screws and some tugging and it comes apart. The screws are on the bottom and under the handle at the top. Typical torx.

IMG 4196

The hardest part is getting the side off that the AC plug is on. The service manual suggests applying FORCE to get it off. I couldn’t find any photos of what it looks like, so here it is.

IMG 4199

You can see the piece laying on the top. That piece is the root of all evil. The case is fit into it rather snugly. The guys I read about were taking the mounting screws out of the AC socket, which then falls inside the power supply. Not a good thing to do in my opinion.

So I did some prying and yanking, as the manual suggests and it actually does come off. When I reassembled mine I left off that little piece. As I see it, it’s purely aesthetic any way.

The fan, well, there’s the hard part. The factory mounted fan is a “GLOFN GFA06015H12H”. That is a 60x60mm running at 5500rpm @12V DC. According to the manufacturers website it has an air flow of 34.2m3/h at 36.5dBA of annoying noise. To save you the effort of conversion, that’s 20.12 CFM. But it sounds like it’s 2000CFM.

IMG 4206

I seen others trying to shoe horn in 80mm fans, fans with reducers, grills cut out and re-drilled, grills enlarged and so on. Some of it not too pretty either.

I wanted to stay with a 60mm fan, but quiet was the order. I checked every company I could find and apparently small quiet fans are hard to find or make, or something. I stumbled across a post who said they used a 60mm Xilence fan that they got from Germany on eBay. So that’s where I started looking and I found one:

Xilence 60mm case fan:

Specifications:

  • Size: 60 x 60 x 12mm
  • Hole-Distance(Diagonal): approx. 66mm
  • Voltage: 12V(7V-13.2V)
  • Fan-Performance: 2100 RPM / 29,7 CFM
  • Bearing Type: Xilence Hydro/Fluid Bearing
  • Noise Level: 22dB
  • Plug: 3-Pin Molex Connector(Mainboard)

So not only more quiet, but better flow rate too. Bonus. Best $13 CDN I spent in a while.

Before I carry on with the fan and other fix, these are the shots of the insides of the DS1052E power supply.

IMG 4200

Then the left side where the fan is:

IMG 4201

More than just a few guys who’ve done the fan mod have commented on the fact that the 7905 gets hot so the fan helps keep it cool. On the left bottom corner of the photo here you can see the 7905 just standing in a field of capacitors.

The original fan and 7905:

IMG 4202

I had some heat sinks that I use for MOSFETs so I cut one of those down to fit, then I changed the fan. Note it’s a three wire fan I put in, but you only connect the Vcc to it, the blue wire is for the RPM sensor. I just taped it up and left it off. I didn’t leave the heat sink sloped over, I moved to a more upright position so the sink wouldn’t touch the capacitors or the ribbon cable.

New fan heat sink:

IMG 4205

I have to say the scope works amazingly well, rise times are far faster for traces, and the fan is now, finally, at, last, quiet. Ah.. tis heaven.

20
Oct

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.

19
Oct

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.

HD2

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.

10
Oct

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.

31
Aug

Message Board – Parola

As anyone in my family will attest, I’m a sucker for winky blink lights. Thus, you, as the reader, have been forewarned.

I’m an Arduino junkie and of course, winky blink LED’s just HAVE to be done with an Arduino. Those 8×8 LED matrix displays caught my eye last year and I’d put one together that was controlled over the network and was pretty decent. Except that when you had more than four modules connected (32 x 8 LED’s) the scrolling speed went from slow to glacial.

A couple months back I came across this video that was in the Arduino forum:

The speed of the display was simply amazing, and of course, I had to research it all out. Turns out the creator is Marco Colli and he has really invested a lot of time and effort it perfecting this project. I decided I’d build a couple of units, 10 displays in each. One for myself, and one for a present.

Early on I knew I was going to make the boxes out of wood. I choose to use birch ply wood that they use for underlay on lino. Nice wood and easy to work with.

The Arduino bits and pieces look like this:

IMG 4037

Then the sheet of birch underlay I cut up on the table saw:

IMG 4038

When I got all the pieces cut up, admittedly there isn’t much too it. I went to a local plastics shop for two pieces of plexiglas for the front display:

IMG 4039

I cut into the 5/16″ birch to give the plexiglas a solid fit and then I test fit all the pieces:

IMG 4040

Of course the wood has markings on it so you know “which way is up”. And by that I mean a lot of markings. The only thing missing to complete the game was the O’s…LOL Any way, out came the Festool sander and just like a magic eraser the “X’s” were gone.

IMG 4041

Putting the box together proved to be harder than I anticipated. My large clamps aren’t really designed for putting together what amounts to a slightly oversize jewellery box. So you just make do with what you have and go for it.

IMG 4045

Boy I love carpenter glue…

The cabinets were made out of birch so a natural Polycrylic finish (gloss) is what I applied. Now if you’re thinking that putting this stuff on was easy, let me straighten you out. If you brush it on, you get bubbles and streaks. Granted you need the right light to see them but when you do, oh my, do they show up. I honestly think you’d be further ahead to try to spray this stuff. Or, put on a coat, sand with 400. Another coat, 600. Another coat, 800. And so on until you get to the point that all you want to do is buff the crap out of it to smooth it out. No, I don’t have that kind of patience.

IMG 4046

Also, the tape I put on the plexiglas to stop the Polycrylic from getting all over it, well, yea. Of course. It leaked. On the bright side, it was a simple little bit of a damp rag and some elbow grease and all was well.

For the Arduino I used a prototype shield and soldered on all male pins because it made using dupont connectors to all the modules easier and more secure. I like easy. I used a Bluetooth HC-05 that acts as the gateway to the module so you can program in the time, effects, and scrolling message. Why not Ethernet? Simple reason is the Parola displays run on the SPI buss and all those WIZNET and ENC ethernet boards don’t like to share the SPI buss with anything.

The drawback is you can’t use an iPhone and a bluetooth terminal program to connect to the project. Apple only connects to BLE (Bluetooth Low Energy). But any laptop or computer with Bluetooth will work. For the time keeping I didn’t use the DS1307 because they aren’t all that accurate. I used a DS3231 and I found those are pretty good.

There was a problem I encountered with the Parola boards though. I’d get junk on the displays at a cold start. So I built a power board for the displays to delay their start time until the Arduino was running. And it worked just fine and if there was still junk, a warm reset always cleared it 100% of the time.

Macro and I have since determined that the INIT code to get these displays running is a little odd. We attribute it to the fact these are no doubt clone chips (MAX7219’s). So I added a single line of code to the library and away we go.

IMG 4054

The finished project from the front:

IMG 4059

And from inside:

IMG 4060

Note on this one I have the power board attached. On the second one I made, I left it out. That’s a DC buck converter to take 9-12V down to 7VDC to feed the Arduino.

Happy to say, they both work like a champ and look very pleasing to the eyes…

29
Aug

GarbageMate Revisited

For the past year and a half we been using the GarbageMate I built up from an Arduino:

IMG 0424

And in that time, there’s always been some confusion about the cans that are supposed to go out to the road. Why? Well the cans are Organic, Recycle and Garbage. The cans are coloured green, blue and black respectively. In my perhaps not so infinite wisdom, I use an orange, red and green LED with the concept being that the first letter of the colour was the can to go out.

Apparently while the concept was okay for me, it consistently confused the wife. Plus it was a blue LCD display that showed the letter of the can as well but it was difficult to read.

I’d been working with TFT displays and they are like little mini-monitors in comparison to the run of the mill monochrome LCD’s for the Arduino. I’d picked up a ColdTears 3.2″ TFT with an adapter shield for the MEGA for another project I was going to build, only to find out that 3.2″ was going to be too small. So I put it back in the parts bin.

So, as Arduino stuff is famous for, I repurposed it to what I hope eventually will be a GarbageMate Pro…

At this moment it’s just sitting and running the modified sketch to be sure it works as expected. If it does, I’ll put it in a case and it’ll be good to go.

IMG 4068

The digital camera doesn’t seem to pick up the TFT screen colours all that well, but those are grey cans with coloured lids (and I wrote on them as well to end all confusion). The graphics are stored on an SD card on the back of the display. Not because I ran out of room in the MEGA’s flash, it’s because there seems to be a bug (or two) in the IDE uploader.

I find I can upload about 70K of sketch. Beyond that, it all uploads but it won’t run. I suspect the 16/32 bit addressing doesn’t compile well in the IDE once you go beyond a certain amount. Thus it’s great to 256K of flash memory to use, but it’s deflating when you can’t even use half of it.

To use one of the TFT displays, the best library you can find for it will be Henning Karlsen’s. Incredibly well written, maintained and documented. I’m also using his “tinyFat” library for accessing the SD card on the display.

If there’s a drawback to using the SD card it’s that the library has to be formatted FAT16. Which is a bit of a challenge for me since I run nothing but Mac’s here. Henning’s a Windows and open source advocate so he has an online utility (and stand alone version) for creating graphics to .c or .raw files for use with the Arduino, Due or chipKit.

As a long time Mac programmer I used his online converter a few times before I wrote one that does the same for Mac users and will be posting it on my main web site (whoRAW565). It’s interesting that on the same graphics source file, we come up with different conversions. I suspect it has something to do with the different gamma’s of the Mac and PC world. My output typically looks more saturated.

While I was doing all this I was dismantling some old equipment and came across one of these:

IMG 4070

When I started programming in 1978, I was using a TRS-80 Model 1 16K (Trash80 as the naysayers labeled it). I programmed it in Basic for about 4 months, learning. Then I changed to writing machine code using a couple different editor assemblers and eventually settled on Zeus by Vern Hester.

I wrote Z80 assembler until I finally parted company with the TRS line (Model I, III and IV’s) in 1994. In those early years I wrote columns for 80 Micro and a lot of software. The most successful of the lot was my Fast80 BBS (bulletin Board System) and my FastTerm (terminal software with VT100 support). All text based of course and, get ready for it…DIAL UP MODEMS…in those days, but the BBS was doing “email” much the same way the internet did it (it could talk to other Fast80 BBS’s). The FastTerm terminal, well, for some unknown reason, guys run TRS80 emulators on their PC’s and still use FastTerm to connect to other systems. Darn near 30 years after I wrote FastTerm, it’s still being used. Now that’s a head snapper.

8
Aug

Arduino Bluetooth HC-05

Continuing along with my quest to find a way to program my scrolling LED matrix and finding the ethernet boards don’t really share the SPI buss all that well, I’d ordered some BT (bluetooth boards). From fleaBay. Where else?

After waiting for the standard “slow boat” from China, I got the modules:

IMG 3982

I’d ordered three boards so they don’t separate them but they do score them so you can break them apart. The bluetooth portion is the little green boards on the top (HC-05), the “break out” board is what they are soldered to. Bluetooth runs off 3.3V, but with some breakout boards you can use 5V since they have a regulator on board. Which is how I ended up with the ones I got.

From what I’ve read (crash course in bluetooth) boards with ODD numbers can be slaves or masters. Boards with even numbers are slaves only. Thus my HC-05 can be a master or slave whereas an HC-06 is strictly a slave.

Wiring these up is pretty brain dead. While a lot of tutorials would have you wire them to the Arduino’s TX/RX pins (D0/D1), I’d caution against that and say use SoftwareSerial. The reason is that D0/D1 are used for the USB communication and having bluetooth on the same pins will foul it up.

The HC-05 has a nice 30 page data sheet. Compared to a module like the HC-06, you have a LOT more control. You know, things to screw up. And because it’s really just serial, reading and writing to it are pretty simple. Hence, at this point, you’re pretty much on your own. Big time.

When you have multiple bluetooth modules, they each have an ID number (hopefully unique), and a name. Course all the names are the same. Royal pain. I spent a couple of days reading the manual to figure out how the modules worked, how you program them and I have to say, there’s a whack of misleading blogs on the net. One even suggested that you had to wire TX–>TX and RX–>RX to program them. Ah, nope.

I paired one with my laptop, opened a terminal program, set 9600, no stop, no parity, and the Bluetooth port and I was talking to the module. Easy as pie (the default password is 1234, whereas on my laptop the default is 0000; little snafu there).

At this point, I knew they worked. And little else. As I said I wanted to rename them so I started down the long rocky road to achieve that.

First off, with these breakout boards (or backplanes if you prefer), you need to add a little bit of wire..

IMG 3984

On the back of the boards you see the usual mjkdz (I’m sure this is an acronym for something). You also see the HC module solder pads (05 or 06) the 3.3V pads (the board normally uses 5V and works fine that way) and the AT terminal. Left floating, the AT terminal is in “running” mode. When you bridge the pads, it puts the HC-05 in AT Command mode.

Here again, things work oddly. When using the HC-05 in running mode, the default baud rate is 9600, no stop, no parity. Short out the AT pads, power up the board and you’re in AT command mode. It MUST be programmed via the RX/TX lines, you can’t do it over wireless.

The catch is in AT mode, you need the serial port setting to be 38400, no stop, no parity.

So I modded my board slightly to make programming it easier.

IMG 3985

Soldered on some pins (bent them to fit). I ended up putting a 10K resistor across the terminals when programming.

Initially I tried using a USB to TTL RS232 converter to program them. For whatever reason I could never get it to work. So what the heck, use the Arduino.

IMG 3986

A lot of reading, trial, error, I finally got it working so I could change parameters (some of them any way; there’s a whack of them on here) and it works just fine.

If you have one of these backplanes and don’t feel like reinventing the wheel, I’m including the Sketch I wrote for programming the HC-05. It’s not overly pretty, kind of a one trick pony really. But it might save you some time so…

28
Jul

ENC28J60 Ethernet Shield

I’ve been working on an LED matrix scrolling sign and it’s working great at this point. However I need a way to change the messages on it.

My first thought was to use SOFT SPI to change my scrolling display and add an ethernet network shield. And yes, that works. It’s also about 10 times slower than hardware SPI for the scrolling sign.

I tried the Wiznet 5100 ethernet card first. And found the bug on the shield where the data lines don’t tri-state. Thus, multiple SPI devices don’t share the SPI bus well.

Then I noticed there’s another ethernet shield, the ENC28J60. According to most it’s dirt cheap but the routines to make the network stuff are all in software whereas that is in the hardware part of the Wiznet chip. But in the name of science or curiosity, I ordered a couple of different configurations of the ENC28J60…

IMG 3904

As the eBay seller advertised, this board is supposed to work with the Arduino UNO or MEGA and they supply a web server sketch. I tried for the better part of an hour to get it working and finally found the current EtherCard library on GitHub:

EtherCard Library

The library seemed to run fine on an UNO with the shield, no way I could get it to run on a MEGA.

After searching all over the net I finally found a reference that you needed to add in the CS parameter (the 53):

Away it went. Sort of…well, okay flaky on the MEGA at best. The sketch the seller supplied was old…way older than the current EtherCard library by three years or so. It was hard coded to use D10-D13 as well. Matter of fact it only ran on Arduino0022, wouldn’t compile on anything newer..I guess in Asia anything that runs, regardless of what or how is a bonus for them.

It was at that point I really started to look at the PCB wiring.

If you look closely, D10 through D13 are used by the SPI bus for the ENC28J60 chip and there’s no connection from the ISP to the ICSP header on either the UNO or MEGA boards. Matter of fact, even if you removed the yellow 6 pin header and put in a female one it wouldn’t match up with the UNO or MEGA header.

There’s also no resistors on the D10-D13 lines so the Arduino is heaving out 5V to a 3.3V chip. I’m going to check the data sheet for the chip and see if that’s going to be an issue or not. According to the data sheet, those data inputs are 5V tolerant. So no limiters needed…

I do have to say though, the ENC28J60 runs DANG HOT. Like I don’t want to leave a finger on it (it feels as warm as the Wiznet chips and I put a heatsink on those). I measured it and it’s 47c but they are rated for 85c. Pretty much a branding iron.

Turn the board over and…same thing. D10-13 are traced back to the ENC28J60:

IMG 3906

Within five minutes of work with an Xacto knife and those traces were gone:

IMG 3907

I flipped it over and did the same on the lettering side of the PCB:

IMG 3910

Now everything was isolated and I could run this shield with an UNO or MEGA. All I had to do was move the jumpers to the proper pins. Thus, as I see it I rescued the boards.

IMG 3911

Any way, after going through all of this, because I could never find out if the ENC28J60 would share an SPI bus with anything else, I found out, it doesn’t. I didn’t waste one second more time on it at this point. Just made a note of this lesson learned.

I have a Bluetooth board on order. I’ve never used BT before but from my understanding it’s just good old fashioned serial. So that’s my next experiment in the near future when it shows up…

6
Jul

EHX DMM

Last year my EHX Deluxe MemoryMan decided that the volume pot had been abused enough and it started to get noisy. Real noisy. And then it just quit. No sound at all. The fact that I rarely used the volume pot indicated these things go through quality control faster than I’d go through last months paycheque.

No, these are built quickly, cheaply and as such are prone to problems.

Note well that I’m talking about the newer DMM’s from about the late 1990’s on. These typically used the Panasonic MN3005 bucket brigade delay chips (and later on MN3008’s). You got about 500ms (if the unit was setup correctly; I doubt many were). The problem was that Panasonic stopped making the chips around 1999. I suspect EHX bought up all they could find and also started using (doubling up) the MN3008’s.

Around 2009, EHX had pretty much exhausted the worlds “reliable” supply of MN300x chips and they came out with a DSP driven unit that didn’t really couldn’t hold a candle to the original. Which means, at exactly that point, the EHX Deluxe Memory Man became a collectors item…and as of now, they can be found on eBay and command premium bucks. For some pretty beat up and ratty looking units I might add.

I found a few schematics online. They cover some of the build variations. I tend to favour this schematic for my EC2002_REV_E unit (2 x MN3005’s):

Memory man schematic

When I first got my DMM (that’s Deluxe Memory Man, not digital multi-meter), I read a lot about the “mods” that people were doing to them. Like changing the op-amps to something a little cleaner. Since the volume control on mine was shot, I decided to cut out the 4558 op-amps and replace them with TL072’s. Reason? The TL072’s are a quieter op-amp and work good for non-over drive signals in my experience. A lot of guys said that I wouldn’t be able to tell the difference in the op-amps, but wow. The TL072’s give a much clearer tone (the 4558’s seems slightly mid-rangy and muddy to my ears) and since clean and clear is what I want, I cut out some of the 4558’s, put in sockets, and installed the TL072’s.

I didn’t change the 4558’s that are in the delay circuit side. I could have, but didn’t.

While I was in there, I also socketed the SA571N. Most of the schematics I’ve seen all use the NE570, but my DMM came with a SA571N. The NE570 is 24V, the SA571N is 18V. Since the circuit runs off 15V, the SA571 had worked fine. My MN3005’s were already socketed, as was the 4047.

The keyword in the last paragraph was “had” worked fine. Yesterday I go into the studio and I have bypass and I have some sound coming through, but I don’t have the DMM echo. It was gone. Turning the BLEND pot to the full “wet” side resulted in silence. Nothing. Oh great. I’d already spent time last year replacing the op-amps and many of the caps (for high quality ones) so who knows. Maybe it blew out a MN3005. In which case, it was only useful as a door stop.

I started signal tracing and it was at the compander (SA571) that I’d lose the signal each time. I popped out the old one, dropped in a spare that I’d bought when I was originally socketing the parts. The echo was back the instant I powered it up.

IMG 3868

And while I was in there, I also added heavy gauge wires on the volume pot lugs to replace the wires that I’d used since last year.

So why’d the SA571N die? Maybe it was a questionable chip that although rated for 18V, didn’t like 15V or there was a spike or who knows. All I know is that it’s once again working and that’s all that mattered.

Earlier this year, I’d been watching eBay for another one, since this is part of my go to sound I have to have one and I found a used one for a reasonable price and bought it. While advertised as in perfect working condition it wasn’t. The vibrato/chorus slide switch was broken and laying inside the unit. I couldn’t figure out why the switch didn’t work until I took it apart and then it was pretty obvious.

Probably unlike most, I didn’t blame the eBay seller and I had it fixed with a new slide switch in a few minutes. No big deal to me since I now have a spare.

I’ve ordered some more spare parts for my DMM (except for the MN3005’s; those are darn near impossible to find, let alone find them at a decent cost). Although my two DMM’s are essentially the same, they do sound significantly different. I’m going to change out the op-amps and replace the caps in the spare one…that should help.

29
May

Balancing Act….with air…

Experimenting with an Arduino usually ends with me travelling down, oh so many, bunny trails. I see a potential, or get a brain wave or just want to find out more about something associated with this intriguing piece of harnessed electrons.

I’m a bit of a weather station junkie so I was trying to figure out a way to get one of my wireless Arduino rigs to communicate with my Acu-Rite Weather Station. This proved to be fairly futile since there’s little published data about the Acu-Rite stations. However as I was learning all this, usually the hard way, I came across a number of people who’d built their own weather stations of bits and pieces. Which of course, lead me to “rain” detectors.

Of course, like all bunny trails, I stayed long enough to decide that rain detectors weren’t as foolproof as just looking out the window and saying, “Yep, raining”..but I then found myself migrating to “air”, another necessary component in a weather station.

Air is a whole different kettle of fish. So to speak. I’d have to build some weather vane thing, then an anemometer to check wind speed, a battery powered Arduino with wireless connections and and and and…well, you get the idea.

So how does one measure “wind”? I’m sure you’ve seen the hand held anemometers on eBay that advertise maximum accuracy, no doubt on some planet other than Earth. So I started to think (dangerous I know), hey I can build one of those. Turns out, it’s a little more difficult when dealing with low volumes of air. But I found one of these at Modern Device:

Wind Sensor

While not a Pitot tube, this is a hot wire anemometer and according to the specs, sensitive to low air flows. Like breathing. To which I can attest. It does pick up a breath from 12″ away.

Something I’ve always wanted to do was try to balance out the forced air from our ducts. Or at least see where the air is all going.

I’d picked up a GLCD from eBay:

GLCD

It’s 3.1″, wired a little different than most of the GLCD’s and I’d originally wanted an I2C version of it. Actually I’m glad I didn’t get an I2C version because this one is FAST at updating. The I2C version is like watching grass grow.

I used a MEGA expansion board for connections to the GLCD:

IMG 3717

I hardwired the contrast POT (a 10 turn trimmer) right onto the GLCD board itself:

IMG 3716

Spent some time writing a sketch to read the “air flow” and then added a DHT11 temp sensor to it:

IMG 3715

Granted the “HVAC Air Balancer” is a bit of an over statement, in line with those eBay wind speed devices, it does allow you to see a comparative reading as I place the sensors over the various ducts. And really, for a budget project like this, it was all I had hoped for.

I still have to put the whole thing in an enclosure and then mount the “probes” but for all purposes it’s done. And darned if it doesn’t actually work pretty good.

It is true that I have no idea on the real air speed or CFM’s or anything else. I’ll wager that someplace someone has some way of calibrating these sensors, adding in a fudge factor and coming out with some fairly decent numbers in that respect.

As an offshoot of the project, because the sensor is very good at sensing minimal air movement, it actually finds draughts extremely well.

All in all, a fun project!

13
May

Logic Analyzer

I have a very good Rigol oscilloscope that I’ve used it many times for working on some of my Arduino projects, but there are times when I need to see what’s going on with an I2C or SPI signal. So I’ve been looking for a logic analyzer for a while.

And of course, I found one on eBay. Big surprise. The bigger surprise? The cost. Under $50. I bought it, the seller sent me a download link for the Mac software which I downloaded and then waited for the analyzer to show up. Which it did.

First thing was that the analyzer was small. As in smaller than a box of matches small. Connect it up and the thing flops around the work bench like a mackerel in a row boat. Some leads came with it, but I soldered some IC leads on the ends to make connections easier.

IMG 3656

I did a quick test of it to make sure it all worked and it worked just fine. But something didn’t sit right in my mind. You can see the label on the analyzer says CH1 to CH8. But the software refers to CH0 to CH7. I started to smell an Asian stinky fish. As in knock off.

It didn’t take too long to find the real Saleae in San Francisco. They make two versions of the logic analyzer, an 8 channel and a 16 channel. The 8 channel looks like this:

Saleae8

It doesn’t take a rocket scientist to see the two units are completely different. So if you see the ones on eBay that say Saleae but look like the first photo, it’s a cheap clone. Does it have all the input protection and specs of the real one? Oh of course it does. Probably. Not. Even. Close.

However, it did allow me to see if I’d even use an analyzer. And I discovered that it was quite useful for SPI and I2C.

I connected it up to an RF1100 board on the SPI pins:

IMG 3652

I selected the SPI buss analyzer in the software and let it capture some data:

IMG 3655

Right off, I could see that the RF1100 was receiving a lot more bytes than what I assumed the other RF1100 was sending. The other RF1100 is a UART driven one and I was sending it a serial packet once a second with the time, date and day of the week. Total of eight bytes.

But in decoding the SPI stream from my SPI RF100, I was getting WAY more data. I glanced at the doc’s for the UART driven RF1100 and it says that I could send a maximum of a 31 bytes. I assumed it was only sending out the bytes I sent. What I found was that it was sending all 31 and a length byte (for a total of 32 bytes).

I expanded the software display:

IMG 3654

I could actually read the “hex & ASCII” data in the stream. Now that’s cool. I could also see all the zero’s that were merely padding in the stream.

The RF1100 UART versions I have don’t say much about how they work, which doesn’t come as much of a surprise because they are from Asia and everyone knows how hit and miss that stuff is. Especially when it comes to anything Arduino.

The only part of the whole thing that frosts my socks is the eBay knock offs that are being sold as Saleae’s. That’s just plain wrong. I’m saving for a real Saleae so if the clone blows up, no loss.

8
May

USB to TTL – Done differently

I’ve purchased a number of RF transceiver modules from eBay and found that while the majority of them worked right from power up, it would be nice to be able to preconfigure them on the computer and then move them to the Arduino.

IMG 3619

I started off by downloading a Windows program that did a configuration but then decided to write my own Mac application to do it. So the first hurdle was that I needed a USB to TTL converter. I had a couple of these:

IMG 3625

Trouble was these “interfaces” and I use that term with some sarcasm, are RS232 but swing +5 not +12 like the old RS232 ones did. I decided to sacrifice one and see what made it tick and, if possible, hack it.

After ripping off the plastic/rubber cover from the DB9 I had this:

IMG 3626

A close up of the main control board:

IMG 3628

It’s easy to see these were made a LONG time ago now (2006) and some off shore warehouse is cleaning out their closet/basement. It don’t cost more than a Starbucks coffee for the USB to Serial converter so I decided to build my own TTL converter and connect it into that interface.

Amassing the two transistors, some resistors and a diode from my parts bin was pretty easy:

IMG 3629

The schematic I used:

TTL

I cross referenced the transistors and ended up using a 2N5401 and 2N5551. Both of those were lower gain than the usual 2N3904/06 switchers you find, but slightly higher gain than the BC557 and BC547.

IMG 3632

The final circuit board with the four lines tagged onto the serial portion, give me TTL switching and a 5V lead. Some of these RF modules require a 3.3V lead so I could have used a regulator to take the 5V down to 3.3 or maybe used three inline diodes in a pinch. Luckily my modules all require 5V.

Any the interface still works perfectly with my RS232 devices and now it also works with my RF modules for programming.

9
Apr

RF TimeMate

Every now and then something comes along for an Arduino that literally leaps off the page at me.

Last year it was a GPS module with Serial output. Adding it to a sketch along with the superbly written TinyGPS library is about as easy as things get. Set the communication to 9600 and wait for the data to show up.

So far the GPS module has been running for months with a clock in my recording studio, a garbage can “reminder” and my garage auto house light for sunset to sunup. None of them has so much as missed a beat regardless of the weather and being indoors…

The downside of these GPS modules is they aren’t exactly economical. However, the reliability out weighs the cost in my opinion.

Which brings to the topic of this blog entry. RF.

First, an admission. When it comes to RF transceivers I’m challenged. I’ve built scads of these things and I think two of them actually worked. I have no issues with any other facet of electronics except this so it’s my Achilles Heel. Big time.

Over the last year or so I’ve experimented with a couple of RF modules for the Arduino. I started with a CC1101 and it’s library, then over to the NRF24L01+ modules with their library. I never managed to get the CC1101 shields to work properly. No soap as they say.

With the NRF24L01+, I’ve had mixed results. The demo sketches seem to “kind of” work, but when I try to incorporate any of that into my own sketches it’s patently obvious I “don’t get it”.

The CC1101’s are around $10CDN with spring or stub antenna (the GPS modules are over twice that cost). Whereas the NRF’s are slightly more expensive than floor sweepings. Actually some of the ones I got look like floor sweepings.

The strangest things get you thinking, in my case I was writing a data logger on my Mac for a MasTech 8040 digital multimeter. I realized that I’ve worked with serial for…oh..ever it seems. Never had any problems with it. I GET it…:-) Which started me thinking, what if there’s a transceiver with a serial interface for the Arduino.

There’s the XBee series that work well but costs add up quickly when you need a few of them.

Off to “FleaBay” and what do I find? These:

IMG 0416

Essentially these are a CC1101 coupled with an UART. Cost is less than half of what the GPS shield does. If you’re trying to find them on Fleabay, search for “RF1100-232″. In spite of the fact they are advertised as 1100, mine were 1101’s. According to the data sheet:

CC1100:400-464 MHz and 800-928 MHz

CC1101:387-464 MHz and 779-928 MHz

I found a very good write up of the modules from this web site. The blog entry gives you the info so you can change the serial baud rate, channel (there are 256 channels) and even read the “config” from the current settings. Well worth the read.

I took my RF1100’s and added an angle pin connector to it (they use standard pin spacing YEAH!):

IMG 0418

From there, it’s a four wire cable, +, -, Txd, Rxd. I used the Arduino SoftSerial to set up two pins for the UART. Again, really simple to do.

Next I added in my GPS shield as the master. At this point I ran into my first and only snag. In Setup I used .begin(9600) for both of my serial ports but the whole thing stalled at that point. What I discovered after some reading is that you can’t have more than one serial port active for listening. Thus “gps.listen()” was all I needed to make it go. I don’t plan to use the radio to receive anything, just send to the slaves.

An interesting side note, the RF1100’s have 256 channels. If you have all of them on the SAME channel, they will all receive what the master sends… you don’t need to specify a specific module. Although, there is a function that allows you to assign a unit number to a module. In this way, you “could” use the same channel, but have the RX unit check for it’s ID number in the message from your TX unit. I didn’t bother, just kept it simple.

After writing a TX and RX sketch, it was time (that’s a pun if you missed the point of this whole blog entry) to send time across the air of my “desk”.

IMG 0412

Left hand unit is the RX. Right side is the TX and you can see the GPS module. I broke it out to a breadboard for power connections. Nothing more.

IMG 0414

And there you have it. The TX module sends the remote the “time” once a second. At 9600 baud that’s 960 characters a second, if the wireless wind is right, so the three that I am sending it’s probably laughing at. I do all the time formatting in the RX after getting the raw numbers. Pretty simple stuff really.

Distance wise, how far do these modules send? At maximum power 10dbm, I could get about two walls worth of distance in the house. So the best location to put a master module would be as close to the center of the house as possible. Which of course is my next experiment.

The RF1100’s I have come with a short stub antenna but they also have some that have a coiled wire one. Is there a difference in range? No idea but I have a couple on order so I’ll know sometime in the future.

According to the “scant” docs I could find, you can send or receive 30 characters maximum. I haven’t tried a test to see if that’s true or not, but I suspect it is.

None the less, these small, simple to use transceivers are just the cats meow in my opinion. You don’t need a custom library just the built in SoftSerial in the Arduino (1.0.4 is what I am using). And now I can move forward on my “one master time clock” for the whole house theme…:-)

From now on, I’m going to keep my eyes open for other shields that have an embedded UART. Sure makes life easy.

25
Feb

iPad Charging…

I have a super cool iPad application called Electronic Toolbox that contains just about every reference and calculation that any electronics hobbyist would ever need. I use it constantly when I’m working on the bench and naturally since the iPad is battery operated there are times when, the battery goes pufpt.

Unfortunately there’s no place on the bench to charge it. I’d have to scurry into the other room, grab the charger and cable, head back, plug it in and then reverse the process when I’m done for the day. I have a couple of bench supplies and previously I built a special 5VDC Arduino supply that comes out in a USB backplane.

Logic says that I just plug in the iPad cable to my USB backplane that I use to power the Arduinos for testing and presto. It charges and I can continue to use it. Except when I did that nothing happened. Sometimes that’s a good thing.

It appears that the 10Watt iPad charger is more than just a 2A 5VDC wall wart. We’d purchased these little gems for charging the iPads (Power2U from NewerTech):

Power2u animation

According to the document with it, you aren’t supposed to be able to charge two iPads at the same time. Or an iPad and pretty much anything else. Or as the Disclaimer puts it: “*To maintain factory-stated charging duration when charging two iPads or a combination of iPad and any other USB rechargeable device simultaneously, we recommend charging the iPad via the factory wall adapter.”

Now Carol and I have actually plugged in two iPads just to see what happens and they both charge, albeit slowly. But we don’t make a habit of this.

Any way, because of the Power 2U, I couldn’t see why the iPad wouldn’t charge with my 5V supply. After searching around on the net, I came across a number of people who;d either ripped the iPad adapter apart or had reverse engineered it. Apparently Apple detects some voltage on the data + and – lines and then draws accordingly.

Which lead me to this schematic:

Ipad 2 Charger

Although the resistors shown are supposed to allow a 2A charge rate, with a 60% charge on my iPad, I measured just over 1 amp. And that’s the best I got with any amount of fiddling. The voltages on the data pins are supposed to be +2 (pin 2) and +2.7 or +2.8 (pin 3).

When I measured our Power 2U outlets I found 2.0 and 2.75V on those data pins. So I’m guessing the charge rate is about an amp. Works fine over night any way.

I decided that I wanted to be able to adjust my voltage dividers so I used 10 turn trimmers instead of fixed resistors. I built the circuit on a piece of breadboard.

IMG 0374

On the bottom, one jumper and the rest are directly connected:

IMG 0375

With the USB cable (I repurposed one that came out of an APCC UPS power supply):

IMG 0376

I tested all kinds of settings from a low of 1.53V to 3.1V. It didn’t seem to matter what I did, the iPad draw was just about constantly the same ever time. So yes it was charging. At least part of the mission was accomplished.

Having bare boards laying around on the bench is a good start to having problems, I put the circuit inside a mini Hammond case:

IMG 0377

The finished circuit plugs between my USB power outlet and the iPad:

IMG 0378

Works like a peach. But I’m slightly mystified as to why I can only get the iPad to draw 1 amp from my power supply. After reading a few others tests and outcomes, it seems that the iPad charger does something “special” to get that 2 amp fast charge, where as all the after market chargers seem to fall into that 1 amp range.

Despite pleas from others, I’ve no found anyone who can answer the why. So I’ll just have to be content with knowing that I can charge the iPad on the bench. For now anyway…

4
Feb

Announce-R-Duino

The newly acquired LED matrix shield from eBay has proven to be a lot of fun and at the same time, a great learning experience.

The shield is designed to be used in a daisy chain fashion so I decided to make a “scrolling” display for SuperBowl. After all, it’s great sport to heckle your friends with a scrolling display…

I daisy chained the out’s to the in’s and then the five pins to the Arduino. Of course I had no way to mount the displays so I used…yep. A clamp. Because I could.

IMG 0315

I programmed up a message (which is a lot of dits and dahs) and got it working on an UNO. It took about 10 seconds to realize I wanted more. I went looking for an alphabet and found one that I could modify during the building stage thereby leaving the original alphabet array intact. This is largely because I rotated my LED matrix shields to join them.

At this point I could program in a new “sentence” and after a reboot it would display. Another 10 seconds passed. I wanted more.

I added an ethernet board, made a static IP, turned the ethernet board into a web server. The idea being that I could log on to my “sign”, enter in a string, build the new display and scroll it.

Major kafuffle. The Arduino ethernet shield (Wiznet W5100) wants to use pins 10,11,12 and 4 for the SD card. While the SD card wasn’t required any way, I changed the code for the LED matrix to use SPI on pins 5,6,7 and crossed my fingers. Dang. It worked. I tried other pins but ended up leaving it with those because both boards worked together. Yep. That’s a good thing.

After all the debugging, I finally got it going again. This time 30 seconds passed. I wanted more.

I changed the code in the ethernet start up so it used DHCP and added the project name “Announce-R-Duino” after which it appends the IP it got with DHCP so you know how to talk to it. Using port(81) allows me to use with a wireless bridge. So a simple 192.168.16.100:81 will get me to the web server.

IMG 0342

The Announce-R_Duino was parked on top of the entertainment center and my kid brother was having a gas with it. Typing in all manner of running comments. And then, presto, it stopped responding..oh no!

Seems that I’d stretched the UNO’s SRAM memory limit a bit too much (and I use strings instead of “char”; so shoot me, I know what works easiest for my brain). In a matter of minutes I had programmed an ArduinoMEGA, swapped the wires over and away we went.

Later, I tested out the “free” memory and with an UNO, to put it bluntly, taint none left. On the MEGA I have 5 or 6K to spare. And it runs just as good on the MEGA so…that’s where it’s going to stay.

My original web sever allowed you to type in commands to control the display. On, Off, Brightness and then it occurred to me I might as well use a web form and let the Arduino figure it out. So I did. Much easier to use and see all the extra commands, of which there aren’t many.

SafariScreenSnapz002

The two files I use, the main program I wrote, the alphabet I found someplace can be downloaded from this LINK.

The LEDControl library can be downloaded from the Arduino.cc site.

The code I wrote, builds from the web input, and it uses a single space of kerning. There’s some lower case descenders that I coded in as well. Of course with only one “pixel” of drop they look a little funny but… Almost all the symbols and punctuation are available as well.

I have found that with four shields connected, I didn’t need any “delay()” to slow the scroll speed down. Matter of fact running flat out is just about the right speed for reading it. I tested it with and without ethernet and it’s about 15% faster without ethernet. Something else I noticed is that if I didn’t “rotate” the display counter clockwise 90 degrees, it would display faster. But of course you can’t bump all the displays together if you don’t.

I have a second set of 4 displays coming and another 4 that I won’t have to rotate. I’ll be testing those with my code to see if it’s my code, the nature of the Max7219’s or just slow electrons…

The assembly language bit reverse I found in the Arduino forums so credit should go to the author of that cool snippet, and I’m sorry I don’t remember who that was. I had no idea one could write inline assembler with an Arduino. I wrote Z80 machine code for 14 years so I’m looking forward to getting my own feet wet with some AT code.

I have the Announce-R-Duino in my shop now so if the wife wants me, she connects to it with her iPad and sends me a “text”. Yep. We are nerds.

For the alphabet this what I use with PROGMEM:

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

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.

29
Dec

Look Ma, no hands!

The title of this blog is one that every kid has uttered at one time or other. Usually just before some major “oops” befalls them. It actually rates right up there with “Hey! Watch me do THIS!”. The latter generally is associated with a visit to the ER and some stitches (or worse). However this blog entry has nothing what so ever to do with those childhood memories or scars. Instead, it’s an Arduino project. But it all started very familiar like one of those childhood things…so let’s begin.

I picked up one of these rather cool clocks for the studio from a local music shop:

GT Clock

It’s a 17″ clock, 13″ face, neon tube that runs around it and the usual not-so-silent ticking battery clock movement in the middle. The thing is powered by an AC adapter but it only powers the neon tube.

It’s been hanging in the studio for months and the incessant ticking is like a WWII water torture. I thought about replacing the clock with an Adruino and LCD display, but that’s kind of hard to read from a distance. I wasn’t even sure if I wanted to keep the neon light. Thus, I decided to gut the clock and use what I could.

As it turned out, the innards came out easily enough. Now I envisioned LED’s around the outside counting off the seconds. That’s 60 single outputs. Then 12 LED’s for the numbers. And and and and…the first order was to make a LOT of outputs for the Arduino. I designed some stuff and in the midst of it I happened across Dougs Word Clock. So I figured I’d make something like that. Again, I needed many outputs any way. In my browsing, I found a product called a Lightuino 5. Scads of outputs, IR, photo sensor, and Arduino all on the same board. I ordered one.

I’m not sure at what point I abandoned the Word Clock idea, but as any of my family or friends will admit, I love LED’s and the more the merrier. So I went back to my original 60 LED, 12 LED idea. And I started working on the clock “face”. First off, take apart the Groove Tubes clock.

IMG 0074

I picked up some 1/4″ foam board to built the clock face out of. It’s easy stuff to work with, and I could paint or cover it.

IMG 0077

How the numbers were going to light up was sort of an after thought. No plan, just see what happened as I made the clock. I covered the foam board in black felt. I inserted a few LED’s in the foam board, put it back inside the clock housing and had a look.

IMG 0080

Not a bad effect. I liked it. Right up to the point it dawned on me that I was going to have to insert 60 LED’s, 60 resistors, 60 wires and so on. My fingers were raw from pushing the LED’s through the foam board (took two days to do it). I even punched holes through the board to make it easier on the fingers. And to my credit, I got some of the holes in the right place and the LED’s just popped in. Others, not so much…

IMG 0191

Eventually my efforts resulted in this ring of 60 LED’s. And on the back side, something that looks like Stonehenge.

IMG 0192

I discovered in my wiring why some of those LED’s are so cheap on eBay. There are large variances between them. Some are super bright, others not as much. I tried as best I could to pick the best 60 out of the 100 that I had.

With the Lightunio 5, I ordered the ribbon cables for the 60 LED’s so I had to cut those ribbon cables and solder them on to the LED’s. The cables are really EIDE 40 pin drive cables.

IMG 0198

For an accurate time base, I considered going with a DS1307 RTC and updating it via ethernet. Which meant not only was I going to have a power cable (ac adapter) running to the clock, I was going to need an ethernet connection. Not cool. The DS1307 is not exactly a stellar time keeper either. While looking for alternatives, I found a few references to GPS. Ah ha. I wondered if it would work in the house…

SafariScreenSnapz001

They sell a lot of these GPS modules on eBay and they are based on the MT3329 chip. Serial communication, 9600 baud. And supported by the TinyGPS Arduino library. They are supposed to run off 3.3V, but I’ve been running mine off 5V with no ill effects. Any way, if you factor in an ethernet shield, some wire and/or a wireless connection, these GPS modules are probably cheaper. Besides, they are a hoot to play with.

After receiving the GPS module I tested it out and I commonly get between 8 and 12 satellites in my area. I checked the LONG and LAT and it’s pretty accurate as well. I found a GPSSYNC example code in the Time Library but it didn’t work. Found a web site that was supposed to “fix” that but the modified code didn’t work either, least on my GPS.

So I found examples that did work and started from there. First thing I found was GPS gives you UTC (universal time code). Real useful if you live where it’s the right time. Not so useful if you don’t. I started experimenting with the Time library and found a way to get the GPS time and convert it to local time. I admit it’s probably not an elegant way to do it, and there’s probably a lot easier way to do it. But it works. My rule is you can’t fix it if it’s not broke.

I use an LCD to display the date and time (more for debugging than anything else) and the LCD wasn’t a great eBay buy so I’m not going to miss it because it’s hidden inside the new clock.

I put some numbers on the clock to see what it looked like and Carol wasn’t happy cause they were “crooked”. No argument there. They were. She volunteered to help “straighten” them up and fly right…

IMG 0210

The circuits were all done, I just need to finish off the face. Couple hours later, all done.

IMG 0216

So how’s it work? Originally I was going to have only the current HOUR LED on. So if it was 2am or 2pm only the 2 LED would be visible (I used BLUE LED’s for contrast). Carol looked it and kind of harumphed. So I changed the coding a bit, and put in a bug. I didn’t notice it, but she called to me and said the clock was WAY BETTER. Wondering what the heck I’d done I checked it out.

Instead of lighting the current hour, I’d light it up sequentially as it marched through the day from 1 to 12, and then reset and start with only the 1 lit again. Yep, when she’s right, she’s right. It looked mondo cooler.

The outside LED’s (the 60 of them). One counts off the seconds the second one shows the “minutes”. So in the photo above, it’s 3:31:43. You have to watch the outside LED’s because one moves each second whereas the other is static for a minute. Works quite well and looks good.

I still have to neaten the wiring up inside somewhat, but here’s the innards of the clock.

IMG 0219

That’s a 4 x 20 LCD, Toasted Circuits Lightuino 5, and a GPS. Those little round white things that look like pill bottle caps, are, exactly that. I drilled a hole in the side of them and inserted a blue LED and the white cap diffuses the light for the numbers. Works very well that way.

So there ya go. A GPS clock. With no hands. A definite cool factor according to Carol and that’s like a seal of approval for me.

26
Nov

TrendNet – Repurposed

Some time ago when I built my iPatch, I’d picked up a clearance item at a local electronics shop. Mainly because I wanted the box it came in. What I didn’t realize at the time was that it was a steel box and it wasn’t going to be easy to turn into an iPatch.

Thus is got dumped into my junk box and sat there for more than a year. Since I’ve been doing a lot of work with Arduino’s and LED’s (mostly 12V strings), I use my 10A bench supply to test run stuff. Which is fine because I can limit the current with the supply. However once tested, using the bench supply seems a little overkill.

Thus I decided I needed a simple 5/12V power supply just for powering stuff that I’ve fully tested. Out came the Trendnet 16 port ethernet switch.

Trendnet

I removed all the parts inside (no idea if it even worked). I then sourced some switching power supplies (5V 4A), (12V 2A), some LED panel meters and away the project went.

Cutting the steel I used a nibbler and I have to say I have a much stronger grip now than when I started. It’s TOUGH to nibble that steel…

IMG 3449

The large connector on the left in the photo is a four port USB backplane connector. I just drilled some holes in it to mount it and this is where the 5V comes from for the Arduino. And I can have four Arduino’s running at the same time.

USB QUAD 4 PORT to MAINBOARD

I used a couple of 90 degree 2.54 headers on to a piece of perf board to connect the sockets from the connectors. Works fine.

For the 12VDC connectors, I used banana jacks.

IMG 3451

So when it was all said and done and powered up…I have a 1U rack unit with lots of plug in places for Arduino’s and a 12V supply for “external” items like LED’s (strip lighting). I didn’t wire the grounds together so they are completely separate supplies.

I was going to put in an AMMETER for the 12V supply and I had the panel meter ready to go in but I didn’t realize that it required a separate Vcc for the meter.

The two voltmeters run off the same supply as they are measuring, but the ammeter leaked out some smoke when I connected it up that way. Course, in electronics, that’s how you learn sometimes. So if you’re looking for a panel ammeter on eBay (or where ever), check to make sure that it can run off the same supply as it is measuring. Or your’s will leak smoke too….

19
Nov

Arduino Relay Board

I was working on my Arduino RFID door opener and got a relay board from eBay to toggle the door strike. It wasn’t working exactly as I wanted and found that the relay board was energizing on a LOW signal, not a HIGH signal like I wanted.

Why is the relay board trigger important? If the Arduino loses power it comes back online when power is restored and all the outputs are low. Imagine if you had a strike that triggered on low. Yep. Not a good sign.

There’s a lot of these boards out there and they all seem to be made the same way at present. Thankfully many other boards are being made with options to trigger either way. This schematic I found on eBay:

Relay 1 MS SM

The board I have is simply hardwired to trigged on a low. Circuit wise it’s the same as the schematic without the two additional jumper blocks J1 & J2.

So I hacked it… Here’s the board in it’s natural state:

IMG 3435

Couple resistors, optoisolator, LED, diode, NPN transistor, and a relay. Pretty standard fare for these boards.

The schematic is about the same as the one above, except the jumpers for triggers are not there. So I removed the LED to start with:

IMG 3436

This LED is wired in series with the optoisolator to indicate when the relay is energized. One pin was coming from the terminal block, the other from the opto itself. I’m going to route the terminal to PIN 1 of the opto through a 1K resistor.

In the schematic you can see the original 1K resistor going to pin 1. I have to remove that 1K so it can’t provide power to the opto pin 1. The left hole is the Vcc, the right hole goes to pin 1 of the opto. So out it comes.

IMG 3437

I took a standard 1/4W 1K resistor and bent it to fit the holes I wanted it in. So now my terminal strip is connected to pin 1 of the opto via a 1K resistor:

IMG 3439

The hole at the top is Vcc and won’t be used. The empty bottom hole is where one lead of the LED will go. The other lead of the LED will connect to the Emitter of the NPN transistor (GND):

IMG 3440

And that was it. The relay board now energizes on a HIGH input, the LED shows the state of the opto (and hopefully the relay)…

IMG 3441

If this board had used SMT parts, this would have been harder to do so there’s a lot to be happy about sometimes with discrete components.