Skip to content

Posts tagged ‘electronics’

7
Oct

Telus PureFibre Experience Hit and Miss

ISP providers are jumping on the bandwagon with promises of speed, and ah…well, speed. Because there’s not much else they can bring to the table as far as internet goes.

Of the two local providers in my area, Telus and Shaw, both have hooked up their teams of Clydesdales to the speed wagon.

So the first thing I’ll say is the one you ultimately pick will be the best one, “in your area”. That’s right. In your area. Where I am Telus can provide the better connection speeds and maintain that throughout the day. Shaw, well, I can tell when the kids get out of school, or it’s bed time for the masses because that’s when the internet speeds pick up again.

Plus the internet is all I’m interested in, TV is about as interesting to me as watching paint dry.

Internet Speeds – Simplified

At first glance, 150Mbps (mega bits per second) sounds nice, but what caught my attention was the 150 Mbps speed for sending (uploading). But before we have a look at those “big” numbers, let’s take a look at some real world translations.

The first and foremost is the Mbps vs MB/s… so 150 Mbps is 150 mega bits per second. Sounds really fast.

We convert that to what we really understand and that’s a BYTE. A single digit, letter, value. Thus in the word, “tart”, there are four characters or bytes, each of those bytes is made from 8 BITS. To send or receive the word “tart” we have to send or receive 32 bits (4 x 8 = 32).

Therefore 150 Mbps = 18.75 megabytes (bytes/characters) per second. In math, take the Mbps and divide it by 8 to get MB/s.

Why is this important? Assume for the moment you’re using some cloud storage and you have some rather large video files that are going to be uploaded. Video files can be rather large so if you check the properties or info on the file, you’ll see the size of it in “megabytes”.

To illustrate take a single 22MB video file and here’s the absolute BEST time it will take to upload to a cloud or some online server:

Advertised Mbps Speed – real MB/s – Time

  • 15Mbps – 1.875MB/s – 11.73 seconds
  • 25Mbps – 3.125MB/s – 7.04 seconds
  • 50Mbps – 6.255MB/s – 3.52 seconds
  • 150Mbps – 18.75MB/s – 1.17 seconds

As you can see, if you only spend time downloading from the net, then yes the 150 down is nice (OS updates download much faster), but if you’re sending out cloud, backup or server files, VPN, then 150 uploading starts to become a lot more important.

Hence, what you can best use is heavily reliant on what you do on the net.

Telus Pure Fibre – Street

As opposed to impure fibre perhaps? Maybe fibre optic (which they tend to spell as Optik) makes it sound more trend setting.

I tend to send out a lot of data, so having some speed for sending is quite attractive to me. Secondly, to go from my current 50Mbps service to 150Mbps was only a Starbucks coffee difference in price. What’s not to like about that.

Telus has been busy installing fibre in our area for quite a while now, and eventually they showed up and asked if I wanted it put in from the box across the street to the house. Considering there is a conduit with their copper wire in it, they have a multitude of excuses of why they won’t use the existing pipe. Things like ground heave, tree roots, alignment of the planets, truly some of the lamest excuses I’ve ever heard.

To cut it to the bone, time is money. It’s faster and cheaper for them to simply use a pressure washer/vacuum sucker to carve a 3″ wide trench across your lawn to your house to lay in their own cable system, than to do it neatly. To their credit they do fill it in and use what looked like 3Kg of lawn seed. It’s grass, it’ll grow back.

Fullsizeoutput 2b99

But they should have seriously thought this out a little better. Nah, a lot better. Some bean counter no doubt got a raise over floating this one out there.

None the less, I’d suggest if you have to have this done, make sure it’s when the grass is in growing season. It’s going to take a while to regrow.

Telus Pure Fibre – House Outside

Not exactly sure what beers or drugs the mental midgets were on that installed the box on the side of the house here, but they jammed it so close to the original copper phone line box that you can’t open that box any more. Which, as I see isn’t my problem because it’s a Telus box.

The first phone service installer that is forced to work in the box is going to enrich their vocabulary. A lot. Meh. Too bad.

Telus Pure Fibre – House Inside

Once you ask for the inside installation, you’ll get a visit from an “installer”. If you have some preconceived notion of how you’d like it installed, you have two choices. First you can forget that idea right off the bat, or you can stand your ground and don’t budge. Might mean you don’t get installed though.

Remember they aren’t doing this as a service to you. They are doing this to make money. If that happens to benefit you, that’s just icing on the cake.

The installers are paid by the install, not hourly. And I can fully understand why that would be (there’d be those who would work well and free loaders who would milk it like a dairy farm).

Thus, the installer wants to take the shortest route, has all kinds of excuses why what you want to keep things neat won’t happen. Stand your ground or tell them to buzz off.

For the gear you need to have connected, there’s the ONT box that receives the fibre cable, from there an ethernet cable to the Actiontec T3200 modem/router.

We have a very accessible crawl space (it’s 4ft high in there), the installer wanted to punch a hole in the living room wall. I wanted to use the furnace room in the center of the house. Apparently too much work for the little guy.

My idea was once in the crawl space, it’s quick run to the center of the house where the furnace room is, power and bingo. Out of sight, and neatly done.

Since the living room isn’t used that often, we finally decided to use the corner where all the wiring for the house is any way. Yeah, I caved in, my fault…sigh…

Fullsizeoutput 2b9a

Ultimately it’s not bad. We have a plate on the wall for the fibre and coax cable (more on that in a minute), the big white box is the ONT. Yellow ethernet wire from the ONT to the modem/router. If I tossed the thing out, I’d have to fix two small screw holes in the wall that hold the ONT in place.

What struck me as rather stupid is that Telus doesn’t supply a proper wall plate for fibre or coax connections. The big white cable you see sticking out of the wall SHOULD be mounted properly with a terminal and right angle connector so it doesn’t stick out in the room. So this half baked plate should be shoved up some bean counters butt. And rotated every now and then until they get the message.

Telus Pure Fibre – Inside Drops

As I said previously there’s some COAX cable involved. Cable like your cable company uses for your TV. Umpteen years ago when the house was built we were pre-wired for TV so coax all over the place. The junction box sits 6″ away from the Pure Fibre box. The box and cabling hasn’t been used in years since we don’t use cable TV.

The room where the computers live is at the far end of the house, they take a COAX cable from the router, hop out to the cable box outside, use an inline coax connector that goes to the room where the computers are.

Once there, they supply an Actiontec MoCA ECB6200 adapter. It converts from coax to ethernet.

Fullsizeoutput 2b9b

The wall plate has a nice connector on it, but Telus again, in their infinite stupidity doesn’t provide a right angle connector for the coax line so it sticks out into the room. At least they give you the ECB6200.

If you’re thinking that wires could be avoided altogether since the T3200 has wifi, be aware that that 150 promised speeds are only feasible if you are using a direct ethernet connection. Wifi may, or probably won’t be able to achieve the higher speeds.

Lastly, if you have multiple computers where the MoCA adapter is Telus doesn’t give you a switched hub for connection. They only supply ONE ethernet connection. Again, rather short sighted of them, but makes for a happy bean counter.

Fortunately I have a well equipped network stash so I used a five port ethernet gigabit switched hub to connect up the 3 computers and one printer needed.

Telus Pure Fibre – Range Extender

Telus no doubt realizes that their Actiontec routers/modems Wifi distance can be measured with a yardstick. Having said that the installer left me with a Web6000Q range extender. And casually mentioned it would give me two wifi networks in the house.

I kind of missed that comment, but later realized that Telus is again in the bean counting business, not evenly remotely interested in customer satisfaction.

A range extender is supposed to mirror the main wifi name, switching between 2.4Ghz or 5Ghz and handing off so you always get the best signal. As in the most speed. Bang for the buck.

With the Web6000Q, the web GUI has the settings to do this, but the firmware in the model (as of July 2017) doesn’t support anything of the like. You end up with three networks. Three? Yep. The T3200 creates a 2.4 and 5.0 and hands off to the one in itself that gives the best speed. The Web6000Q creates a different 2.4G and 5G network with different names, in spite of the setting no hand off at all.

Eventually this oversight might be fixed in firmware, or not.

During my tests, my Apple Airport Extreme with the 1T drive had 15% more signal strength and better throughput than the 6000Q. Go figure. So the Web6000Q sits on a shelf.

Telus Pure Fibre – Install Overall

What I wanted was a fibre line through the crawl space to the furnace room, a return coax line to the coax junction box outside, from that coax box, a coax to ethernet adapter in the three areas of the house where the computers and internet devices live.

I’ve seen photo’s of other installs, which is largely reflected by the installers willingness to put in something they’d want in their own homes, and if a third rate install is acceptable to them they need to find a different line of work, I’d give my own install a C-. Below average if you will.

Of course I’m using my own ruler to measure the install, and I know how to install. For others who don’t, I wouldn’t want them to be taken advantage of, but I know better. Time is money.

On the other hand, I have the ability to fix the half baked effort so it’s not earth shattering to me. I know what I want and I can do it myself.

Telus Pure Fibre – Speed

Finally we get to what we wanted in the first place. Speed. After all, that’s what putting up with all this crap was about in the first place.

And oh boy, do I have speed.

Telus said 150Mbps, I’m easily pushing 175-180Mbps. And you wouldn’t think a lot of things would be noticeable, but they are. Web sites tend to load that little bit quicker (web sites are the slowest go because of all the links buried within them), but cloud/ftp/email/streaming absolutely scream. We used to wait a little bit on Netflix for a movie to start, ah yeah, not any more. Instant.

Sending video files to my server, wow. What used to take minutes takes what seems like seconds. I have to actually check sometimes because it sent so fast.

OS updates for the computers, those are almost a gigabyte every time. What used to take 5 or 6 minutes now comes in under a minute. It takes way longer to install now than it does to download….

Online backups actually have some speed to them.

The installer showed me a photo of the local box our area connects through. A huge box with a lot of connections in it but presently it has exactly one. Mine. Apparently we’re the first one in the area to get Pure Fibre installed. So our speed might change as more jump on board. Or not. Hard to say.

Summary

That’s my experience with all the facets of getting 150/150. As I said it’s a few bucks more than what I have now so the money is not even in the picture. The speed is a welcome change, but again that’s because I send out as much as I receive some days. So the extra upload speed is what I want.

The installation, well, it’s not pretty, it is fairly neat, slightly dysfunctional in that it could be done much better for better coverage in the house. The grass will grow back in.

Would I recommend Pure Fibre? No. As I said at the on set, you have to look at what works best for the area where you are. If that be Telus and you get a good install, great.

Me? Yeah, I’d do it again, but I’d get it installed the way I want, not the way they want.

4
May

Ole Mega Ain’t What She Used To Be

The Arduino Mega2560 has been around a long time, at least in the world of micro controllers. Since 2009 so it’s not the new kid on the block by any means. In that time we’ve moved through to R3, revision 3, and it has been a robust hard working reliable platform.

Right up to the point that someone with the IQ of a stump decided to dump the ATMEGA 16U2 and incorporate the cheaper CH340G USB to serial mangler. In most cases, this piece of digital cruft will work. But there is no comparison if you lift the hood or try kicking the tires.

ATMEGA 16U2 VS CH340G

It’s decidedly easy to spot the CH340G, at this point. Course if the same low life decides to change the packaging it’s going to be a little tougher. In the photo, and probably what you’ll see more of than anything else is the one on the left with the CH340. It’s a 16 pin DIP package.

ATMEGA CH

I feel the CH340 has but one goal in life. It pollutes Arduino boards, and it converts from USB to Serial and back.

On the other end of the spectrum, the ATMEGA16U2 is a microcontroller that firmware can be programmed into. Thus you can change the firmware and your computer will think it’s connected to a mouse, joystick, or keyboard. This is impossible to do with a CH340G.

An Arduino MEGA with a ATMEGA16U2 is plug and play for the most part. Most computers will recognize it in a few seconds after you plug it in.

The CH340G on the other hand, requires a driver to be downloaded and installed. Because of its brain dead nature, no computer is equipped to communicate with it unless that driver is there.

From what I can see, there is little price difference between the two but the ATMEGA16U2 is far superior. It might take a little more time to program the 16U2 to be a UART, so perhaps they are more intent on saving time than a users sanity.

The Sheep In The Closet

If you’re thinking, big deal, doesn’t matter to me, it might, depending on what you want to do with the MEGA.

For example, let’s say you want to do some blinky lights, Neopixels, TFT/LCD display, or some sensors. No big deal, it’ll work just fine because the 2560 chip is doing all the work. The 340G is just the way you program the 2560.

On the other hand, let’s shove a RAMPS board on it, upload some MARLIN firmware to it and then connect to it and run our 3D printer. At a high baud rate. Where a LOT of printers like to live. Specifically 250,000 baud. Don’t be surprised if you see messages from PrintRun like this:

Connecting...
Attempted to write invalid text to console, which could be due to an invalid baudrate
Attempted to write invalid text to console, which could be due to an invalid baudrate
Attempted to write invalid text to console, which could be due to an invalid baudrate

Say WHAT? You might not see that with Repetier Host, because it tends to filter out stuff it doesn’t understand so you don’t get junk in the monitor. But you can still see some “resends” because it didn’t understand the last thing it received.

The issue truly is the baud rate. According to the “data sheet” for the CH340H:

CH340 supports common baud rates: 50, 75, 100, 110, 134.5, 150, 300, 600, 900, 1200, 1800, 2400, 3600, 4800, 9600, 14400, 19200, 28800, 33600, 38400, 56000, 57600, 76800, 115200, 128000, 153600, 230400, 460800, 921600, 1500000, 2000000 baud.

Notice there is no “250,000” baud rate in that list? The closest is 230,400.

So many have tried to just code in the 230,400 and use it. And found themselves with errors that just don’t make sense…dropping to 115K baud doesn’t help much either. Marlin’s default with RAMPS is 250K.

I have tried different baud rates and met with poor results so I leave it at 250,000 and it works best on a ATMEGA16U2.

The reason for the 250K was the ATMEGA16U I suspect. The divider of the UART of the AVR (ATMEGA16U2) used in the Arduino can create 250000 without an error, while 230400 has a 3.5% error in clock. Even if 250000 is itself a non-standard baud rate, it just works.

CH340’s Arrggh.

Solution?

The biggest problem is places like Amazon and eBay. Type in Arduino MEGA2560 R3 and you’ll find correct images of an R3 board but a wrong description, images showing a CH340G but all the ad text describing the ATMEGA 16U2, and any combination thereof.

Asking the seller if it’s really a ATMEGA 16U2, I’ve found out (the hard way) is pointless. The mass majority have no clue as to the technical specifications of what they sell. Some will tell you what you want to hear and send you the wrong thing any way.

I don’t think it’s a case of bait and switch, it’s more just a case of blissful ignorance.

So you’re left with getting someone to take responsibility for what they sell. Or trying to find someone who actually knows what they sell. Either way, it’s a path that shouldn’t have be ventured down. Sadly, it’s turning out to be a path all to common.

28
Sep

Wi Fi Fo FM

I’ve had a cheesy FM radio over the work bench in the shop for a considerable time now. A simple FM radio that can play a memory stick, runs off 5V, maybe 3 watts of audio power. Big maybe actually…

To use it you can smack a bunch of tactile buttons or an IR remote. When I can find it.

Wandering through eBay a while back I came across an FM radio, that looked a little better than my previous “cheese special” but what caught my eye was the “serial control” option for the radio. There is no card reader or USB port so it can’t play from a memory stick. But I rarely did that any way.

The radio itself isn’t much bigger than a standard sized business card. The usual jacks give you power in, speaker outs, a serial connection port and something labeled GRSV which I have no idea as to its purpose.

IMG 1759

There’s a blue LED backlight in the LCD display and the display is quite difficult to read at any angle other than straight on.

The eBay listing gave the basic serial port config (9600, 8, N, 1) and you send commands like AT+FREQ=1035 with no line endings to direct select a frequency. Which to my shock and surprise works quickly and seamlessly. There’s even a squelch setting in the radio so you can “omit” weak stations if you’re doing a seek up or down.

In reference to “seek”, the radio does not scan through the band and store the stations for you. That wasn’t why I wanted it any way. I normally just flip around between a few stations until I find something tolerable to listen to.

The FM radio works best when you power it from 3.3V, but it will take up to 5V. I found at 5V it got a little noisy at times, whereas at 3.3 it was better behaved.

I’ve found no way to have the backlight on all the time, in spite of others who outline a procedure to make it do so. But I don’t look at it much any way.

I had an old set of Apple speakers from an aged iMac. Put some Dupont connectors on the cables, shoved them into the FM board and they work really well.

IMG 1763

There’s no fancy EQ, if you can call what passes for EQ in these budget things an EQ any way. Sounds nice, that’s all I care.

The MOST annoying thing about the radio is fact that the knobs work backwards. Turning them clockwise decreases the volume or the frequency. I think who ever drew the PCB was either mounting the rotary decoders from the rear or with a jumper cable. So I modified mine to work like it is supposed to.

IMG 1760

Took all of 5 minutes. Works perfectly this way too.

For serial control, you can test things out with a USB to Serial adapter (keep the voltage at 3.3V) but I wanted Wifi control so I don’t have to go looking for a silly remote, I can turn off the radio from the network.

The simplest WiFi control I’ve used, over and over, is the ESP8266’s. Either as stations or access points. Great little work horses. And cheap as borscht… I used a Lolin version 3, with the cruddy CH340G on it for usb to serial and programmed it with the Arduino IDE.

IMG 1762

I didn’t use the RX/TX since that’s the USB serial connection. To keep the separate i used the Serial.swap() command. This moves the 8266 TX/RX to pins D8/D7 respectively. Ran those to the FM radio’s serial TX/RX and it works like a charm for control. In the sketch for the 8266, I hard coded in the FM stations I wanted.

Type in “radio.local” in any browser on the network and the radio shows up (it has MDNS or Zeroconfig as some call it). Pick what you want, away you go.

Radio FM Web UI

The buttons labeled Radio ON/OFF are not actually power ones. They are the MUTE controls for the radio.

The volume goes from 0 to a maximum of 15, and with a 3D printer running in the room, about 7 is good enough. With the printer off, 2 or 3 is ample for background music. According to what I read if you run the volume fairly loud, the two IC’s on the back for the amp tend to run hot so a heat sink for them is advised. At a setting of 7, they don’t even get warm.

Last, there is a place to solder in a wire for an antenna, and true for some stations just adding a few cm’s of wire helps reception. However for the most part the radio is quite sensitive any way.

One of the things I would have liked would be for the radio to have RDS (that’s where they broadcast the station name, and the song title; buried in the music broadcast itself). The radio IC in use has it, but the PIC chip that is controlling it obviously doesn’t support RDS. Which may not be a bad thing anyway since I’d have to put a full display on the radio so I could read it. Once in a great while…

A cool little one afternoon project that I’ll have to print a box for after I’ve tested it out for a while…

15
Feb

Fan Noise

One of the benefits of owning a 3D printer is that they encourage endless amounts of tinkering if you’re so inclined.

One of drawbacks to owning a 3D printing is the same reason.

Truthfully, I have spent a magnitude of time doing everything from software hacks in the firmware to compensate for the inaccuracy of the printed parts, adding bling to it like power supply hangers; job timers; wireless control, to sitting in front of it just watching it print. Which, in some cases has more value to me than whatever might be on the TV at the time.

When I get too focused on some aspect of 3D’ism, David, one of the local FVMakers tends to be my voice of reason and sanity. I think he missed his calling as a Kossel Owner Therapist.

However, there has been something that has annoyed me from day two. Keywords there, DAY TWO.

Day one it didn’t, I was just happy that it barfed some PLA out of the nozzle at that point.

Therefore as the topic of this blog post points out, noise. Specifically fan. As in power supply cooling fan. BOEING wind tunnel. Shuttle launch.

I have a couple of 12V 30A supplies so I took the one apart that wasn’t in the Kossel. Found it’s a 6015 fan. The 60 is the size of the fan, 15 is the depth, 60mm x 15mm. What floored me was the working voltage 14VDC. Now what engineering resume polisher would use a non-standard voltage fan like that? Try to find a source for them. Right. Good luck with that.

That shelved the idea for a while and then, well, noise is noise. It started to bug me again. You know the old saw, “The squeaky wheel gets the grease.”, I just changed that to, “The squeaky wheel gets replaced”.

This time I took the power supply off the Kossel and opened it up. Incorrectly I’d assumed that 360W supplies would all be relatively the same. Nope. The one I took off has a [insert drum roll here]…12V .11A fan. Standard. I suspect this engineer still has his job.

Power Supply Fan Replacement

Now, if I’d have found a 14V supply for the fan in the power supply, I’d have wired two silicon diodes in series with the positive side. At .7V drop per diode that would have dropped it within the 12vdc fan working range.

The replacement fan I got is a GELID Silent 6 fan. These have hydro dynamic bearings instead of the usual sleeve bearings. So longer life, lower noise. The GELID is rated at 3400 RPM, 16CFM, 24dBA. 12V .22A. So the amperage is higher than the original fan, but when I measured it, it certainly wasn’t .22A. Closer to .16A.

Fan RPM is a good indication of just how noisy the fan is going to be. A 5400 RPM fan is going to be a lot noisier than a 3400 RPM fan. But of course the trade off is CFM. Then again, noise doesn’t always correlate with CFM either.

Inside the fan is a standard 2.54 spaced connector, which I just happen to have a lot of. No problem there. You can see it in the photo at the bottom center of the pic, CON2.

Power Supply 360

The GELID fan is actually a 3 wire fan. It reports how fast it’s going on one of the wires. Since my power doesn’t give a fig about how fast it’s turning, I never used that wire. Leaving it disconnected means the fan will run full speed if you connect it directly to 12V. However the supply in these power supplies is temp controlled so they vary in speed any way hence feedback from the fan is not required. Ignored in fact.

One of the sources of noise is the path of the air. Most of these supplies have fan “cut outs” that are supposed to do. Something. Maybe keep you from dropping screw drivers or bowling balls into the fan. Or. Something.

41gXr 7NPFL SY355

My power supply is mounted on the top of the Kossel frame and it sits atop a fairly high work bench. I almost need a step stool to get to the top…I could never lift a bowling ball that high… The cut outs induce noise.

I measured the amount of noise with the fan and cutouts in/out. First in, original fan @84dB. With GELID fan, cut outs in, 77dB.

Armed with a nibbler, there was no going back.

Power Supply Fan Hole

Put the GELID fan back in, remeasured the noise, 71dBA. Yep. The little holes make noise. If I wanted to protect the fan, I’d put one of those foam grill covers on it. I’ll wager that would lower it slightly more.

Power Supply New Fan

So that’s how it sits now. When the Kossel isn’t heating something the fan noise is less than 70dBA. When it’s printing, the steppers are now noisier than the fan is. Used to be that the two would be in competition for who could be the loudest.

My last test was with an IR temp probe and even at the low CFM of the GELID fan, the difference is 2 degrees C warmer. Big deal. There’s more than enough air flowing through the power supply to keep it cool. Maybe in the summer heat that might go higher but not enough to be a concern.

26
Jan

Kossel Timer V2

I’ve put the concept version of the Kossel timer through it’s paces, been printing for 6:55:03 over the course of a couple of days and it hasn’t missed a beat. Thus, it’s a solid design, probably due mostly in part to the simplicity of the design.

During this time I’ve had to abort a couple of prints, and it’s performed just fine. I haven’t had to actually kill the power to the Kossel and I know if I did I would lose the elapsed time for that print. I could put in a routine in the sketch to write out the time to EPROM every minute so at worst I’d lose a minute on a power off situation.

However, the number of times I’ve had to actually power off the whole thing is pretty rare. At least in comparison to the number of times I’ve had to abort a print. The EPROM in the Arduino has a limit to the number of times you can erase/write stuff in EPROM as well. The genuine Arduino states 100,000 times. I have no idea what the limit is on the clones or if the 100,000 is a minimum or maximum. In any case, a lot of print jobs…

For the first version of the Kossel timer it was more of a “build it and see if it works” test than anything else. Low and behold it works. So time to make version 2. You know, cause hardware is like software and never done…

I wanted to keep the Micro Pro because I like that size and it doesn’t need a USB to Serial adapter to program it. A pro MINI would work just as well though. Building a daughter board for the Micro to perch on was the start (a shield is the more familiar but incorrect terminology).

The Micro would cover the wiring and components easily. A cut up piece of PCB, some headers, components and jumper wires.

Kossel Timer V2

The completed “PCB” really doesn’t have a lot of parts on it, wiring is not all that difficult either. On the left side there are 4 Vcc, 4 GND, two trigger pins. I always find it handy to have more Vcc and GND pins that I think I will need.

On the other end of the board is the I2C output for whatever display (OLED in my case) and a RESET time pin.

Kossel Timer DB

The bottom of the board, does have some jumper wires and some wire wrap connections to get to where signals need to be, but you could probably lay it out proper style on a PCB and etch it without a lot of issues. I find for these one-ups, it’s just as quick and easy to bread board them up this way. Making 5 or 10 of them would change that attitude.

IMG 0944

Plugging in the Micro makes a nice neat design without wires travelling between the trigger circuit and itself.

Kossel Timer Vcc Trig

Plus the timer is not all that physically big either. Add the wires for the trigger (and some power), the OLED display and it stands like this.

Kossel Timer Connected

While I could have also built it so the display fits onto that bread board as well, it does limit where you can put the timer. The main drawback was its physical size when it’s made as an all-in-one. The OLED display is 30mm x 12mm x 5mm. Four wires make it work and it can literally mounted, wedged, stuffed, inserted or jammed anywhere.

Wiring wise, I have three wires heading from the RAMPS board to the timer and four from the timer to the display. That allowed me to hide the main body of the timer in the Kossel RAMPS area. Building an all in one, there would be three wires coming from the RAMPS board but it would be more limited to where I could attach the timer because of the larger size.

A trade off for sure. Therefore I just built what would work best for me. As the diaper policy states, YMMV…:-)

24
Jan

Kossel Hour Meter

I think I spend a considerable amount of time not only tweaking my Kossel 3D printer, but I spend a whack of time documenting the changes I make as I do it. So I can refer back to see what I screwed up. Usually.

The problem is that as I do this, I might make half a dozen changes in a day. So just writing down the day in my Kossel notes doesn’t really help much. Actually, it doesn’t help at all…if I was programming, I’d have versioning working so changes can tracked easily.

Last year I’d been keeping a log of the hours that the printer was printing and I stopped in Dec 2015 at 942 hours. Just adding them up as I merrily printed along. But since then I haven’t bothered. Got busy in December and never got back into the habit.

So I’m not sure if that was part of the motivation for my Kossel project or not. But I decided a couple of days ago I’d like to have an hour meter on the silly thing so I could simply write down the hour (like a time stamp). If I make 5 changes in a day and test print, the hour meter will reflect it.

eBay sells a number of hour timers, some even work from a 12V power source. Many don’t. The 12V ones I did find don’t seem to have any reset function in them. They work in 10ths of hours (6 minute blocks). Probably fine for driving a vehicle but I decided I wanted it more like a clock than a timer. Elapsed time clock in any event.

Rummaging through the junk box I found an Arduino Pro Micro that was going to be the brain of the timer.

IMG 0929

Next a display was needed and there it was. A tiny 128×32 pixel OLED display (I2C). OLED display take less power than the typical LCD 1604’s that have a backlight. Mainly because if the led is on with the OLED it’s using power, if it’s black, nope. Plus you get font sizes.

IMG 0928

As it sits, it will record up to 9,999 hours, 59 minutes and 59 seconds. Probably get me through the end of the month any way…LOL

I tried a number of different ways to start and stop the “timer” and finally ended up with a opto-isolator that connects to a single pin on the RAMPS 1.4 board (one of the servo pins; pin 6).

IMG 0930

I bread boarded the circuit to test. Used an 817C optocoupler. The socket on the bread board is just an 8 pin one I cut in half to fit the opto. The multitude of pins on one end are 3 Vcc, and 3 GND, 1 analog output. Why the multiple pins? Power comes in from the RAMPS board (2 pins), from there to Arduino (2 pins), Vcc and GND to the OLED (2 pins). Hence, handy to have all the pins there.

Why the analog pin? Oddly the circuit worked better at detecting the voltage than it did detecting binary HIGH and LOW. I suspect the transistor in the optocoupler wouldn’t allow the voltage to drop far enough to trigger a LOW on an Arduino digital pin. Detecting the analog voltage, thus, was far easier and 100% reliable. One 817C, 2 x 1K2 resistors. Done.

The dual pins on the ABCD end, only the B is connected to the optocoupler, I was going to use A as a GND if I needed it but I don’t.

How It Works

When RAMPS powers up, the PIN is low. So the optocoupler is off. No timer runs.

When the pin on the RAMPS board goes HIGH, the timer starts, when the pin goes LOW the timer stops, the Arduino writes the result to EPROM. From a cold start the circuit loads the elapsed time from EPROM and displays it as the start point.

Because the RAMPS board always powers up PIN 6 servo signal LOW, the timer doesn’t auto start at power up.

Matter of fact, you have to start and stop the timer in GCODE!

In Slic3r I have some start up and end custom GCODES entered so I added this line to the start up code:

M42 P6 S255

M42 is a custom command for Marlin version 1.0.2, P6 means we want to control pin 6 (this is pin 6 on the Arduino MEGA), and the value we want to send to it is 255 (or 5V). I’m not sure if M42 was supported in earlier versions of Marlin.

For the end custom GCODE:

M42 P6 S0

Which simply tells the MEGA to switch pin 6 to LOW. Stops the timer.

The more astute may have been asking themselves what happens if I kill a print job. Good question!

I use Astroprint (Astrobox) as my 3D print server and the current version of Astroprint allows custom GCODE to be sent when you kill a print job. I added the line M42 P6 S0 to it and it works perfectly. If I was using USB to send the GCODE I’d have to manually send the GCODE or program a macro to stop the clock.

Mounting The Timer Parts

I printed a simple box with a hole in it to hold the Arduino and trigger circuit. This fit easily under the heated bed. The wires running out, 2 for power, 4 for the OLED, 1 trigger, 2 for the reset to zero push button.

Kossel Timer Box

I’d already designed an LCD mount for the front of the Kossel to hold a 2004 LCD. I used the same basic frame parts and modified them in Tinkercad for the timer. The OLED is actually pretty small even though it’s easy to read.

IMG 0933

A front view looks a little better:

IMG 0936

The Arduino code is pretty brain dead but if you’re interested in it you can download the zipped file HOUR_METER. I used Arduino 1.6.5 and some ADAFruit libraries. Nothing earth shattering in there.

Now I am looking forward to keep better notes and hours from my Kossel.

28
Nov

Tardis NightLight

My bassist showed his wife a photo of my Tardis clock and apparently that was all it took for her to express a desire for a version that was not a clock, but a nightlight (manually controlled).

Which meant it was time to fire up the 3D printer again…and do some designing, electronic wise.

First off, the Tardis. I used the same files that I had originally but without the cutout for the clock digits. Plus I used my modified roof so I could add the small tactile push button to turn the power on and off. Yep, it was going to be battery operated. Ah yes, the bane of landfills everywhere but hey, keeps those Energizer folks in business…

The Tardis parts I actually managed to print in the proper colours this time. Plus I printed the white backgrounds for the windows so you couldn’t see inside. Armed with some diamond files, we got the parts to fit very nicely.

IMG 0691

I let my friend assemble what he could (forgot his close up glasses at home). The following picture looks like a magicians act…but it was crazy glue and he didn’t want to “stick” around…:-)

IMG 0692

And it was sort of obvious that he commonly works with a LOT bigger pieces of material than what I commonly work with around here. Scrap wood, clamps, not my normal mode of operation…LOL

For the circuitry, I didn’t want to have to turn the Tardis upside down or reach around the back to turn it on or off every time. Which meant I needed an electronic switch that drew beans for current and would latch/unlatch with each press of the roof tactile button.

I found one on Daves EEVBlog, but I never could get it to work. No idea why. But I happened across one that I gave a try to, after subbing the parts for what I had on hand:

Anthony’s Latching Power Switch

Latching

For the MOSFET, IFR5940, Q1 – 2N3904. I tried some different values for C1 and 330nf didn’t seem all that critical either I just stuck in a 39nf and it works fine. For drop out voltage, the power circuit will toggle until the voltage drops from 5V (3 x 2AA) to about 3.0, which is pretty much dead any way.

IMG 0738

Assembled it on a small piece of perf board, not strip board.

IMG 0740

Near as I can measure when the circuit is off it’s drawing uA, as in darn little. Batteries would probably go dead and leak before the off circuit load would drain them.

Here’s the Tardis without the internal lighting off:

IMG 0695

And in a darkened room with the LED’s (4 white) activated… We did add one more LED in the top chimney after this photo was taken. Because it looked better…

IMG 0696

Should make a nice Christmas present for his wife, a Dr. Who fan. And no, I’m not a fan, in fact I think I only watched about 15 minutes of an episode once. But I like the look of the Tardis so…campy show, cool props…:-)

6
Nov

Minecraft Cube – LED

The second project I made for my granddaughter for Christmas this year is a Minecraft cube. Of course, not just any cube, but hidden inside is an ESP8266 NodeMCU 0.9 devKit programmed from the Arduino IDE, running some AdaFruit Neopixels. Now there’s a tech mouthful…

I started off with the basic panel, typical of what you see in Minecraft as a building cube.

IMG 0672

That’s a 210mm bed you see it printing on so, yeah, skippy, it’s big. Darn big. As in 120mm square. I purposely left holes in the panel and I rotated each panel on the side so they don’t all look alike. While I could have printed it in just about any colour, her favourite colour is purple so, purple is what it is…

Each panel took about 2 1/2 hrs to print out. There’s 5 panels to the dude, you do the math for printing time…:-)

The panels are sort of interlocking in that one side is a slot and the other is a groove. I made extensions on the top and bottom of the panels for a roof (yet another panel) and a simple base ring.

Instead of leaving the holes in the panels to where you could see inside, I printed a two layer white plate that I glued to the inside of the purple panel.

IMG 0673

The flange on the top of the white panel is for mounting the electronics part inside. Testing fitting it all and from the bottom it looks like this:

IMG 0674

Top view:

IMG 0675

If you’re thinking that it doesn’t exactly mirror a Minecraft cube because of my corners, you’re right. The cubes that I’ve seen others print were simply edge butted together and glued, some didn’t align all that well.

I also saw some that were printed in one piece (top down and then a box so they looked like the previous bottom viewed picture.

A 120mm square cube would no doubt take a long time to print in once piece, any problem would mean completely starting over. But that’s not the main reason I didn’t print that way. What I didn’t like was all the supports for the openings that had to be trimmed out. I like nice finished edges…so I made design concessions.

At the onset I’d decided to put LED’s inside and I was going to use an Arduino to do it. However I’ve been experimenting with the NodeMCU’s and programming them directly from the Arduino so I thought I’d give that a whirl with some Neopixels. I was more or less shocked when it worked. First time. Scary. Big time.

My electronics consist of a NodeMCU 0.9 and a dual dc-dc buck converter power supply board. The power supply board has both 5V out for Neopixels and 3.3 out for the ESP8266 WiFi module.

IMG 0681

The power supply board has two regs on it so I always test before I assemble…I applied power (9Vdc 1A), got the Wifi going, turned on the brightest setting and all the LED’s I could. And things got interesting. Very interesting.

The regs on the power supply board started to get warm, no, let me rephrase that. Hot. Not soldering iron hot, but damn toasty. I flipped the power over to my bench supply and checked the current, 300ma. One third of an amp if you’re not familiar with milliamps. The regs were good for 1A max so I was well within their limits….time to hit the spec sheets..

According to the Adafruit specs, each LED can use 60ma when you have them showing WHITE. Since these are RGB LED’s, white is full red, blue and green on. Which works out to 20ma per colour. Thus a 10 LED string can, at worst case, use 600ma if they are full brightness and showing WHITE.

Couple this with the ESP8266 power requirements of 100-275ma and obviously it was the reason why the regs on the DC converter were becoming room heaters.

I am using 20 LED’s. Needed to rethink the power part.

Digging through my parts bins I found some 5V 3A DC buck converters and that’s what I ended up using. That worked perfect. Left it on for 48 hours to “burn” it in and it never dropped off the network, never missed a LED transition and never over heated.

IMG 0688

For control, Wifi, you end up writing some rather ugly looking HTML code. That works. But it’s not going to win awards for pretty. The ESP8266 has a library where you can use ZEROConfig or as Apple coined it, Bonjour. You don’t have to type in a url that looks like 192.168.1.94 to get the web control page, you simply type in something like “cube.local”. It’s resolved for you and presto, the web page will appear.

Cube Control

Clicking on the buttons in the web interface will send a bit of info from the browser. You parse that in your sketch and act on it. What I haven’t been able to do at this point is click on a button and have the page auto refresh after the click. Hence the “Status” button at the bottom of the page. I’ve tried everything I can think of to make it refresh (using OnClick in the button code) but nothing seems to make it refresh. An HTML coder I am not.

The nice thing about the sketches is that if you use ANY “Delay()” commands at all, they still do a background service for WiFi routines in the 8266. So it’s actually fairly responsive even when it’s off doing some led chasing. Nice touch Arduino guys!

IMG 0686

All in all a very satisfying project and I’m sure the Minecraft girl will get a big kick out of it….

5
Nov

Minecraft Torch – 3D Style

With Christmas looming in the not to distant future I usually start looking for gifts that aren’t exactly mainstream. Of course the easiest people to shop for are kids. Their world is leaps and bounds wider than any adult.

My granddaughter is no exception to this rule. She is pretty much tethered to her iPad playing Minecraft. Now to be honest I don’t get what the fascination with Minecraft is for kids. Having said that it’s been a long time since I was a kid, but I do remember getting all agog when ColecoVision appeared with the same pixelated graphics in their games…

As a Thingiverse lurker I find a lot of things that people have done, which of course generate ideas for what I can do. Sort of an enhancement if you like. The first thing I did was a Minecraft torch. Really it’s a big piece of PLA with a flashlight hidden inside.

There is the body, screw in insert, flashlight, and top. The original came from Thingiverse as an Scad file. You enter in your own flashlight dimensions and it generates the part based on that. And to a point it works okay. But if you want something a little better fitting, like most of the stuff from Thingiverse, you learn to edit it yourself.

Thingiverse Torch

My torch is very much the same, but I changed the inside housing that the plunger fits into so it holds the flashlight in place better. Printing the torch and parts took about 7 hours total. So not fast but it came out pretty good.

First time I ever used the “Vase” mode in the Slic3r software and it works fabulous!

IMG 0676

Assembling the torch is a matter of dropping in the light, screwing in the holder and plunger.

IMG 0679

And then pressing the plunger to turn it on…

IMG 0680

I printed the top in white, single wall thickness and it’s amazing how much light it actually gives off. It would even be good enough for a reading light on a power outage.

21
Jul

Nixie Clock Kit

Apparently I have an affection for clocks. Of all types. The latest is is a bit of a throwback to when I was.. ah.. a lot younger..

Specifically a nixie clock. Nixie tubes are those cool looking neon tubes with numbers inside:

Nixie

The tubes take 170vdc to “light” up a number so there’s a bunch of leads on the bottom of the tubes. Digits 0 to 9, two decimal places and an anode. Appearing in the mid-1950’s, they fell out of favour in the late 70’s but were still being made in Europe and Russia. For a while any way.

Now that no one makes them any more, they are becoming more valuable and the driver chips for them even more so although there is a Russian knock off that’s around. None the less a search on eBay will turn any number of sellers of them (usually in Europe someplace) and of course all manner of tubes. Some removed, some NOS (new old stock) not to mention a slew of different types.

My favourite Nixie have always been the IN-14’s. Large, easy to read, I like them. My first “digital” voltmeter, a Heathkit IM 1202 used Nixies:

IM1202 front1

Used it for twenty plus years before going to LED. Kind of wish I still had it…

I decided that rather than design one, I’d start with a kit. of course my idea of a kit and what others idea of a kit is can be vastly different. When I think “kit” something like Heathkit or Tamiya comes to mind. Lately my “kit” experience has been quite different. More like a box or bag of parts and an online PDF.

There’s a number of different companies producing Nixie clock kits and I chose PV Electronics in the UK for one reason. I liked the concept of an easy to replace Nixie tube because I know they don’t last forever. PVE sells on eBay and I ordered one of their kits. It arrived in short order consisting of some PCB’s and a bag of parts.

At least someone had the forethought to put a URL on the parts bag so I could find the assembly manual online.

Thus armed with a PDF I started to assemble the kit. At the same time a letter shows up from the eBay seller with a fuse part inside. Apparently it was missing from the parts so it was a good thing I’d delayed a few days before starting to build the clock any way. Now that’s what I call support. Rare indeed.

My 55 year observation is there are people who can write assembly manuals and there are people who shouldn’t. To their credit PV Electronics falls right in the middle. The information is in the manual, but it’s not organized in the best way that’s going to walk you through the build. I.e. the parts are on one page, the result on another, and no outlines on the result picture to show you the area you’re working on. Nope. Just a R12-R28, R32-R34 XYZ resistor and your PCB should look like this.

Considering the quality of the PCB and the parts, the assembly manual was a bit of a downer. But at the same time, not all that surprising.

I spent considerable time examining the silk screen of the PCB looking for where the parts go.

The resistors are metal film types and if you can’t read the colour codes or have access to a resistor tester you’re up a creek.

Hence right off, this is NOT a kit for a novice in my opinion. Certainly it’s one thing to know how to solder but to get this kit working I had to do some trouble shooting for defective parts. Parts that I have replacements for and know how to trouble shoot. Whereas a novice would be up that creek again…

The complete assembly took me just over 3 hours. Mostly spent flipping back and forth on my iPad reading the PDF.

At the end of it, I fired up the clock and it worked. All Nixies were perfectly. But one of the RGB LED’s was missing the blue component. I traced it to a faulty RGB LED. I replaced that and the clock worked as it should. But I have these components in my parts bin so not a big deal for me.

The heart of the clock is a PIC chip. Which means it’s a software clock. It is adjustable. How accurate is it? Compared to the lowly DS1307 or the more robust DS3231? No idea. No pun intended but time will tell.

The kit does sport a serial port so you can connect up a GPS to it, program in the offset to where you are and it will compensate. This is the route I took. I got one of my GPS breakout boards that I use on some of my Arduino projects and wired it, via a jack, to the Nixie clock board. It works absolutely flawless. Even if you forget the GPS chip when you move it around (I took it to some meetings to demo it), the Nixie will tell you when it hasn’t sync’d in a while. I plug in the GPS and with seconds, it’s running perfectly on time again.

Also some of the parts have changed since the kit was done in Dec 2014. A 15pf cap was replaced with a 33pf cap. No doubt to help with the software clock. There was supposed to be a piece of paper in the parts bag that told me this. Keyword was “supposed” to be. I never saw one if there was.

The “super” capacitor has changed value so if you go looking for the one in the assembly manual you won’t find it. You’ll find one that’s physically identical but a different value.

That’s one of my pet peeves with kits. If there are substitutions, update the assembly manual. Simple. Do it.

Here’s a shot of my completed build.

IMG 0214

And

IMG 0213

Thats right, there’s LED RGB lights under the tubes that you can create custom hourly colours with.

I still really like the concept of the tube sockets but I’d say it’s a kit aimed at more experienced builders.

My brother looked at it and I got a “cool” thumbs up from him. He loved it…

10
Jun

It’s a Sign – Parola

The Makerspace group that I’m involved with, Fraser Valley Makers, got to setup a booth this year at Vancouvers Mini Maker Faire on June 6 & 7. I was asked if I could lend them a few of my finished projects to display in their booth. And I happily obliged.

The group had made a rather large wooden sign advertising them at the faire but they remembered my matrix displays that I use when I build my scrolling clocks and asked if I could put a little sign together for them.

Any one who knows me, well, is aware that I don’t half do things. So I grabbed 24 of my little matrix displays, routed out a pine plank to fit them, installed them in it and it was hung at the booth for the show.

Parola FVMakers

The modules all use the Arduino Parola library.

There are three messages for the sign display. Each of them cycle 5 times before going on to the next.

Parola FVM Sign

The third message in the sign I decided to make programmable so they could change it what ever they wanted. The kicker was trying to figure out the best way of changing it. Of course the simple method would have been just connect up a USB cable from the Arduino to a nearby computer, change the sketch and re-upload it.

True, that would have been simple, but also a pain in the rump because the computer was going to be 15 or 20 feet away. And then they had to have the sketch and so on. So my mind started to think wireless thoughts. Could be simple RF with via a serial link from the computer to the sign, but then I started to think “access point”.

I briefly entertained the ESP8266 but for all the accolades I read about them my experience is they are cheap for a reason. And not exactly easy to use (like an AT command set from a bad 80’s movie). I understand this is changing but the steps for putting whatever firmware they require to make them “friendly” is not exactly documented in any easy to follow step by step method that I can find. Nor are they Mac friendly when putting firmware on them. Thus until such time as that changes, to me, they are still just junk. Destined to sit in my parts bin.

Then I remembered I had a couple of USR232 WIFI-T’s in the parts bin.

Parola FVM CTRL

Setting them up as an access point is stupid easy. Because I didn’t want to screw around with HTML coding, I decided I’d use plain old TCP to send messages to the sign.

On my Mac’s, that was easy. Change my wireless to the sign’s AP, then fire up the Terminal, type in Telnet 10.10.150.254 8899 and presto. Worked perfect. Anything I typed showed up on the sign instantly.

Thus Mac control was simple. However, for all the makers in our group there’s only two of us with Macs. All the others are Windows. Took me about 10 seconds to research enough about Windows to find it essentially has nothing like Terminal built in. Actually, someone told me the only thing Windows did have built in was obsolescence. Since I know beans about Windows, I don’t think I’d put much stock in that statement. After all, all computers are designed to be short lived. Nature of the market and all.

At any rate, I set off to find a Windows TCP client and I ended up with puTTYtel (TCP Telnet). After changing the “session” from active to passive, it worked perfectly as well.

The sign ran perfectly for the entire faire but the funny part was that the other makers who looked at it, assumed it was a commercial sign and not one that someone had hacked together with Arduino control. Talk about hiding in plain sight…

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.

14
Dec

Arduino HC-11 RF 433Mhz

A few months back I’d ordered some RF modules for a project and after working with them a while, I’ve found they work fairly well. So well in fact that I ordered some more.

If you’ve done any Arduino work with RF at all, you probably noticed the trend that a lot of RF modules are sporting UARTs these days. Why? Well for one thing serial is always easier for most to use than I2C or SPI. Plus when you want to program these things you can use what they call “AT” command set.

That’s right, “AT” like from the Hayes modems back in the early 80’s. Did I just imply progress? Good. Didn’t want to get off on the wrong foot here. The main difference is the “new” UARTs use a MCU with a control pin, not the old “+++” escape like the Hayes did.

The RF modules are called HC-11 and you can find them littered all over eBay where they will generally be advertised as “replace bluetooth”.

HC 11 433Mhz

While replacing Bluetooth is a bit of a stretch because these don’t exactly fit in a computer nor are they really anything remotely like Bluetooth (in operation or protocol), they are close range transceivers with good reliability.

The first batch I got had somewhat of a dog’s breakfast for firmware. From 1.7 to 2.2. I tried to do some of the operations in the manual where you could use them as a remote switch and I managed to cook one. Plus the 2.2 version didn’t work with the commands you can find for the 1.9 versions.

A quick email to the seller and he said in future he’d only get 1.9 from his supplier. Any way, according to my last order of them, every one of the 15 I ordered was version 1.9 and rock solid.

For documentation, there’s a dumbed down version that outlines about 5 of the commands for the modules. However some of the companies like SEEED have better docs, use this LINK.

You can program these directly from a USB to Serial adapter, but I thought I’d write a sketch to do it. Might save someone a bit of headache.

First off the connections:

IMG 4983

It uses +5V so that’s helpful, and I use SoftwareSerial on pins 2 & 3. The “control” pin is pin 4. The sketch tells you which HC-11 pins goes to which Arduino pin.

When the sketch starts up, it polls the HC-11 looking for a reply so it can use the baud rate:

HC Programmer Screen

You can see the Mode, Baud, Channel, Address and transmit power. So now some notes of what I’ve found.

  • Mode 1: Normal serial. Good if you have power for it all the time. This is the default.
  • Mode 2: really a low power mode. Like if you used it for a remote transmitter you woke up once a minute. Max baud rate is 4800.
  • Mode 3: Fast SINGLE character transmit mode! Don’t send any more than ONE character!!!!
  • Mode 4: Lower the baud rate, further the transmit distance. 9600 baud max top end.

Channel: says “000” to “255”. More like “000” to “020”. High baud rates and high channels don’t mix well. I suspect it doesn’t scale up the channel spectrum well. Remember to make at least two with the same channel because it will only “talk”, “listen” to another module with the same channel. And yes, you can reprogram the channel in software to send to different channels as need be. There is no “broadcast” across all channels.

Address: you can “ID” each module. No idea where it’s used. Maybe for the “wireless I/O” control.

Power: Transmit power. Eight (8) is full power 10dBm. In the real world, somewhere between 40 and 100 metres. To save you the work, 10dBm is 10mw. More North America walkie talkies from years ago were 100mw. This is no RC aircraft unit…

The chip that’s doing all the RF work is the TI CC1101.

The HC-11’s sport three antenna connections. You have a U.FL connector, you can solder on a U.FL connector and use a duck or you can solder in a typical helical antenna (aka pen spring). What I have not done is range check those to see what difference they might make. I do have some ducks on order though.

For the Arduino UNO sketch, download it from this LINK. I used IDE 1.0.6 to compile.

As I noted before, I tried the “wireless I/O” control and ended up cooking one of the modules. Good thing they aren’t that expensive.

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.

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.

3
May

ArduBank

The wife has had an old style “piggy” bank for years but the coins don’t always find their way to the pig and she likes to play slot machines. For her birthday this year I decided to combine both of those into the “ArduBank”.

The physical size of the bank is about a foot square and 16″ tall. I used back glass from a real slot machine for lighted top. For the “reels” I decided the easiest way was to build a 3×3 matrix of LED’s, then print the 7’s on some self adhesive transparent film. To hold the LED’s in place, I used pill bottle caps.

ArduBank

For the coins (CDN) we have six dominations (actually five now that pennies are gone but I still coded in for them) I used a SparkFun 6 coin accepter. This generates an RS232 signal when it gets a good coin so it’s a piece of cake to use.

The display keeps track of the “total” in the bank (it writes the total to EEPROM). It also tracks the number of each coin so if you’re going to roll them up to take to the bank, you know how many you have of each coin type.

For the “slot” machine part, I wanted a payout, but paying out with money didn’t make much sense so I decided a “win” would be paid out in gumballs or jawbreakers. The lines for winning, 3 horizontal, 2 diagonal depend on the amount “wagered”. Thus a $2 coin and all five way wins are possible. With a .05 coin, horizontal middle line win only.

The reels spin down more or less like a real slot machine would and I found typically about every 30-60 coins you could hit a win. But depending on the denomination entered, it may not be a valid win. Sort of like a real slot machine where even if you win you can still lose.

Gumball Internal

The gumball mechanism uses a 5V stepper that’s attached to a 4 slot wheel (in the photos you can see the slot in the axle that the stepper shaft inserts into). A win rotates the shaft 1/4 turn where it pays out a gumball and picks up another.

Gumball Payout

Lastly, inside there is a keypad to “load” the gumball wheel and reset the coin total. With a few keys left over for future enhancements.

I decided early on to use an Arduino MEGA 2560 because it gave me a lot of pins for I/O and it’s running the 16K sketch.

Don’t have to worry about loose change be left around the house any more. Matter of fact, I have to hide mine now…

The inside:

Ardubank Internal

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.