Skip to content

Posts from the ‘Electronics’ Category

15
May

Arduino TFT

As of late I seem to be back working with TFT displays for my Arduino projects. From the 1.8″ up to the 2.4″.

The most common sizes, small enough to work on SPI with an UNO are 1.8″, 2.2″ and 2.4″.

TFT 1.8″

These TFT’s give you 128 x 160 resolution in reasonably good colour. An ST7735 driver chip is the work horse for the display. Adafruit’s library works just peachy.

The major benefit for the 1.8″ TFT is you don’t need logic level shifting and it runs off 5V perfectly. I usually run a 39 ohm resistor from 5V VCC to the LED. However, as mentioned no logic level converters are required.

TFT 2.2 and 2.4″

Resolution for these is the same, 240 x 320. Just the physical size of the display changes. Controller is ILI9341.

The larger TFT’s are different animals. They are designed to run off 5V because there is an on board regulator to drop to 3.3V. And 3.3V is where these displays are designed to work. Thus, if you do what I did and just plug them into a 5V Arduino, you won’t see smoke, but you won’t see any image and you’ll cook the controller. That’s what I did with my first one. Sigh…:-)

The majority of the inexpensive ones I use all look like the photo below. Some are labeled QVGA. You can see in the photo that some have a touch screen option, but look closely and you’ll notice the IC for the touch portion is missing (top left side).

If you buy one off eBay and the listing photo shows the IC in place, don’t assume that the one you get will indeed have the touch screen. I’ve gotten some with the chip, but none, unless clearly stated in the listing, have come with the front touch membrane.

IMG 0023

Working with TFT’s

If you’ve never used one before, they work with SPI and there’s a couple of libraries for them. One is the Adafruit library and the other is a super speed version of the Adafruit Library you can see here in action:

FAST ILI9341 Library for UNO

While the 1.8″ is pretty much wire and go, the 2.2 and 2.4 aren’t. You need logic level converters.

Originally I was using CD4050’s to do the job and a nice job they do. Excellent waveform from them. But the Arduino isn’t really a speedster any way and I noted that some of the knowledgeable Arduino users were simply using a resistor divider. So I decided to give it a try.

Here’s my first attempt and on the top you see 2K7 1/4W resistors. Right side connectors go to the Arduino, left side connects to the TFT (first 8 pins; but you only use the first seven). You can see my 39Ohm resistor feeding from 5Vcc to the LED pin.

IMG 0026

Underneath is a 4K7 common resistor. An octal version here with some pins cut off because I only needed 5 resistors.

IMG 0025

So what you have a simple voltage divider to take 5V down to 3.1, 5 copies of them:

Divider

The wiring is standard SPI and I used UNO pins 8,9,10,11, 13. Note you don’t need to wire up the SDOK (MISO) pin, it’s not used. If you need to use the SD card slot, I found it’s 5V friendly and you can just parallel up the same pins (SD_MISO–>MISO, SD_MOSI–>MOSI, SD_CLK–>SCK) except for the SD_CS, that needs to be a pin of it’s own.

After running the 2.4″ display for a few days to make sure everything was going to work fine, I could see that a smaller converter board would be nice. Sure a little more difficult to make, but nice just the same. Maybe even SMT.

I started searching for something that would work and found a breakout PCB on eBay that looked promising. A little pricey for shipping but what the heck.

IMG 0630

I got them quite quickly and found they would work very nicely. At first I tried to use my hot air rework station to solder the resistors on and that didn’t work. Even with the fan on a lower speed it blew those little resistors all over. And these are double sided boards so when one side soldered the other side fell off…LOL

Using SMT solder paste and a normal temp controlled iron worked perfectly. The bottom where the 4K7’s commoned are.

IMG 0647

And the top, compared to the original test one I built.

IMG 0027

Quite a bit smaller. If you check the video link for the super speed library, you’ll see just how fast the TFT can be. Of course, it’s not super speed for everything but it is significantly quicker, albeit it does take more memory on the Arduino.

I should mention that when you first run the demo that really shows the speed, it’ll use up 21K of your flash memory. If you go into the library and look for the fonts.h file, you’ll find the writer is using a custom font. You can default back to Adafruit’s GLCD font and save a pile of memory if you want. I did.

18
Apr

WeatherMate – Arduino Style

When you’re an avid golfer, weather tends to play an important part in trying to book advance tee times. I’ve found that in shoulder seasons, 10 day forecasts tend to be sprinkled with pixie dust. On many occasions that pixie dust turns to something you really don’t want to be out playing golf in.

The first task was to find someplace to pull weather from. This lead me to a service called Wunderground. This service pulls weather data from “PWS”, personal weather stations, all over the world via the internet.

Documentation and how it works is a little scant but the drift is this. You can sign up for a free “ID key” and with that key you can send an HTTP request and receive weather data for just about any where in the world where they have stations reporting. If you want to know what stations are around, that’s a little tougher but you can use your ID KEY with a geolocate tag and Wunderground will supply the info. Sort of. Don’t get fussy, it’s pretty generic data.

With a standard query, you name the country and area and Wunderground will deliver the weather info from any one of several stations in that area. If you want weather from a specific station, you can request that as well BUT be aware that I’ve had these stop for a few hours from time to time or not respond at all. Whereas with the area report it is 100% responsive.

With a basic non-paying Wunderground account you can pull in 500 queries a day. Should more than enough and I found any more than about every 20 minutes is largely a waste. Every half hour would be perfect I think.

You can request the data as a “.json” or “.xml” file. At this point, we have the data. Now what to do with it?

Enter the Arduino.

I had many options at this point. So, start off simple. Use an ethernet board and an LCD 4 x 20 display. Theres a “.json” parser for the Arduino, probably even an XML parser someplace. I never got that far. The display on an 4×20 LCD looked pathetic. Text. Ugh.

So I grabbed a TFT. A 320×240 3.2″ from ColdTears Electronics. I already had an Arduino Mega adapter board for it.

Whoops. Snag. Darn. I’ve yet to find a way to get a TFT display and shield to work with an ethernet shield. They both use SPI and don’t play nice together. At all.

Then I remembered I had all these WIFI modules. Some ESP8266’s, HC-21’s, HLK-RM04 and USR-WIFI232-T’s. So I started with the ESP8266 and worked my way through each of them. To see which one was the most reliable and easiest to use.

To make a long story short, formatting and sending out requests and getting stuff back is a work of frustration with these modules. Everything is an “AT” command from the 80’s when Hayes modems were in vogue and if you send too fast, time out, or the phase of the moon is wrong, these are anything but reliable. When I DID get one to work for a few hours, at some point they’d lock up and require a reboot to get going again. And parsing the data was a pain in the butt. No contest.

Bah.

As I was reading the docs for the HC-21 (translated from something I don’t natively speak) I noticed the phrase “transparent” in a number of places. Okay. Transparent. Maybe that’s something. After reading way too many poorly translated pages, I found that if you simply wanted to do a TCP connection with the HC-21’s, you set them up and anything you sent out serial got sent as a TCP packet and anything that showed up on the HC-21’s IP address/port got shoved right through to the UART.

No frigging around with HTTP, parsing or anything else…mmmm. Since I have a server in the office here that runs 24/7/365 I decided I’d write a Mac program for it that would pull in the data from Wunderground, parse it, and send it out to the Arduino every “x” minutes as a TCP packet.

I connected the HC-21, set it up with a web browser, then connected it to a USB to serial converter, and finally Telnet into it from another computer and read the TCP data that showed up through the UART.

I also managed to get the USR-WIFI232-T working equally well. The RM04 and ESP8266, not so much. There was even a firmware for the ESP8266 that said it turned it into a “transparent” device but what I found was that it made it an access point with transparency, not a STA (station/bridge) with transparency.

IMG 0601

That’s a DC-DC buck converter to go from 9VDC down to the 3.3 that the HC-21 uses. I tried a simple LDO 3.3V regulator but that didn’t work at all. Instead of 3.3V, I got about 2.6 out of it. So I just grabbed a buck converter to do it, but even this one needed some adjustment under load to get it to 3.3V. The HC-21 wants 200ma! Be warned.

The HC-21 basic info:

HC 21

The UART settings for the MEGA (could have set the UART faster because the MEGA has four hardware serial ports, but I didn’t). My full string I send from the Mac is 48 ASCII characters and I use strtok on the Arduino to parse that. Works quick and simple.

HC 21 UART

Note the PORT. When I send to the HC-21, it’s like 192.168.1.51:8000 since anything that goes to port 8000 goes right out the UART.

To bridge the HC-21 to one of the office routers:

HC 21 Bridge

Notice I set the Wireless Mode to “g”. Yeah, too many of these little things like to default to “b” (like the ESP8266). So this works fine.

Lastly, set the IP info up:

HC 21 IP

I set up a STATIC IP and in my router I use the MAC address of the HC-21 wifi to make darn sure it stays at that IP.

For initial testing, I left the HC-21 connected with the USB to Serial interface. I wrote the Mac application and sent the data to the HC-21 to make sure it got there. No problem. Worked like a charm.

The HC-21 has an indicator LED on board and when it flashes about once a second like a heartbeat, it’s not connected as a bridge. When in bridge mod it flashes a double blink.

As I used the HC-21, the more I liked it. But I also found some interesting stuff out about it. First off, forget using the 3.3V output from any Arduino. When the HC-21 is running it pulls upwards of 200ma, the Arduino barely puts out 60ma on that 3.3V line. The HC-21 runs WARM, not hot, but most assuredly warm.

Once programmed, from a cold boot, the HC-21 will connect to your router in under 5 seconds. With some of the other modules, it was more like “later that same afternoon”…so the HC-21 is a nice performer that way.

After verifying that the data was getting to it, it was time to start building the Weathermate remote display.

With a strip board I put on the buck converter and a level converter. I’m not 100% sure that one NEEDS a level converter with the HC-21 to a 5V Arduino for the TX and RX but I used one any way.

IMG 0602

Then I wrote the sketch to receive the TCP data:

IMG 0603

The icons are stored on a 1GB SD card so if I have to update them, it’s easy. Although I could have stored them as an image right on the Coldtears display (it has room on its Font IC). I use the ColdTears library and the UTFT library.

Why the ColdTears one? Simple, fonts. Cold tears puts out some good quality displays and include what they call a “Font IC” which means there’s a number of fonts in the different sizes installed in a ram chip on the display. Rather than an external font or one that you have to add in to your upload, it’s built in. In sufficient sizes that Ive rarely had to use any of the TFT external fonts.

For a project case, I used a 4x4x6 plexiglas box that was meant for a LED matrix display. I mount the display in a piece of 1/4″ foam board so I don’t have to cut holes in the plexiglas.

IMG 0605

A printed graphic on the foam board gives a nice effect:

IMG 0607

The image itself is from my home golf course here. NorthView Golf & Country Golf Course, Canal course, #17. Depending on the wind, it can be an intimidating shot. By year end there’s enough balls in that pond that you can almost walk across it and not get your feet wet…

8
Apr

Spitfire – Arduino

A friend dropped off a poster that is mounted on 1/2″ MDF. The poster size was 42″ x 24″ so it’s fairly large.

IMG 0581

Apparently at some point in time he had someone drill some holes in the picture in strategic spots and install some grain of wheat bulbs and some LEDs. The problem was the job was never finished and he’d lost touch with the person who started the job.

Taking over with someone else’s project isn’t something that I normally do but in this case, all he wanted was some LEDs and a little flash. Right up my alley of course. So I took on the job.

First thing was to flip the board over and try to figure out what was left to do.

IMG 0580

Obviously there was a sale on hot melt glue for the project and after checking it out, I found none of the connections were soldered, just wrapped and the connections were corroded. To the point some of the bulbs and LEDs worked. I think I stared at the job for a while and decided it was just as easy to strip it and start over.

IMG 0586

The next job was installing all the LED’s, red, green, orange, white, where the old holes were drilled. I didn’t want to drill any new holes and as I worked I put in 18 LEDs.

IMG 0589

I used a little heavier gauge wire than the original wire wrap that was used. And of course, I HAD to use the handyman special, duct tape, to hold the parts in place. No way I was going to hot melt glue it. In the event he didn’t like it or wanted something changed duct tape was a lot easier to remove than glue.

The next choice was how to make the LEDs work. Sure I could have just wired them to a wall wart and had them come on, but I know my friend likes flashy lights so…I thought an Arduino could be pressed into service here.

Of course the stumbling block was that the Arduino doesn’t have that many outputs (18), nor does it have that many PWM outputs so brightness control was going to be awkward. Which of course made me break out the manuals to look for IC LED driver chips. Which eventually led me to the TLC5940 from TI. A nice chip, runs off 5V, has 16 PWM outputs and after a quick search, you know, someone already wrote an Arduino library for it.

I have some double sided perf boards and I thought of those first and then I spotted the single sided strip boards I have here. Oh yes, those made things much easier. I built the LED driver on a strip board.

IMG 0582

Inputs on one side, the 16 outputs on the other side. Back side of the board I cut the strip between the IC pins and soldered in the parts.

IMG 0583

I used a 10 turn pot for the current adjustment. About 1K8 would give 30ma through the LED’s but I set the pot for 2K8 to reduce that to about 12ma. There’s a formula for the resistor you can find on the data sheet. The LEDs I have are fairly high candle output so even at the “reduced” current, they are plenty bright.

Next I built up a test bed to see what I could control and how fast I could control it…and as it turned out, good thing I did.

IMG 0584

The library for the Arduino works nicely, and you simply make all the changes you want to the LEDs (you control EACH one with PWM) and them you send a “tlc.update()” to make the changes work. What I found was that if I tried to update too soon after setting the various outputs, nothing would happen. I needed to add a “delay(1)” before some of the update commands to make it work. No big deal but worth noting if you’re having some issue with nothing changing.

For the Arduino end, using a MINI Pro was the choice. Small, 5V, reasonably inexpensive. I’d also decided to incorporate multiple modes of display for the LEDs. A static, animated, and navigation LED’s (strobe) only. But how to control that when everything was hanging on the poster back and it’s on the wall. RF was the obvious answer.

I had a small RF key fob remote left over from another project so I added an RF receiver to the MINI Pro. I used the RC Switch library and it worked perfectly. I thought it might interfere with animation but it didn’t. Bonus.

IMG 0592

For wiring between the TLC5940 and the LED’s, I used a standard computer ribbon cable. Worked out perfect.

The first time I fired it up with all the LED’s on the poster I swear it almost lasered my retinas out. Bright doesn’t begin to describe it. Which is the point I was patting myself on the back for using a PWM LED driver IC. I added an array for the 16 LEDs that I could store their maximum brightness in. I could make all of them roughly the same intensity. This worked out better than I had hoped as well.

So how does the finished project look? Well, when my friend seen it he was in awe. When he asked if I could speed up the rate of cannon fire (it’s animated) he was surprised that I could do that with a sketch change in a matter of seconds. When he left with it, he was off to protect the skies like Snoopy & The Red Baron…

1
Apr

Acurite – 00592TX

Lots of Arduino ideas start off with a simple enough goal. Essentially you want to accomplish “X”. What ever “X” is.

So you start with Google to see if someone has already done any ground work to save you some time and, inevitably, frustration.

As an avid golfer, weather plays a very important part in getting out to play. When I was a working stiff like most others, on days off, if you wanted to play, you went. Rain or shine, did’t matter. There was only so many hours you had to work with.

In retirement now I’ve got a lot more fuzzy about the weather. Cold is not so critical but rain, hail, and exceptionally high winds are. You know those weather conditions where you ask yourself, “What am I doing out here?”. And you usually don’t have a logical answer?

The weather stations I have at the Wanch here work good for todays weather. So does walking to the window and looking outside. So future weather starts to play a very important part. I have a couple of Acurite weather stations that “predict” tomorrows weather because on some “magical” formula laden with pixie dust.

And thats how it all started… innocent enough.

Searching around indicated that most of these companies don’t publish their protocols so you have to reverse engineer the data stream with a probe and some software (Audacity seems to be the software of choice). Fortunately all the RF seems to center on the 433MHz band. There are scads of those things for the Arduino.

During my searching I happened across this web site:

TechSpin.info

Low and behold Brad had decoded the stream and even writing a sketch for the Arduino UNO to show how it was done. He wrote a three part series in a clear and concise manner on this so if you have the same TX unit, read all three. Worth it!

As fate would have it, I have the same 00592TX that Brad used but my base station was a little more involved than the one that Brad used. I have a 1097B station remotely connected to mine.

I decided that for clarity, I’d use a ColdTears TFT 3.2″ display (320×240). My thought was that I could use the fonts and icons that are in the FONT IC that’s included with the ColdTears displays to make some of the graphics programming easier. And to that end, it does work nice.

There are many TFT displays out there and I have many different ones here as well. From 1.8″ to 5″. Plainly stated if I want a premium display I use one of Coldtears products (they have matching shields). Keep in mind that you won’t be using one of these large TFT displays on an UNO. Mine all run on MEGA’s (2560).

So after a few false starts and problems, I got it working:

IMG 0570

I know…AcuWrong…well, when you have enough software errors cause you shouldn’t be coding when you’re tired, projects tend to take on a name of their own…

The two icons are from the IC that ColdTears has on the displays. Easy to use. The battery in the remote and the “signal strength” are shown. The battery is sent in the data stream from the remote so you can decode it and display the amount of battery remaining.

The signal strength had me going for a while. On my base station there is a four bar signal strength graph and I found that it’s not signal strength in the RSSI mode. The TX sends out four packets that are identical. The receiver then calculates the checksum on each packet and display how many packets were correct.

Some how that equates to signal strength. I guess.

I could read four packets but because of the way the interrupts work, when the signal dropped off, and I’d receive less packets I couldn’t accurately detect it. So I gave up trying.

A real time clock (DS3231) was added because I had the idea that I’d show the high and low info for the day. If you try to use my sketch you’ll probably find that there is no DayOfTheWeek2 in your RTCLib like mine. Here is my library:

RTCLib

The Arduino sketch for the 3.2″ TFT display. After working on this for a few days I started to realize that I really need to know what the weather will be in 2 or 3 days from today. So while this works, I think I’m going to see what I can do with API/wunderground and some XML.

Just sayin’

22
Feb

TFT Word Clock

I have a number of TFT displays that I use for all sorts of projects and depending on the outcome of the project, sometimes I recycle them. In to new projects of course…

I have a few 2.4″ displays, TFT, that require level shifters to work with the Arduino because the Arduino’s that I commonly use are all 5V, not 3.3V. I’ve tried the “resistor / divider” and ended up just using a small PC board, some breakout pins and a 74HC4050 level shifter to do it. Which for me works just fine (although I do wish all those TFT displays handled 5V)…

So while I was toying with the recycled 2.4″ display, I was also testing a GPS and I thought, what the heck, let’s make a word clock out of it. So I did.

The first obvious difference being that it was going to be smaller than the 12″ square ones I made for Christmas last year. I have some small plexiglas cases I buy off eBay and they work great for these little projects.

Parts are an Arduino Mini Pro, TFT 2.4″ (ILI9431), GPS shield (serial 9600 baud; it’s hidden behind the TFT so you can’t see it), two DC to DC buck converters (one for anything over 7 to 5V and the other for the 3.3V for the 74HC4050 level shifter).

IMG 0484

I used Adafruit’s ILI9431 library, a time library and so on. Mainly because this is also a calendar and it knows when day light savings time happens.

The little dots at the bottom of the display are the “extra minutes” because a word clock only works in five minute increments. The whole thing is about 4″ x 4″ x 1.5″ deep. So yeah, small. But amazingly easy to see from several feet away.

For the calendar portion, It’s leap year savvy, knows what day of the week it is and I wrote in my own scheduling routines so I know what happens on what day, based on a specific cycle. Thus you need some Julian routines, some scheduling routines and then a routine to display the clock. All in all, not that terribly difficult to do.

IMG 0487

I also put the typical “digital” clock readout on the calendar display. You know, just for nostalgia.

22
Jan

433Mz Learning Receiver

In my ongoing investigation of 433MHz RF control, I got a new module from eBay today.

433Mhz Module

It runs off a 12V supply and has a SPDT relay. Thus it doesn’t use a MOSFET or something else to control power output, it merely runs a relay to turn things on or off dependant on how you wire it.

And program it…There were no documents with it, which comes as no surprise since it is from off shore and I’m starting to think if you’re born there, you are born with the natural instinct on how all these things work. Or not.

The device is labeled as an “AK-RK01SX-12″. Judging from others I found in this “series” of receivers, the -12 (or -220) is the voltage these things work off of. In this case, it’s a 12Vdc receiver.

The receiver portion of the circuit is not your run of the mill 433MHz one. Rather it’s a superheterodyne version. Thus, better selectivity and sensitivity than some of the other junk I’ve seen.

It is also a “learning” receiver so…according to the eBay listing blurb it can be used to learn those rolling codes you use for garage doors.

The official company description of the module (and yes there is a company website in Chinese that has this info, just takes a bit to find and translate it):


The company design and manufacture of small size 12-volt single remote control switch with 10A relay, can load 1500 watt appliances; can learn multiple remote control, remote control and each can learn all the buttons, a remote control can control multiple switches can also be more than a remote control switch, simple and flexible supporting any combination.

Mainly used in lighting, electric doors, windows, lifting equipment, gateways, lifts, industrial control and security industries.

Second, the technical parameters Operating voltage: DC12V
Operating frequency: 315MHz / 433 MHz

Output: switching signal Maximum load: 1500 watts work: self-locking, jog, interlocking (via pad switch)

Board Size: 41 × 20 × 15mm

Okay. Makes a fair bit of sense. Unless you read electronics.

Notice the 10AMP relay, controlling 1500 watts? If you’re in North America with 110VAC, that would be 12.6A (if you have 110V coming out that’d be 13.6 amps). Want to hazard a guess at how long a 10Amp relay will fair when you’re drawing more through its contacts than it’s rated for? Yeah, me neither.

Secondly, when you get to the line that says, “Output:” and then either the translation fails, or they use a lot different terminology than we do in North America. I’ll cover this a bit further on.

If you look at the photo you’ll see there is a “button” on the module. A single button. And if you’re thinking that must be the “pad” switch, nope. It’s not. Discard that idea. This is the LEARN button.

For programming this is the description I found (translated again):


Third, learning methods

Press and hold the button for three seconds to learn light off, then press any button on the remote control, the indicator light is looked after flash, then learns success.

★ Note: This controller can learn a fixed code (PT2262, SC2260 chip, etc.) / learning code (EV1527, HS2240, etc.) 20 different codes, any button on the remote control, will be followed by purging the oldest beyond learning remote control.

Fourth, the removal method

Press and hold the button down for about 8 seconds to learn the indicator off to recover from a long bright that clear success.

V. Work mode switching

Switching work in different places through the pads 1,2,3 short circuit board behind it.

1. Jog –1,2,3 three vacant land, without connecting

2, interlock – Short 1,2

3, self-locking – shorting 2,3

Notice the “To LEARN LIGHT OFF”? statement? Yeah, I know. So here’s how it works:

Learn:

  1. Press button and hold until LED goes out
  2. Press button on the remote to “learn”
  3. – LED will start to flash
  4. Press button on the remote to “learn” one more time
  5. – LED will come back on, it has learned the code

I noticed that I could use the same procedure multiple times to learn different remotes. So I grabbed my garage door remote. I couldn’t get the receiver to learn the code, it would just time out and return to the LED on mode. On a hunch I checked the frequency of the garage door opener, 318MHZ. Yeah, no way a 433MHz receiver was going to work with that code…

So I have no idea if it will work with a rolling code (although they say it does) or not since I don’t have any rolling code 433MHz transmitters.

Once you have fiddled around with the receiver, you’ll no doubt want to get rid of those codes it learned.

Erase ALL

  1. Press button and hold until LED goes out
  2. Continue to hold button until LED comes back on

It’s back to no codes.

Finally, we have the OUTPUT…according to the translation we have Jog, Self-Locking, inter-locking.

My translation:

  • Jog – MOMENTARY – long as you hold the transmitter button ON, relay is energized.
  • Interlock – LATCHING – Press transmitter, relay energizes. Press transmitter, relay de-energizes.
  • Self-Locking – Press transmitter, relay energizes and STAYS THE WAY. Until you break the connection at pin 2&3.

Flip the receiver over and you’ll find the “lands” or solder pads for the operation of the relay. Thankfully they are numbered.

IMG 0427

  • Momentary – no jumpers.
  • Latching – short pins 1 & 2
  • Self Locking – Short pins 2 & 3

EDIT: The Self Locking feature I originally wrote about was incorrect. One of the commenters was correct in the way it works so many thanks for that Leo!

I got it working correctly with a 4 button transmitter I just received. In self locking mode, I pressed button A to LEARN that code. When I pressed button A, the relay latched. When I pressed button B, C, or D, the relay would unlatch.

When I tried that same setup with a four (and a two) button transmitter I have here, it didn’t work the same way. Relay stayed latched. So…either something wrong with the transmitters I was testing, or the planets were not aligned.

I attribute it to another mystery of the universe.

7
Jan

Arf…Arf…Arf….RF I mean

What’sa matter girl, did Timmy fall into the well? Yeah, that dated me somewhat.

Lately it seems I’ve been playing with more 433MHz transmitters and receivers than normal sane people should have to. It all started with my brother’s truck where we wanted to hide a RF receiver under the hood and control it from a remote to turn on some running board LED’s.

While it worked great in my driveway, after my brother got home to his place, the awesome range we had was pretty much gone. As in 200 ft to less than 1ft. Now admittedly sticking a receiver under the hood of a truck and blasting it with spurious amounts of high voltage in the area and cooking it with the engine heat is probably not good ingredients for the recipe of success.

At the same time, the distance lost didn’t make a fat lot of sense either. The unit I had used is one of the typical ones off fleaBay.

SafariScreenSnapz010

The receiver looks small, but really, inside you could house 6 receivers, easily. And it’s not water proof. Sigh…

Any way I ordered two more of the same units because I assumed that I might have received a defective one. The second one I tried in the house would barely manage a distance of 25 feet and that had to be light of sight. Which makes it pretty much useless.

My next step was to take an Arduino with a 433MHz receiver and see what distance that would get. So I did that. Same lousy distance. Great outdoors though, again, no floors or walls in the way.

This peaked my curiosity as to just how much relative power these little transmitters put out. I built a dead simple field strength tester (two diodes and a multimeter on a millivolt scale). Not to measure absolute power but just to see what, if anything, was happening.

I’ll start with the original culprit, notice the meter is on the 200mv max scale.

Remote Crap

Whopping 2mv. Wow. Doesn’t exactly give you all the confidence that the signal is going to get past the end of my hand.

Next up is a remote LED switch transmitter. These sell for a couple of bucks on fleaBay and I admit the transmitters have given me problems.

Remote LED Switch

Not getting all the warm fuzzies, I grabbed a remote from one of the RF switched powered outlets in the house. This remote will stretch from the work bench at one end of the house to the other. I have an 433Mz transmitter with an Arduino that will simulate it so I know how far it can go.

Power Outlets

Okay, so it’s a bigger number…At this point I am inclined to believe that the receiver on some of these is more finely tuned than I would have expected. Still, that’s not a lot of movement for a transmitter.

Then I remembered a 12V RF relay and matching transmitter I got some time ago. Again, another 433MHz. But this one is different. It has a sliding cover on the case so you can’t accidentally trigger the switch and there is a 4″ antenna with it. I tested it first with the antenna collapsed.

Remote Antenna Closed

This is a MAJOR bump. As in huge…I extended the antenna and retested.

Remote Antenna Open

Okay, jumping from .7 to 9.6 is a fairly large leap. Ah yep.

According to most of the docs I can find these little RF units are roughly 10dbm, or 10mw of power. How far does 10mw go? It’s pretty variable in my experience, heavily influenced by things around it like other transmitters, walls, floors and so on.

I might carry this a step further to see if I can “tune” the receivers to be more accurate than they are. But then again these aren’t crystal controlled transmitters so I’m guessing they splash the signal over a big enough spectrum that you shouldn’t need your clothesline to be able to pick it up. Clothesline. There. I dated myself again.

31
Dec

Wii – or not to Wii

Seems like the Nintendo Wii is about 90 years old, well, in dog years any way. Both my daughter and I have one although she’s the only one to use hers. Ours has become a paper weight. Of which it is doing an excellent job.

The kicker with the Wii is the controllers and those batteries that it seems to eat. We’d all bought the rechargeable controller packs that fit in a base station. The Wii fits into the base station, a fan circulates air up through the Wii itself from the base station.

IMG 0244

To power the base station, there is a short USB cable from the back of the Wii to the base. It powers some blue LED’s, which do nothing more than “glow”, and provides enough power to charge the two controllers.

Which is where the first problem comes in. The fan in the base unit is your typical piece of junk. At best. Probably designed to fit in some power supply, provide some sonic icy blast of air and sound like a jet turbine all at once. I suspect sleeve bearings in these things because they sound like a muffler-less John Deere tractor when the bearings go.

As in LOUD! Real loud. The daughters fried last year and I tried replacing the fan and gave up. Who has 5V supply fans that are quiet? Not me. So I gave her my base and away she went. Until this week. And then, well, the bearings in my unit happened to go south.

In the meantime I’d been playing a lot with Arduino’s so I have built up a stock pile of parts. One is a 5V 14dba fan (40mm), the other is a DC to DC buck converter.

Take apart the base and you find a single circuit board and fan. I’ll warn you now. Getting that old fried fan out without enlarging your vocabulary is impossible. I finally took my side cutters and literally cut it out.

I wired in the BUCK converter, took leads for 12V to fan.

IMG 0240

Since I was going to run the base off a standard 12V adapter, I wasn’t going to worry about the 5V coming out of the Wii. The LED’s still work as well since the 5V output of the buck converter is supplying the charge part and the “uber” LED’s. Insert BIG WHOOP here…:-)

IMG 0242

Everything fits back in, I measured the “current” the whole thing draws. Charge and LED’s, 100ma. The buck converter is capable of 1A so got LOTS of headroom. The AC adapter doesn’t even get warm so…I charged up two controllers and the thing works like a hot damn. Not ready for the landfill yet…

28
Dec

Coin Sorting Bank – Arduino

The second project I made for Christmas this year was for my son. I got a piece of slot machine glass and he’d expressed interest in the sort of steampunk slot machine I’d made for Carol earlier this year.

However, with Arduino’s and the stuff I build with them, I try to do “one ups”. I.e. each one is unique in its own way. For Andrew I knew it was going to be a bank of some sort and therein was the clue as to what I was going to make. A bank that sorted the coins per denomination.

I spent considerable time looking at coin sorting methods on the internet. From spinning wheels, ramps and slots to commercial sorters that cost about $10 less than my last vehicle. The initial criteria was it had to be reasonably reliable and it didn’t have to sort a high volume of coins in a hopper or something. Hence, not a lot of stress was going to be put on it.

For the “proof” of concept I picked up some 1/4″ corrugated plastic and cut some slots in it that would match the coin size. I put a piece of wood trim along the bottom edge (about 14″ in length).

IMG 4886

Stood it up, laid it over at an angle and rolled some coins down it. Worked perfect every time once I found the right amount of lean and downslope. The trick is exactly that. Too much lean and the coin rubs against the plastic too hard and you need a considerable downslope to make it roll.

Too little back lean and the coin tends to roll off the front edge of the trim. I put a second piece of wood to stop it from doing that and immediately found that as the coin tried to flip back through its slot it wedged itself against the channel it was running in. Therefore my advice if you make one of these, don’t do that…

Once I had the plastic working the way I wanted, I picked up some 5/16″ birch subflooring to make a wood one out of. Plastic would have worked but wood was easier to glue to. I used a Dremel saw to cut the slots. I deliberately made it oversize so I could cut it down later.

IMG 4890

I designed it to work with Canadian coins, so in the left to right order of the slots; dimes, nickels, quarters, loonies, and toonies. I glued a trim piece on the bottom for the coin to run along and really, once you get the coin slots right, it’s simple to build.

Time to start on the main box housing. Overall size, because the display glass was so large, is 20″ x 20″ x 8″. Made out of 3/4″ knotty pine, joined with Festool Domino’s (because it’s just such a fun tool to use).

IMG 4922

Cutting the gussets to fill in the corners at the top of the glass proved to be the hardest part of the build. I think I cut about 3 or 4 sets before I finally got the indent and angles right even after measuring twice and cutting once. Which begs the frustration pix…

IMG 4923

None the less, lots of cuts and cusses later, I got the two fill pieces to fit.

IMG 4926

I’d previously used “six coin” accepters from SparkFun and I was going to use one again on this project. I have a template I use for cutting out where it goes but the mounting bolts for it aren’t long enough to get through 3/4″ pine. I ended up using a bottoming drill from the inside to make the mounting holes only 1/4″ deep. Worked perfect.

IMG 4939

Because the front glass is designed to be lit I put a backing piece of wood, 1″ behind the front glass. I mounted LED’s all around the outside (they are affixed to the frame of the box. This is the backlighting and works well.

Then it was into the shop to figure out the coin slot lean and downslope mounting inside.

IMG 4927

I used a couple of clamps to hold blocks and rested the coin ramp on it. I could then adjust it up or down as need be. A good way of doing it “before” you glue the whole thing in place. This is the first test run and I found that coins coming down out of the acceptor would bounce off the ramp.

IMG 4928

Therefore a slight coin debouncer was needed. I tried with a small piece of wood.

IMG 4930

The small piece stopped the LARGE coins from bouncing but I think the CDN dimes contain some jumping beans or something. They bounced like crazy. In every direction. Obviously a larger piece of wood was needed.

IMG 4931

The larger piece of wood worked perfectly. I also cut the top edge at an angle that matched the drop “zone” from the bottom of the coin acceptor. This dampened the bounce effect and settled the coin right down so it would begin it’s roll. I used a protractor to find the angle and I cut a wedge piece to attach to the inside back plane that would hold the coin ramp.

In the previous picture you can just see the foam board piece by the left clamp. That’s the angle piece I had measured and used as a guide.

Then, time to build the drawer. Made it out of 1/2″ plywood with the 5/16″ sub flooring for the dividers. Used a router to make the slot holes for a relatively neat fit. And no, I’m not a wood worker by anyone’s definition. More of a wood butcher.

IMG 4932

The coins in the “bank” tend to fall straight down off the coin ramp so I had to build some deflectors to get the coins to the right slot in the drawer. I probably over built them but hey, they work perfect.

IMG 4935

From the front, the project, “Lucky Larry” was starting to take some shape.

IMG 4934

For finishing, I’m not much of a stain guy. More of a glossy guy. Polycrylic is one of my favourite finishes to use so out came the masking tape and gloss Poly. The secret to working with Polycrylic is not to over work it. Put it on, let it level. Don’t go back over it, even if you see an area that “needs” it. Better to wait for it to dry, then sand lightly and recoat. I usually use 3-5 coats of the stuff and once it starts to harden, which it will do over a period of months that finish gets rock hard.

IMG 4938

After the paint was dry (couple of days I let it cure), it was back to the shop to start adding Arduino stuff. I planned for the LED’s inside the front glass but I also added TWO displays to the front. More or less to fill in the same areas on the glass that reported how much you just lost (or rarely won) in the real slot machine.

I used automotive doubled sided tape to stick them to the glass and then ran all the wires back through the inside false back.

IMG 4941

For “control”, there is an Arduino Pro MICRO (32U4), DS3231 RTC, DC-DC buck converter for 12V to 5V, MOSFET power control board for the LED’s behind the glass, 1.8″ TFT and a 2004 LCD, reset button and a piezo speaker. If you’re wondering why a Pro Micro, it’s because it has two serial ports. The coin acceptor works best on a real serial port with an Arduino, not the “SoftwareSerial” library. So I can have debugging serial and dedicated coin serial. Happy!

IMG 4945

While the front glass is from a slot machine, my “lucky larry” is simply “lucky” when you feed him. The two displays show different information. The LCD shows the date and time, plus the coin count for each of the denominations in the “bank”. So when it comes time to roll up the coins, you know how many of each type you have.

The TFT display just shows whether “Larry” is “hungry” (no money in the bank) or a running total.

Andrew had made a request before I started the project in saying that he didn’t want the glass back lighting on all the time. The best way to do that is with a lighting schedule. Therefore the reason the DS3231 clock is used. On weekdays the backlighting comes on at 5pm and shuts off at 10pm. On weekends it comes on at 10am and shuts off at 10pm. Of course it’s programmable so it can easily be changed.

Ultimately, it’s not as bright as I thought it would be. I was thinking like a lighthouse, when it fact it’s far more subdued.

IMG 4948

When he opened it at Christmas it didn’t take him long to snap a photo of it and send it to all his friends. Who replied with a rather resounding approval. I’m going hazard a guess he likes it..:-):-):-)

26
Dec

Word Clock – Arduino

Now that Christmas is over I can finally post a project I made for my daughter for Christmas. The idea started some time ago when she causally mentioned she’d like a clock for the “movie” room downstairs. At the time I said I’d see what I could come up with.

Laura knows I love bright flashy LED lights so there wasn’t a whole lot of “gee dad, that’d be nice”. More of a repetitive “has to be dim” message…LOL

I’d already built scads of Arduino clocks but I wanted something different so I had a look at Dougs Word Clocks. While not a Doug original concept, he’s done an admirable job of making finished and kit projects available to people.

As I read of how it all works, I could appreciate the fact that they are all inclusive, designed on a PCB, very neat and efficient. Albeit somewhat expensive but you also get a very stylish looking clock. Since I decided to build my own so that I could maintain or reprogram it if need be, a kit was out of the question.

The more I looked at the circuitry, I could see a number of ways to build the LED matrix for lighting up the words. Where the main stumbling block I hit was, designing the face. Laser cut acrylic would have been expensive, same for etching glass, so I opted for something simple. Essentially I laser printed two sheets of words, so basically a lot of “black” with white letters. I built a test jig for a “cell” and it worked fairly well.

The local Michaels had a big sale on shadow boxes and I was off. I picked up some 1/4″ foam board for backing, printed off the front display template and a backplane template. The backplate (foreground in the photo) shows the 1/4″ outlines where I have to fit in the foam board to make the word cells. The whole thing has to fit in a 12″x12″ frame.

IMG 4830

I glued the backplane onto the foam board to start with double sided tape.

IMG 4831

For the LED’s I decided early on I wasn’t going to use a PCB or poke them through the foam and then solder from the back. Nope, I was going to use addressable LED’s, a string of WS2812B’s. I’ve built two of these clocks so far (and I don’t have plans to make any more), and I used 110 WS2812’s in each clock face.

If you’re doing some calculations for the cost, 5 metres of these LED’s cost about $65 USD. I’m using about 2 metres per clock (60 LED’s per metre).

IMG 4832

The LED’s have a self adhesive backing so that’s what I used. I stuck them right on to the laser printed template. I tried to get the LED’s away from the cell borders but sometimes, I ended up moving the cell border a smidgen. No big deal really.

The LED’s have a direction that the signal has to pass and three wires to get it done. Vcc, GND and Signal. I ran the LED’s starting from the top left to the bottom right in a back and forth direction. So even lines all run right to left, odd lines run left to right. You can see the wires in the photo.

IMG 4833

I cut 1″ strips of foam board to act as the cells and the outside of the box. Glued it all into place with silicon, flipped it over, added a weight to it and left it to cure>

IMG 4834

If you notice the back looks oversize, it was done that way on purpose. After it was all dried, I could cut the back to size with a box knife.

Once cured, I flipped it face side up, used double sided tape on the all cells and taped the laser printed face plates to the cells. Effectively sealing them I know, but so be it. When that was done I had a working word box wired and ready for the next phase. Putting it in the shadow box.

I started with another piece of foam board, cut out the side of the clock face, and then glued the two together. I also cut a MASK of black cardboard to cover the cut so when you view it from the front it’s like the matte on a poster. Worked quite well.

IMG 4850

The Arduino bits and pieces easily fit in the space inside the shadow box. Pro MINI, HC-05 Bluetooth, DS3231RTC, buck converted for 12V to 5V, and an LDR for automatic dimming.

IMG 4852

The sketch I wrote is mostly my own. I only borrowed from other word clock sketches for one section that handles the time checking increment. I had trouble wrapping my brain around that so I looked at how some others did it and then it suddenly made sense.

IMG 4838

I tested it all out and wrapped it up for Christmas.

The Bluetooth interface let me write a Mac application that can customize how the clock works. The clock is DST aware (has to be in our area), sets the colour of the daytime LED brightness, the nighttime LED brightness, the trigger point for the LDR to signal a DIM condition. For the dimming, I only check the LDR once a minute to cut down on the “flashing” brightness changes when the light is dimming or the sun is coming up. Works well.

The sketch I wrote (uses AdaFruit Neopixels) can be downloaded from this LINK.

The Mac application requires that you first pair the HC-05 with the Mac, and then run the Word Clock software you can download from this LINK.

You’ll see two sections. One to get the Bluetooth going, the second is for the basic brightness settings, the other is for the LED colours.

Word ClockScreenSnapz001

You’ll get the current sensor reading on the bottom, and you can set all the brightness attributes you want. In real time.

Apart from that you can see the time and either a list of predefined colours or, define you own custom one. These are saved so even if your clock loses power, it remembers what it was doing.

Word ClockScreenSnapz002

So how’d Laura and Keira like the Word Clock? Apparently quite a bit and but when she first started to open the package and looked at it, I managed to snap a photo:

IMG 5086

You can almost see the thought that would mirror the look on her face. It’d be, “What in the world has dad done now…”

But as she well knows, you just never know…

24
Dec

iSniffer – 433Mhz Arduino Sniffer

While the Arduino is truly a great tinkertoy, it also allows you to build some pretty handy test gear.

I work a fair bit with those 433Mhz RF remotes. Everything from remote AC control outlets to a simple RF communication between two Arduino’s.

433mhz transmitter and receiver kit arduino project 8cfa54de 800x800

These aren’t “transceivers”, the module on the left with “ant” spelled backwards is the transmitter, the one on the right is the receiver. The best library to use with these is the RCSwitch library. Using the library has saved me countless hours of time so…use it, it’s worth it!

As it happened I had installed an RF wireless setup in my brothers truck with some LED’s hidden under the running boards. Turn them on as you approach the truck and they light up the ground around the truck. They look very nice. But we had some issues with the RF mounted in the engine compartment that still haven’t been resolved at this point (on the todo list), but I wanted to check out the remotes.

MINU BI00055 2

And since I end up briefly wiring up an RF sniffer more than a couple of times, time to build something a little more permanent. My starting list of what I wanted it to do was, as usual, more elaborate than what I was going to end up with. Again, as usual. The usual, “start big”, downsize to make it work syndrome.

First order of business, find a project case I can fit it all in. Which is actually harder than it sounds. Why? Well I wanted some smaller. So I got one of these:

IMG 5014

It splits into three pieces and I have a few of them. I figured I could put in a small display, Arduino MINI, the RX and TX, some switches, and maybe, a battery (9V). Well, I had to add some case spacers eventually but it all worked.

For the display I had just gotten some OLED .96″ displays. These are FLAT and SMALL but very easy to read. The single drawback to them is they only run off 3.3V. My Arduino’s all run off 5V. But I had some 3.3V power boards that are quite small so I used one for the power.

Usually before I start drilling holes in cases, I breadboard the whole idea and write the sketch to make sure the thing is going to work. Every wonder what that looks like? Wonder no longer. Here it is in the complete ugly that it can be.

IMG 5015

Notice that’s an UNO, not a MINI Pro? Yeah, both 328P chips so if it works on one, it’ll work on the other. Interestingly, the compiled code on the UNO is 23K, whereas on the Pro MINI, it’s 18K. I think it might be because the MINI Pro has no UART/USB interface on it. Maybe. Could be. Sorta.

You can see the TX on the breadboard, the OLED barely standing up, the RX on the bottom right. Yep. Proof of concept.

I also wanted to incorporate IR decoding as well. That wasn’t to be. It drove the RF unit nuts. I’m guessing the interrupt pins. So it got removed. Another project…:-)

For a custom faceplate, off to Google Images, find some picture, laser print it, laminate it, cut it out.

IMG 5017

Then put double sided tape on the front of the project box.

IMG 5019

Then stick it to the front of the project box:

IMG 5020

Inside the box, the layout of parts, cramped sort of because there’s no PCB board to hold all those bits and pieces… at some point when all the wires in there it looks like what’s left following two drugged crazed spiders mating ritual. But you make it fit.

IMG 5022

As noted, I did have to add two 1/4″ spacers in the box. While all the Arduino parts fit, it’s the battery (a single 9V) that uses all the room. Durn. Batteries. A pair of AA’s or even a couple AAA’s on an Arduino running at 3.3V wouldn’t help much. Batteries simply take room.

IMG 5026

There’s the finished project. Kind of looks like an alien with the two antenna out the top… Controls are equally simple. A power switch and a rotary encoder. If you look closely you can see a good example of one of those two colour OLED’s. Yellow on the top, blue below. And no, you can’t specify the colour, it’s the way they are built.

So in operation, the iSniffer sits there waiting to detect some RF. When it does it decodes it, tells me the decoded number, bits, and protocol. It also saves up to the 10 last codes it received so you can use the rotary knob to select one, then click it and it will transmit that code. Really handy for testing since you now have TWO remotes to work with.

One of my concerns when running on battery is “how much power”, as in how long will the battery last before it drops dead. So I always measure the current drain. With just the heading on the OLED, the draw is 26ma. When I get the RF information the draw is 33ma. Why does it change? Simple. OLED is an LED display that lights up some LED’s and the more you have on, the more current is required. Which in the great scheme of things isn’t much, but still, be aware of it.

So what happens when I key the transmitter? I had prepared myself for a huge power drain. I have some other RF units and some Wifi ones that pull upwards of 200-300ma when transmitting. A 9V battery would last, oh, in full transmit on those heavy draws, probably if it didn’t over heat, perhaps an hour. Tops. Maybe.

For iSniffer, what happened caught off guard. The current draw went from 33ma to 39ma. Typical 9V battery likes draws of about 15ma and has a capacity of 500ma. So you get a few continuous hours out of it. At my 30ma, if I get 9 or 10 hours out of a battery I’d be pretty estate. I’m only using it for minutes at a time so…this is all good news.

20
Dec

Lite_Mate – LUX Meter

Something that I have needed for a while is a decent LUX meter. I have one of those off shore jobs that’s supposed to measure something, not exactly sure what that would be but I’m going to hazard a guess it’s not LUX.

I ordered two AdaFruit sensors. The first is a TSL2561 and it senses light in both the IR and visible spectrum therefore it responds more accurately to the light us bipeds are accustomed to. Plus the reading given is calculated LUX. Perfect!

I’m not sure why, but I ordered two of these sensors and it’s a good thing because one was defective and Adafruit stepped right up and replaced it. I know, Adafruit’s products are not exactly as cheap as some of the stuff off eBay, but I’ve been making more of a point to purchase from them when it’s not a large difference. I like the fact they stand behind their products.

The second sensor is a UVA/B sensor. It’s a simple analog sensor where you simply read the voltage out to find the “UV INDEX”, or at least that’s what I thought. I was close, but no cigar.

Turns out you need to do some math to get the UV index that we’re used to in the media. And the formula is simple enough:

 sensorValue = analogRead(0);//connect UV sensors to Analog 0  
 UVindex = (sensorValue*5.0)/102.4;// needs to be scaled to the supply voltage (5.0)

Simply put the sensorValue * (working Vcc of the Arduino) / 102.4 and it works just fine. Took quite some time to figure this out too, would be been a lot easier if Adafruit had mentioned it or written up a sketch for us mere mortals.

For the remainder of the project I used an Arduino Pro MINI, the 0802 LCD that I wrote about in a previous blog entry, an I2C interface for the LCD, pushbuttons and a power switch. I run the whole thing off a 9V battery and it draws 20ma. I wired one of the pushbuttons onto the LED pins on the I2C board attached to the 0802 display. Normally on these backpacks there’s a jumper so the LED has power and you control the backlight with software.

IMG 4997

I decided that I’d enable the backlight right off in my sketch but use the pushbutton to actually deliver the power. Works nicely this way and only increases the current drain by about 12ma. The green jumper in the photo is where the N/O pushbutton is connected.

When building projects, I like to do finished projects. At one time I was just mounting the Arduino’s on breadboards and jumper wires galore. But that gets messy and it doesn’t feel right. I try to finish off my projects with a box and nice face plate.

Therein lies one of the issues with projects. Namely that faceplate. I’ve tried water slide decals, REPRO film (laser print colour on it and it has adhesive on the back), which means I have to spray paint the faceplates with some background colour then decal them up. Then clear coat them to protect the decal.

My experience with water slide decals is I don’t like them. The self adhesive transparency does work, pricey, but it’s prone to bubbles and you kind of get one chance to align it. Unless you have a white background colour, getting any printing to show up is tough…

What I’ve ended up doing was printing via my colour laser (I’m not an ink fan either) on 24lb Xerox super bright (98) stock, cutting out what I want, then using 1/4″ thin double sided tape to stick the paper on the project face. Looks fairly decent.

But…and this is a big but, it’s still just printed paper and can tear, cut or whatever and then it’s ruined. Obviously something better had to be done.

Tonight that got me thinking and for a lark, I thought I’d print the same way I’d be doing but this time I use my document laminator to cover the paper in a plastic jacket. Then I’d cut out what I needed and see how it looks.

Well, this is what I’m going to do from now on. It’s easy to see in the photos of the cutouts I made so I didn’t have to disassemble the face plate to put the printing on. I just cut around the controls and none too neatly at that since this is more of a proof of concept.

The photo doesn’t do it justice but the picture looks great, the plastic gives it a glossy finish, easy to label, and with the plastic laminate on it, protected from tears and so on. I used the same thin double sided tape to affix the “decal” to the face plate.

Now that I know this works and looks very presentable, I’ll be designing and building face plates like this for the future.

IMG 5009

16
Dec

LCD 8 x 2 – Arduino

When working on Arduino projects I tend to like to use some sort of display to indicate the state of things, as opposed, say, to a bunch of LED’s that might perform the same job.

Thus, LCD’s are great at presenting information in a way that is easy to absorb. The standard Arduino LCD’s are the 1602, 1604, 2002, 2004. Where the first two digits are the characters on a line of the display and the last two are the number of lines on the display. Generally there is a backlight on these displays and depending on the size of the display, those LED’s they use for backlighting can take some sizeable milliamps.

Alternately, sometimes even a 16 x 2 LCD is too large or not required for a project. While surfing eBay a couple weeks back I came across some 8 x 2 LCD displays. That’s 8 characters by 2 lines. Not a lot of course, but adequate for a little light meter project I was working on.

IMG 4985

IMG 4986

You can see from the photo’s these are your typical 16 pin parallel connection LCD’s. So yeah, a whack of wires between them and the Arduino. While I was pondering whether or not to press one of them into service, I received some OLED displays. The .96″ blue ones.

OLED

Took me a little bit to get the OLED working with I2C (address turned out to be 0x3C not 0x3D as the normal libraries use), but once working it’s obvious they are TINY but very legible.

I am building a LUX meter so battery operation is a must. I, incorrectly, assumed that the OLED display would be far more efficient than the plain old 0802 LCD I was contemplating. Notice I said, incorrectly. I connected up each of them to an ammeter and checked them out. Turns out the OLED current demands varies about 30 ma depending on how many LED’s are lit up. Where as the LCD, if you turn off the back light and just use reflected light, actually draws less current. Never would have seen that one coming.

So I had to weigh out some pros and cons of each. The OLED was easy to see in bright light (tended to wash out a bit), printing was extremely SMALL (but clear), the LCD in bright sunlight was easy to read (just turn off the back light) but it was parallel so a billion wires.

If the LCD had a I2C backpack on it, that would have made it more appealing. But wait…I had recently found a bunch of I2C backpacks on eBay that were mislabeled (advertised as keyboard interfaces) and being sold for peanuts.

IMG 4988

What would it be like if I took all the headers off the backpack and put my own headers on plus added all the pins for the extra I2C so I could also connect in the TSL2561 light sensor. Yep. That’s exactly what I did.

IMG 4996

First I did a “trial” run to see if the pin out on the LCM0802C was the same as what a backpack expected. I started at pin 1 on both and just ran jumpers from the backpack to the LCD. Then I noticed that it took 12 wires (middle four on the backpack don’t go anywhere). So the backpack uses 4 bit mode.

IMG 4992

A quick tweak of the contrast control on the backpack, I used an LiquidCrystal_I2C.h library, defined as 8×2 for this display and I was looking at:

IMG 4991

The Arduino UNO, backpack and LCD was drawing 70ma. Not too shabby! If I wasn’t interested in too many hours I could run it with a 9V battery (they typically put out 500ma but like about 10-20ma of drain). I could save another 20ma with the backlight off.

The wiring looks like this now.

IMG 4997

I have a 4″ Dupont cable, took 12 leads and split those into two groups. You use pins 1-6, and 11-16. Wired in a female header on the backpack and a 90 degree 16 pin on the LCD. So the leads stay flatter against the LCD.

View from the flip side:

IMG 4999

There is about 4″ of wire there but if I want, I can fold it up like a stick of gum to shorten it. And lots of pins for connections to other I2C boards.

It all worked out pretty well but if someone wanted to Fritz a real backpack for the little 0802’s it would be really sweet. For now, this isn’t all that elegant, but it works. First important part.

9
Dec

eMail Buddy – CC3000 – Fail

I’ve been reworking my eMail Buddy that I started on last week. I think I’ve tried just about every configuration with every piece of shield/hardware for networking I own.

The last effort was using Adafruit’s CC3000 WIFI shield. Updated with the latest firmware. Unfortunately it’s a big fail too.

While the CC3000 initializes fast enough, obtaining a DHCP address is glacial in comparison. 10 to 50 seconds and that’s even with my router assigning the IP based on the MAC address of the CC3000. I tried different brands of routers, and regardless of what I tried, DHCP is still amazingly slow.

Couple this with the fact that the CC3000 wants to connect at the lowest speed it can, like 802.11b, which went the way of the dins during the last ice age. Plus the CC3000 will simply drop off the network for whatever reason usually with 48 hours. Getting it back on is more easier if you do a warm reboot, because a cold reboot takes a number of times before it reconnects. It stalls at the DHCP portion.

The library from Adafruit I think I read was subclassed from the print library not the stream library. So until that was addressed recently one couldn’t use TextFinder with the stream. This severely limits the usefulness of the CC3000 so I was happy to see they addressed that oversight. However, it’s not all quite right since I was unable to implement FindUntil for progressive searching. Something is still amiss there.

At this point, I feel much like Edison. I know yet another way WIFI things won’t work…LOL

I finally threw in the towel and dropped in the ages old Wiznet 5100 ethernet board and connected to a nearby wireless bridge. Yeah. IP in a heartbeat, DHCP in half a heartbeat, online in seconds and checking email headers like a champ. Reliable as always.

Of course the ethernet library for the Arduino is extremely mature so it’s not really fair to compare it with the CC3000 library. The ethernet library also works flawlessly with Textfinder on the stream.

There’s been a lot of Wifi “solutions” appear in the last few months but I feel that most of them are WIP (work in progress). I suspect some of them will mature to some point, maybe even to be a valid replacement for that old ethernet board.

I should also mention that I’m hardly upset with the fact that the CC3000 from Adafruit is a dismal failure for my needs. Sure it’s not exactly cheap, but support for it is very good, Adafruit does the best with what they are given by the company who makes the CC3000. The best I could hope for it is that it works. But having said that it’s new technology and when you’re on the cutting edge, sometimes you just need a decent supply of bandaids…LOL

In a limited use, I think the CC3000 would be adequate. Say small data packets, a few times a day.

Maybe the next driver/firmware update will help it some, providing the CC3100/3200 doesn’t push it aside.

4
Dec

PowerCurve

I always seem to have a problem with power bars. And AC adapters. Specifically if I buy a 5 outlet powerbar I can fit 3 adapters in it. And waste two outlets.

So at HomeDepot the other day where I’m shopping for yet another power bar, which incidentally are nothing more than multi-outlet extension cords, I see this:

PB

Where I am putting it, I don’t need the USB outlets, so I noticed a SEVEN OUTLET version. For less than the USB one!

Judging from the ads, the USB version is the popular one, so I might just head back to HD to pick up another “non-standard” one…

At any rate, the outlets rotate so you can fit just about any combination of wall warts onto it you can imagine. Put in the plug, turn it to fit (it clicks as you rotate it) and wow.

A well thought out concept. For a change! I give it a 10, a good solid 10!

3
Dec

Wifi, Arduino and SPI, oh MY!

The email checker I built two years ago, much to my surprise, is still ticking along. Running an ethernet shield, UNO and three LED’s. It checks my email account for specific emails and alerts me if one should appear.

Is it perfect? No. Why not? Well it’s not an Arduino problem, it’s because it checks once a minute, but if my main office computer grabs my mail during the minute lapse time, my little checker never sees it. So I’ve missed a few alerts. Not mission critical.

Of course I could leave the email on the server until I delete from my email program, but I choose not to. That’d be too easy…

But ethernet is one of those, okay it works, but it doesn’t like sharing itself with any other SPI devices because it’s not built to do that. I did find that Elecrow’s Wiznet 5200 would share with other devices on the SPI buss, but it’s kind of hit and miss for connecting, for whatever reason.

For the last year or so I’ve had my eye open for an affordable Wifi thingamajig. And hopefully one that’s reliable too.

Naturally this invoked the old trilemma clause:

  1. Fast
  2. Economical
  3. Reliable

Pick any two.

Earlier this year I ordered a CC3000 from Adafruit. I’m using their libraries and hence I try to support them when I can. At the time I ran their test sketch and it worked perfectly.

But I could never get it to do much else and it didn’t work with TextFinder so parsing a TCP stream was a pain.

Recently Adafruit updated the firmware (twice) so I installed 1.1.3 (I understand that update 1.1.4 might be here in a couple weeks). Before the latest firmware update, the shield would work, for a day or two and then fall asleep or something and disappear into the digital abyss. Buffer overrun, mDNS, or some problem. A MEGA has way more SRAM than an UNO does and I suspect they assume most will use an UNO or something with the 2K limit. Simple matter to change the buffer sizes for a MEGA though.

With the 1.1.3 firmware, I could get a good connection, I could connect via TCP in the main loop, check my email, and do that every minute reliably. And Adafruit managed to get the newest version of their library working with TextFinder. Although if I tried to do progressive searches through the single email header with TextFinder it didn’t work properly as with an ethernet sheild.

According to what I read on the Adafruit forum, their library uses the Print class, not the Serial class and therefore Stream and TextFinder were not there from the onset. But it is now so fabulous!

Always on the lookout for good project boxes, I noticed that eBay sellers had some acrylic cases for their 8x8x8 LED cube matrix kits:

Cube Sheel

Certainly big enough to hold a MEGA and any display I could fit in there… While it would have been nice to have a spiffy looking TFT display in there, the more I tried to do it, the more I could see it wasn’t going to be easy, if at all. Not sure which Adafruit CC3000 I have but I assume it’s the one without the isolating buffer. Which of course means I could have built my own I guess but what the heck, I admit it, I took the easy way out. Just used a 2004 LCD.

I used double sided tape (which in hindsight might not have been the brightest thing to do because the stuff sticks really well) and mounted the MEGA and CC3000 shield on the back:

IMG 4954

That thing at the top right is an I2C backpack for the LCD. I’m a huge promoter of those to make easy connections and save Arduino pins!

To make a nice looking front for the case I use some foam board with a hole for the LCD:

IMG 4959

A little more double sided tape but not the uber automotive stuff, a printed front to make it look like something and presto:

IMG 4962

A good looking amateur project…

IMG 4963

For the email “alert”, I didn’t put in a buzzer or anything, instead I used some NeoPixels. WS2812B and the more I use them, the more I like them. Adafruit has a fabulous library for them. So depending on the email, I can have any colour(s) flashing and even with that full printing on the front, the rest of the box lights up extremely well. Hard to miss anyway.

The finished project sits in the family room, along side some of my other projects. Time will tell if it’s as reliable as the older Wiznet 5100 on a UNO that it’s replacing. But I got my fingers crossed!

IMG 4967

Note: the holes in the front of the display case were from the TFT that I so desperately tried to make work)…better to use foam board….lesson learned.

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.