Skip to content

Posts from the ‘Arduino’ Category

27
May

Word Clock – revisited

Back in 2014 I built a word clock that consisted of a strip of 111 Neopixels (WS2812B), controlled by an Arduino.

I got all fancy with it, wrote a custom application for the Mac for all the settings and changed the time base more than just a few times. Everything from picking up the GPS RF transmission here, to a direct GPS module, and even a RTC (DS3231).

It has been running fairly well until the last few weeks when the “Twelve” word started to exhibit some odd colours and wouldn’t completely shut off. Of course then I noticed other things like the printed paper mask I was using for the words had started to fade a bit, allowing the square boxes to shine through. Lastly the colours didn’t look all that vibrant any more.

I tried a couple of bandaid fixes for it and Carol suggested I needed to redesign it.

Redesign – Rip apart

I think I spent the better part of a week going through all the permutations of controls when it finally dawned on me that I needed to come up with a new face design. I took the foam board, paper and ripped it all apart so the only part remaining was the backplane with the Neopixels on it.

IMG 1080

The next thing was to write a quick Arduino test routine to make sure the LED’s are all working. Oddly enough, even though the Twelve word was failing for the last couple of pixels, my test routine proved there was nothing wrong with those pixels…mmmm Odd…

New Cell Design

Guess who has a couple of 3D printers? I kind of balked at first because it’s not just a design small enough to print in one afternoon. It had to be done in pieces, the pieces put together somehow, and so on. Oddly enough as I used Tinkercad to design what I wanted, it started to go together easier.

Each of the words, like the original would be a box on their own. I thought about how to put the cells together to make the grid and realized the easiest way was to use some of those M3 screws I have.

IMG 1081

I did a row at a time, screwed end to end, then fit them between the side frame rails. More screws and I just kept printing and assembling.

For the “lens”, I printed two layers of white PLA. I tried thinner and thicker layers but two seemed to work the best. I also tested some transparent PLA but you could see the Neopixels behind the lens so that wasn’t going to do. The white diffused the LED’s perfectly.

IMG 1082

Eventually I got the whole display done and then had to work on the electronic control.

Clock Electronics

To control the Neopixels all that is required is an Arduino. But then I was back to a RTC, GPS or RF signal catcher and I really wanted something, ah, different.

I remembered I installed my own NTP time server on my OS X Mac Mini so…why not use it. I didn’t want to use an Ardunio with Wifi or ethernet, so I decided on an ESPduino D1. The ESPduino is nothing more than an Esp8266 with a CH340G uart connection. I have a couple of them in my parts bin thus if I blow one up, I have a spare.

I found a few sketches that showed how to do NTP, and then I came across a sketch that did it with an 8 digit seven segment display. I have the same display and wired it up for testing just to make sure it worked. It worked quite nicely with my ESPduino D1.

I used the sketch as a starting point for my word clock because my logic and control is significantly different. About an hour later I had a working clock.

IMG 1085

Clock Box

The original box was still in good condition and I used it again. Even managed to reuse the matte from the original in 2014.

IMG 1086

I was going to use a dc-dc buck converter to drop 12V down to 5V but decided to make it even more simple and just use an iPhone charger to supply the 5V everything was going to run off.

Plugged it all in, connected to the access point, set it to use my wireless network and it sprang to life…

IMG 1092

The Tweaks

The original clock had bluetooth for adjustments, colours, brightness, light levels for auto dim and so on. Honestly in the three years it’s been running, I never adjusted any of that. Instead I kept the new build simple with one of the original tweaks left in. The auto brightness.

There’s an LDR mounted in the top of the frame. When the light level in the room drops below a specific level, the clock brightness drops to it’s night time setting. That’s it. Simple.

I printed a ESPDuino D1 mounting plate I found on Thingiverse, stuck it to the back of the foam board, plugged in a USB cable from the iPhone charger and away it went.

IMG 1093

Six connections to the ESPduino and it’s wired.

For the Twelve issue, when I went back through the original sketch I wrote, I missed the number of Neopixels in the strip. By one. My math is better now…

10
Feb

Soldering Gear

Soldering

A word that can strike mind numbing fear into first timers. I kind of remember learning how to do it, from a ham radio operator no less. Frustration for me, laughter for him. When I was 10 years old.

Now admittedly most parents wouldn’t dream of letting their 10 year old grab hold of a hot soldering iron because, well, they’re kids. And you never know what could happen.

Fortunately I was born in an era that believed if you grabbed something hot and burned yourself, you instantly gained the experience to never do that again. My parents bought me a wood burning kit for Xmas when I was 10, and with it came the responsibility that I wasn’t going to “burn the house down”. To their delight, I’m sure, it was never an issue.

Soldering came to me because I was a model train nut in my pre-teens. Running wires and switches for tracks, sidings, lights and so on with nothing more than electrical tape was, really, more of a hazard than my wood burning set.

This blog won’t teach you how to solder. Neither will too many of the online videos or “instruction” pages I’ve seen. You want to learn to solder, find someone who can do it well, beg or bribe them to teach you. One on one. Makerspaces are a fabulous resource for this.

The dead giveaway for someone who lacks soldering skills? They use the gun or iron as a “paint brush” to “flow” the solder around the connection. You don’t wipe a solder joint with an iron to flow the solder. Unless you’re sculpting.

Guns, Irons, Stations, Torches

When you’ve got soldering under control, and don’t expect instant miracles, you may want to actually buy some soldering gear of your own.

If you’re under the impression that you can buy a 25W soldering iron and you’re good to go, my best advice would be save your money. Go see a movie. Why? Because the pleasant experience of the movie will last a heck of a lot longer than a 25W soldering iron experience will.

So let’s start with the cheapest thing that will melt solder..and the thing to avoid buying if you can…

Wellar

First, Weller makes some truly great products. A pencil styled soldering iron isn’t one of them. Think of these more as a fabulous wood burning tool and you won’t go wrong. True, they will solder, in some cases, but as you get better with soldering, you’ll toss this thing. Main drawback? No temperature control adjustment.

Next up we have soldering guns. Like this one:

Weller 8200n

Runs 100 to 140 watts, easy tip to replace. You can use it for almost any gauge of wires from 14 to 26. You won’t use it to solder any components on a printed circuit board. The tip is too large. If you’re building a 3D printer, the one place you need this gun?

IMG 1218

That’s right. When you soldering the wires on to the bed heater. The bed heater is a big chunk of aluminum with a copper pattern on it. The metal dissipates the heat so fast from a soldering iron, only a gun will work. Plus the gun has to match the area. That’s a 220mm plate with a 100/140 watt gun. If you have a large metal plate, like 300mm, you need a 220/260 watt gun.

These old Weller guns last, well, at this point…here’s a snap of me at 15 when I was fixing my guitar amp (yeah on the kitchen table)…that is the SAME gun in the heated bed photo above. It is 50 years old and it still works just fine and the only repair was I put a new plug on the end of the power cord.

Mel Soldering

Plus in a pinch when I didn’t have a replacement tip (they do wear out), I’ve grabbed a piece of house wiring, 14/2 (NMD7), stripped the insulation off it, bent it in the shape of the original tip and it works, just fine until I can get a replacement tip. Which they still make…

As to why I am fixing my amp, I couldn’t afford to take it to a tech so I learned enough electronics that I could do my own repairs.

On the list next are soldering stations. To me, even a lousy one of these is better than a pencil iron.

Stations vary in quality. A lot. Typically a Hakko (genuine) is the cream of the crop, everything else is a wannabe. However, if you don’t do a lot of soldering, you don’t need a top of line station either. Again, match what you want to do with the gear to do it.

What you want in a station is first, replacement tips, with a chisel tip of 1.2mm or 1.4mm being the standard tip for component use. There are scads of tips to pick from if you have special requirements. Order a few extra when you buy the station. If they stop making tips for your iron, the iron is a conversation piece.

Second, you want temperature control. And not some analog gauge that looks like the black/green/red one from an old battery tester either. A digital read out one that has a knob to control not push buttons.

Below is an example of a relatively inexpensive station that will do a decent enough job and not put you in the poor house. Notice the place that holds the iron? It has both a sponge and a wire shavings area to keep the tip of the iron nice and clean. Oh, and don’t forget to wet the sponge before you use it. It’ll last a lot longer…:-)

Station

Last on the list is a torch. And again it depends what you’re doing. Like plumbing. Torches are great! Working on a printed circuit? Not so great. Pay attention to what the pros use, get something along that line.

Solder

Of course, having the melting tool isn’t going to do anything unless we have something to melt. In this case, solder.

And all solder is created equally right? Nope. You need to match the solder to what you want to use it for. Unless it’s an emergency or some stop gap measure in which case, yeah, we’ll use whatever we can lay our hands on.

Lets start with the big stuff…as in plumbing…typically 60/40 or 50/50 (lead to tin mix). You’ll need some solder paste, clean joints and a spool of this stuff:

50 50

And a torch. This is big heavy stuff, takes a fair bit of heat to melt it.

Moving on, we get to electronic stuff. Printed circuit boards, wiring, finer detail stuff. And in a pinch, automotive as well.

Solder Type

Here things get a little complicated because there are two very different types of solder in use. One is the age old lead/tin and the other is lead free. There are pros and cons for both so pick a camp on your own choice. One thing to keep in mind is that if you’re repairing something that was made with lead free solder, you need to use the same.

Solder Diameter

Soldering diameter is also important. You want something with a .31 or .32mm diameter if you’re doing PCB work (or general smaller gauge wiring). Buying by the pound, Kester for example, is usually the best way to buy. But it’s not cheap and if you have to mail order it, keep in mind that it is a pound weight…

Quick Review

I recently got a tube of MG Chemicals solder, lead/tin, to try out. My normal brand is Kester 44 sn63/pb37 (tin/lead).

The first thing I asked myself is who in world decided to ship solder in a tube? So I thought about that for a minute and I think that they are saving on packaging. Normally solder comes on a plastic spool, inside a cardboard box. By shipping it in a tube, for a small quantity, they move away from that problem. Cost effective, don’t know about the plastic tube in landfill though…

Course the day I buy a small quantity of solder isn’t going to happen any time soon.. So the first thing I did:

IMG 2360

Yep, pull it out of the tube and coil it up. And I have to say it does make a nice sized coil. But it got me to thinking… MG sells solder wick, and I readily admit I have used wick about 3 times in fifty years), in a “spool”. I’d suggest the plastic tube would be better served with a simple spool like the wick. But I’m not a marketing guy so…just what I’d prefer.

IMG 2361

As I mentioned before, I’ve used Kester solder for a long, long, long, oh heck, since I started.

When using the MG, I found that it doesn’t flow as easily or nicely as the Kester does. And really, 63/37 solder is 63/37 solder. Thus the difference has to be in flux.

MG Chemicals says, “RA-like flux core” and “It generally exceeds J-STD-004 and J-STD-006 specifications

Kester says, “The high mobility and fast-spreading action of this flux results in more reliable production line soldering. 44 is classified as ROM1 per J-STD-004

Whatever all the heck that means. Me? I’m just an end user and I like the flux wetting action of the Kester by far.

While I really like the new MG Chemicals PLA, the solder? True is does do the job, but …meh.

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…

24
Sep

Smokin’ RAMPS

My main Kossel printer has slightly less than 2,000 hours on it but the RAMPS 1.4 board on it gave off a very familiar odor the other day so I shut it down until I could get to it.

Later, I fired it up and it seemed okay. For about eight minutes. Then the room got sort of filled with smoke, accompanied by that familiar burnt electronics smell. No fire, but it did jam home a point that if I was 3D printing, I don’t want to leave the thing unattended.

Ripping the printer apart revealed the culprit. The heated bed MOSFET.

IMG 1748

Apparently it overheated, was laying against the terminal block and started to melt its way through, which then shorted out the terminals and…as they say, the smoke leaked out. End of life for short.

According to the specs for this particular MOSFET, it’s “supposed” to dissipate 110 watts at 25C. There is a heated bed about 2″ above it that is heated to 50C, which, probably isn’t helping it any either.

I thought I had a spare around here someplace, because, the simple fact is if you’re going to own a 3D printer, your best bet is to build one so you can also fix the thing when it will inevitably break. It’s not a question of will it break, but when will it break.

No way I could find a RAMPS board but David (FVMaker designer for this Kossel kit) had some spare boards. Life saver!

I replaced the RAMPS board and presto, up and flying. And of course, that’s more or less the same time I found the replacement RAMP board I’d ordered who knows when off eBay.

IMG 1751

This eBay special I found came with all the jumpers on and I thought I might as well set it up properly and once I’d done that I thought I’d also test it to make sure it was going to work.

Surprise. Surprise. It kind of worked but when I told the head to move, it only went half way. Ah ha. Stepper jumpers were not right. After rechecking about eleven_leventy times, they were set right. But I was still only getting half movements.

I started searching the net for schematics for RAMPS 1.1, 1.2, 1.3, 1.4 hoping to find what the heck was going on. No soap. I had a 1.4 board, no two ways about it.

Next step was pulling all the jumpers and testing with a digital multimeter. Imagine my surprise when I found it didn’t matter if the jumpers were on or off, there was continuity between the jumper pins regardless. Which, is, of course, wrong.

Pulled the plastic off the jumpers so I could see the circuit traces and wow. There is definitely some village that’s missing their idiot. See all the arrows? You can see the foil traces on the PCB.

RAMPS 14

Every set of jumpers for the steppers was done the same way. But why?

What I think was, no, not that it was a design error, but, for the A4988 stepper drivers, all jumpers had to be shorted to get to 1/16 steps. The PCB was designed with all shorted jumpers to save on the cost of adding those little jumpers, actually they didn’t even need to add in the pins.

However when the DRV8825’s came along, the jumper positions changed. But these boards were probably so plentiful they were sold as “proper” RAMPS 1.4 boards with all the jumpers.

Quick work with prying off the plastic holding the pins and a couple of minutes with an sharp blade and the board worked just like the other.

While I was comparing the two boards I had a look at the MOSFETs. The main original board used P55NF06 and the “repaired” board used IRF3205. According to the data sheets, the IRF3205 is the more capable MOSFET.

Under closer look at the data sheets you walk away with the idea that neither one of these is exactly what you’d call a performer. When the Vgs is less than 5V, there are better choices. Personally I’d suggest the IRLB3034pbf which would work well within the limits the 12V main supply to the RAMPs and voltages less than 5V for control.

To keep the MOSFET slightly cooler I added a small heatsink to my RAMPS. It’s not pretty by any stretch but it does help.

IMG 1752

Yes I know it’s mounted incorrectly (it’s not touching any other MOSFET even if it looks like it is in the photo), they didn’t design the PCB to have a heatsink so this worked out to be the best way. Unless you want to remove the heatsink and mount it somewhere off the board. Another option if you want to go that far.

The more closely I look at the RAMPS board I can see too many cost cutting short cuts on it. Thus, a good idea to have a spare….or two

10
Jul

ESP8266 Breakout Programming

Last year I sourced a bunch of ESP8266’s for programming but wasn’t excited about them enough until the Arduino IDE was expanded to support them. Then suddenly all of these inexpensive WiFi things became extremely versatile and useful.

This is the first one I started with, but of course I did some modifications to it. Like rip the battery box off and replace the battery wires with pins.

Esp8266 development board esp 12 er dp8266esp12

The result of the simple modifications was a voltage divider on the RX input because the USB to Serial adapter is tossing out 5V and the ESP8266 is a 3.3V denizen. Two resistors (1K and 2.2K) are used to do the job.

On the PCB’s, the terminals for RX and TX are labeled in reverse. In other words they tell you where the signal is supposed to go on the Serial adapter, not what’s coming out of the 8266.

The second mod was a NC push button on the Vcc line. The 8266 board has its own 5 to 3.3v regulator but in order to program it from the Arduino you need to put it into flash mode in a specific way. If you omit the normally closed push button, just disconnect Vcc at the pin.

ESP8266 Connections

Programming Step 1 – disconnect Vcc at the breakout. Place the jumper on the two pins on the bottom of the breakout.

ESP8266 Step1

Programming Step 2 – Connect Vcc to breakout board. Remove the yellow jumper from the PCB.

Esp8266 Step2

The ESP8266 breakout is now really for you to program it.

Programming Step 3 – in the Arduino IDE the setting for the breakout is the Adafruit Huzzah one. The port will be whatever USB to Serial board you have plugged in.

ESP8266 BreakOut Programming

And that’s it. Open an ESP8266 sketch, compile it and you’ll see the little blue LED on the ESP8266 flashing away like crazy. When it’s done the ESP8266 will automatically start running the code you sent it. It doesn’t reset when you connect the serial monitor to it like the Arduino’s do.

If you have the same breakout board, here’s a sample sketch for you to send to the board. It will sort of simulate the old Knight Rider bar graph and if you cover the photo cell it will change the speed of the cycle.

Knight_Rider

29
Apr

TFT GPS CAT Clock

I made a clock for the granddaughter a couple of years back and it’s been working fine until a couple weeks ago. The display was fairly small TFT 1.8″, consisted of a DS3231 clock module, power converter, and Arduino.

Each day the display would come up with a witty quote that was read from a SD card. Optionally there was a monthly calendar that would toggle on/off if a button was pressed.

IMG 4981

Keira mentioned that although she used to like a “night light” in her room at night, now she didn’t want any light at all. I tried, unsuccessfully, to modify the LED backlighting on the TFT to get it to turn on and off. She just laid the clock face down at night to stop the light as a stop gap.

When I got the clock back from her, the DS3231 backup battery was dead, and the chip itself was generating random times and dates. Which were probably correct somewhere in the world, but not in our locale.

Hence, time to build version 2. The first order was to find out what Keira liked and disliked about the clock. The first like was the calendar portion. The strong dislike was the TFT backlighting.

Time to assemble the parts. An Arduino MEGA, breakout board for the TFT display and a high resolution 480 x 320 3.2″ display. To make darn sure the time was going to be accurate, I added a Skylab GPS module.

IMG 1331

The reason for the 3.2″ high res TFT was that Keira is a cat lover. Lynx in particular. My original idea was to have a background picture, and draw the time/date over top of the display. What I soon found is there is no functional library that does this sort of blending of text on graphics. Granted I could write one, but I decided to keep it simple.

I soldered wires directly on to the GPS module, sandwiched the boards together and presto, a relatively compact clock.

IMG 1333

Rather than add a bunch of push button switches, I used a couple of 3mm round head screws with the ADC touch library. I soldered two wires on the Mega’s A0 and A1 pins to use the library. If you noticed the display I am using also sports a touch screen but I didn’t like the idea of finger prints on the display so I didn’t use it.

The display is a Cold Tears 3.2″ TFT 480 x 320 display. Very nice colour and, when I looked at the back of it, there is a control for using PWM (pulse width modulation) to control the brightness of the display. What is not clear is how you make it do this…

In reality you need to unsolder one jumper on the TFT PCB and then on the adapter board PCB you need to add a short jumper wire because they never put a trace/jumper on the board to do it. Once done, pin 44 on the Mega with a PWM signal will control the brightness of the TFT.

Next up it was off to the internet to find some cat pictures that would scale nicely for the display. I had previously written some software that would open a graphic, scale it for a TFT display and then save it in RAW format so the UTFT library would read the raw file and display it. The graphic size that scaled best was 600 x 400 so that’s what I used as the exact size in the search.

Scaled with the date/time showing:

IMG 1334

I purposely looked for images that didn’t have something on the bottom so the date/time wouldn’t overlay the important part of the picture.

With the backlighting on the TFT, it wasn’t until I built my own Tardis clock for our bedroom that I fully understood just how bright even a dimmed LED can be. Let’s just say I completely agree with Keira on the lighting.

For a case to hold the clock, well, it helps to have a 3D printer. I designed a case in Tinkercad that would hold the clock, and then a separate base to stop the clock from tipping over. You can see the two “touch” screws at the top right corner of the case. Those are used to kill the backlight on the TFT and to toggle between the cat/time/date and monthly calendar views.

IMG 1351

There are 100 images on the SD card mounted on the back of the TFT display and each day at 2am, the clock will pick another photo at random. Since the clock is GPS smart, it also nows daylight savings time from regular time.

While Keira can turn the TFT backlight on when she goes to sleep, I have it coded so that at 7:30am in the morning, it will turn itself back on for the day. Or you can turn it on manually before that time.

For anyone who might have noticed that the dim image in the last photo looks like a golf club, well, I AM an avoid golfer, I do things a little different. But I did keep with the “cat” theme….look at the brand name and logo on the club head…

IMG 1352

26
Jan

Kossel Layer Example

For printing on the Kossel, unless it’s something special, I normally slice with a .3 layer thickness. This generally gives good speed and acceptable quality. Kind of a win-win if you like.

When I am doing something that is more detailed or I want a nicer finish, I might print at a .2 layer thickness.

Rob, one of the FVMakers, mentioned he was printing with a .1 layer thickness and I think that’s what got me thinking about it. But I had some serious doubts at the same time.

Consider this, we’re squirting PLA or ABS from a .4mm nozzle, that merrily swings from a mathematically nightmarishly controlled upside down tripod, driven by an 8-bit CPU, that we’ve levelled on the print surface with a piece of 20lb bond paper. Of course we expect maximum accuracy with a setup like this and we should have it! Or not.

If you’ve ever looked at the bed maps from any delta printer, you’ll see high and low spots all over the map. Even if said printer is perfectly calibrated for “flat”. Or whatever flat implies.

Conventional thinking says you print at a layer height that’s about 60-75% of the nozzle size. Thus a .4mm nozzle is usually the happiest printing at .3 or so. But if the bed is calibrated flat fairly well, you can indeed print at .2mm.

Truth be told, I only had the auto-level probe installed on my Kossel for 3 days when I first built it. I could see so many failings with it and the software, I’ve always manually levelled the bed. Takes me about 15-20 minutes and I don’t do it very often.

Tonight I thought what the heck. Throw caution to the wind. Let’s take this baby for a spin and she what she’ll do.

I blame Rob, at least partially, for this lack of judgement on my part. What? Well, yeah okay I spread the blame around so if bad stuff happens it’s not 100% my fault. I know I didn’t fool anyone with that so just let me have my dillusion.

I have a small print (80mm x 60mm), Slic3r creates it’s usual spasticated tool path, printed at .2mm.

Google point 2

Notice as you move around the eyes follow you? See I was trying to distract you. Did it work? No? Blame “he who’s name I mentioned previously”. Okay, so blame me. It’s easy to see the layers. Kind of looks like a relief map of some canyon actually.

The same print, but this at .1mm layer.

Google point 1

Can you say blended? Ignoring the cats whiskers I didn’t bother cleaning off, the transitional lines between layers are minor. Although the eyes still follow you…weird huh.

Flipping the print to the top side you can see the crevice is not as cleanly defined with .2mm. I am using a macro lens here so bare that in mind too.

Google point 2 Top

Take the same print but this time with .1mm it looks very smooth. And if you look closely at the circles around the eyes, not the bags under them, you’ll see they aren’t really circles at all. Nope. STL doesn’t have circles. You see polygons which is the best you can hope for with STL.

Google point 1 top

I admit that when I started the .1mm print I had my hand on the mouse for the job kill function. Turns out I didn’t need it.

When I read all the ads stating that these filament droolers are capable of 100 micron prints I lumped that into the same boat as a used car salesman’s pitch. Makes for good ad copy and never thought about it again. Till tonight when I remembered “he who will not be blamed” had seeded the idea in my cobweb encrusted mind. Then I printed out these two objects.

While my objects are purple, you can colour me amazed. Thanks.to..ah…you know who…;-)

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.

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….

18
Aug

Kossel Power Supply

One of the things about the Kossel (not a mini version is mostly the sheer size of it. True it’s more compact than the usual Cartesian style box printers, but it still makes a fairly large foot print where ever you put it.

Then when you add the spool holder, it needs a little more room and finally there’s the power supply. Typical switching power supply, 12V 30A. 99% of the Kossels I’ve seen photos of just have the power supply under the table top or sitting off to the side.

One of the makers at our maker space showed me a couple of ideas he had for mounting the power supply on the top of the Kossel. Quite literally the only place left you could mount one. That provided the inspiration for me to give it a go.

I’d already designed a new front for the Geeetech LCD 2004 smart display and had added the cut out for the power switch so, in for a penny, in for some more designing and PLA printing.

After test fitting one of my spare 12V power supplies, I found the supply fit rather snugly in the top. So I designed a front hanger.

IMG 0381

The hanger fits behind the top front open beam. I used a couple of M3 screws with T-Nuts to mount it. I also made it 5MM over size in width and 2.5mm oversize for height. Why? There’s a fan in the power supply. Probably a reconditioned Boeing 737 engine from the sound of it. So I not only wanted to isolate that from transferring any vibrations to the open beams, I also wanted to isolate the open beams from the aluminum housing of the power supply.

Yep, all about the quiet.

Next I designed a rear bracket with the same over-size to it.

IMG 0382

The way you see that sitting in the photo is the way it prints too. Those are 30 degree angles and print just fine.

I mounted the two brackets roughly to see how they were going to work. Yep. It’s one thing to design all these cool things, it’s quite another to actually have them fit…

IMG 0383

This only left putting in the power supply to check for clearance.

IMG 0384

I’ll say one thing right now. If those open beams were any shorter, the power would NEVER fit. As it it there’s maybe 2mm of space so that it doesn’t touch either the front beam or the other two at the back. Although it would have been neater to mount the supply with connections at the back, there’s already a whack of wires running down the back of the Z tower.

Some unused 2.5mm rubber sheeting was cut up and made the bottoms of the brackets. Dense foam cut very thinly made the sides so the power supply is wedged in snugly. It doesn’t vibrate, nor does the tower vibrate it.

I was going to have to run 110VAC to the supply and rather than use a bunch of single 18 gauge wires I used one of those standard computer power supply cables. I cut the ends off, removed enough of the outer casing so I could run the wires down through the vertical open beam and out through the holes in the Kossel corner piece.

IMG 0387

If you check the photo, you can see a white power cable in the open beam and the wires coming out the corner piece. I wanted enough length on the bottom so I could run the wires all the way to the Z tower.

IMG 0389

Up top of the tower where the power supply is hanging I stayed in the open beam channel as much as possible.

IMG 0390

Time to design a receptacle plate for the AC plug to fit in. Standard EC variety.

IMG 0385

I made the plate fairly thick so when I’m plugging in or out the plate doesn’t give way. I did have to modify the AC outlet slightly. The distance between my beams on the Kossel is 19mm. The plug is 20mm. I used a rasp file to take every so little off the top and the bottom of the plug so if fit in between the beams without putting any stress on them.

IMG 0386

I run the wires from the bottom of the Y tower to the back where I have the AC plug in. You can just see the top of the plate holding the AC plug just past the bed holder.

IMG 0392

With the left over piece of power cable I cut it so that it would reach from the AC plug to my switch at the LCD front panel. I only needed two wires so I cut one of them off on each end. Just like wiring a light switch in your house.

IMG 0391

I plugged the wire terminals onto the rocker switch I have and pushed it into the LCD housing. Snug fit and it works flawlessly.

IMG 0394

The AC plate at the back accepts the standard computer cable power cord.

IMG 0395

Good idea to wrap your connections with electricians tape as well. Don’t want 110VAC leaking into one of those Kossel beams…

For the DC power from the power supply to the RAMPS board, I wanted to use some 16 gauge wire but the local building supply store didn’t have any. I ended up using some stranded 14 gauge wire. Heavy stuff to be sure but I still ran two sets of power wires from the power supply to the RAMPS board.

You can’t put four wires down the inside of an open beam, so I used both sides of the X tower to carry the four wires down and tried to hide it as best as I could. Where it was needed I used a couple of zip ties to hold the wire as well.

The finished job:

IMG 0396

An interesting side note to this. Before I started this modification I’d noticed that when the Kossel was printing honeycomb infill, the top of the tower would tend to vibrate enough so you could see it shimmy. This in spite of the fact that the hot end really doesn’t have much if any mass to it. Still, the steppers would start it moving when the right harmonic was hit I guess.

Once I added the power supply and wedged it with foam, the whole top of the tower suddenly no longer shook. Between the brackets and mass of the power supply it did dampen the vibration.

I was also concerned that with the AC close to the Arduino and RAMPS board that some electrical noise might cause some havoc. Happy to say that has not materialized.

Therefore I call the whole project a win-win…

Want to make your own? Here’s the link to the STL files for the brackets and AC adapter plate:

WabbitGuy Kossel Power Supply Mod

16
Aug

Kossel Display

My Kossel came with a full graphic display but in the real world that puts a fairly large load on the poor wee Arduino processor so I swapped it out long ago for a Geetech 4×20 LCD smart display. Truthfully, I’m not to sure how “smart” it is but it does work well and shows more information than I suspect one needs to know…

Geeetech LCDRAMPS1 4

Of course the Kossel also came with a really nice printed PLA box to house the full graphic display and that’s not going to fit the LCD 2004 display. I’d printed one for the 2004 LCD earlier when I was learning about the Kossel (like clamping the glass to the heater element) so I’d made a mess of that one.

While the previous messy one fit the display nicely, it was really meant for a MINI-Kossel and their open beams are a difference size. Matter of fact, if you search Thingiverse you’ll find most of the LCD units are designed for the smaller mini-Kossel. The Kossel I built is anything but “mini”…

I’ve been searching for a decent mounting system and I finally found one on Thingiverse. Or at least the basis for one. It was designed for a mini-Kossel as well so I imported it into Tinkercad and added some tweaks of my own.

Here’s the three parts that make up the mount.

IMG 0377

Enhanced left and right side are the changes I made. I used some left over open beam parts to mount the left and right sides to the front of the Kossel.

Starting with the left side, there is enough room for the SD slot. The holes in the mounts are designed for M3 screws and I used a tap on mine to thread them. Really they needed to be a little bit smaller for a snugger fit.

IMG 0378

The right side I change the original’s power switch for one that uses a press fit. I’m going to use it to turn the 110 power on and off eventually so for now it’s going to remain empty.

IMG 0380

From the front the minimalistic approach looks very nice.

IMG 0379

Is the design perfect? No. I think the front should be a little thicker than it is (only two layers) and the holes should be small in the left and right mounts so you can tap them with an M3 tap for better holding. But beyond that, it works very well and makes the panel look like it belongs there.

The next task will be to figure out where to hide the power supply. I’ve see guys put it everywhere from the side to the top. I thought about the top, but I don’t think the wires could be hidden as well. There’s two sets of 12Vdc lines and then the heavy power cord. On the other hand if I build a sort of “stand” for it, I can put some stuff in the bottom, but there’s always that 12VDC power supply fan and I don’t want that blowing up on the heated bed.

Eventually I’ll come up with something for the power supply…I hope…

If you want to print your own mounts, heres the link to the STL files:

WabbitGuy Geeetech LCD 2004 Kossel Mount

12
Aug

Kossel Lighting

After becoming more conversant with Tinkercad I’ve been designing little things that I need. And printing up a storm literally day and night.

Watching the printer during the daylight hours is no big deal, but when the sun goes down, even though the shop is well lit up, when printing a dark colour it’s darned hard to see what’s going on.

As the quip goes, necessity is the mother of invention. Or all screw ups. Depends on your view point.

The initial idea was to print up a couple of brackets to attach some 12V strip LED’s to and then mount those brackets across the front beam of the printer. Couple of things wrong with this idea though and the main one was that it was in the way when you wanted to reach into the printer area. The switch was okay.

LED Idea

This lead to version 2…2.1, 2.2 and finally 2.3 that I am using. What changed? I decided that I only needed the LED’s on when I was printing and I might was well have the Kossel control them.

LED Brackets Wiring

These brackets are designed to fit right in front of the X and Y towers. The LED strips are 12V strips of 5630 or 5730 SMD LED’s. Basically 1/2W LED’s and six of them in each strip.

I actually printed a channel for the LED strip to slide into. Although the LED’s come with a self adhesive backing my experience is that in time, it lets go. So why bother to start with.

IMG 0355

Using some left over hardware from my Kossel build I mounted the LED’s on the open beams.

LED Mounted

To turn the LED’s on and off, I wired them into the unused FAN terminal block on the RAMPs board (D9). It’s the pair of terminals between the bed heater and the hot end heater. I’m using since male Dupont pin connectors on mine.

LED FAN Wiring

I ran the power up to a four pin connector (top right corner in the photo) since the LED’s have two pins each (+ and -)…I did have to jump some terminals but it wasn’t a big deal.

There is also a reason I used the female connector. Remember there is 12V sitting on those terminals so we don’t want them touching any metal in the Kossel and causing problems.

IMG 0358

Next I wanted the GCode commands to turn the LED’s on and off. I use Slic3r so I modified the start and end codes:

Gcode

That M106 command turns on the FAN, or in my case, the LED’s. The S255 is the “brightness” of the LED’s. S255 is FULL brightness, S127 would be 50% and so on. If you find the LED’s are too bright, easy fix.

The M107 turns off the fan/led’s at the end of the print job.

There is some slight LED flickering because of the MOSFET power changes with all those heaters on, but it’s minor in the great scheme of things. The LED’s run between 40c and 70c so they get warm too. Don’t be poking them unless you want a matching LED mark on your finger. The LED’s do not get hot enough to do any damage to the PLA mounts.

Here’s what the area looks like in a darkened room…

LED On

Turning on the room lights, which is a lot of light as I pointed out and letting in some outside daylight…

LED W Room Lighting

Yep, it still lights up the area nicely.

I was not using any flash on the camera when I took the shots either.

Yet another Kossel mod…here’s the STL download if you want to print your own. Note this is designed for the 5630 or 5730 LED’s.

WabbitGuy Kossel LED Mount

1
Aug

OpenSCAD Bezels

One of the things that got me interested in 3D printing was the ability to make faceplates or bezels for some of the Arduino projects that I construct.

I’d found some LCD 2004 bezels on Thingiverse and while they did print out, I could see there was room for improvement.

Thus, I decided I needed to learn how to design my own stuff. I downloaded a number of 3D drawing programs that advertise as being intuitive. Perhaps I’ve been in a 2D world too long, or been a programmer for too many years. Whatever the case, I found none to which I would even remotely attach the word intuitive. More like “steep” learning curve. Steep as in the case of a cliff.

What I wanted was something where I dropped an object, clicked on it, entered all the measurements and carried on to the next object. Apparently CAD has never been done that way. Not exactly out of the box thinkers I’m assuming. Hence if you never grew up with that mindset, trying to wrestle control of it would be frustrating. Exactly what I experienced.

There are some commercial software packages, SolidWorks was one that was suggested. Still, it didn’t appear to work the way I wanted it to. The remaining free ones I tried and tossed just about as fast.

One of the members of the FVMakers, while listening to my 3D lament, suggested I try something called OpenSCAD. Essentially it’s a programming environment where you use shapes to build what you want to design. The catch is, you need to understand programming.

Fortunately for me, I do understand programming. So I downloaded and took a look at it. At first glance it didn’t look any more “friendly” than the other GUI 3D design programs. I was a little disappointed by this. It did obviously plant a seed though because some of it made some sense and stuck with me. Over the next couple of days (about 3 or 4 hours) I found some examples, looked at a fair bit of code and suddenly the light went on. Dang. It made some sense.

Honestly in a bit of a goofy way though. They way they do it is not exactly straight forward but once you get about half dozen of the commands figured out and how the union/difference works, you can use it.

I have a current project that uses some seven segment digits. Typical size…20 x 27mm x 10mm.

Seven Segment

With openSCAD you build the design more or less the way it prints. In layers, starting with the bottom first. In each layer you position and then combine or subtract or whatever with the previous layer (or object). The numbers you use are mm so making stuff to size is a piece of cake.

Plus OpenSCAD does math. You can resize, scale, well, pretty much whatever you want.

My first design was basically three objects (or layers if you like to think of it in simple terms). The face with smaller cut out, a second face with a different size cut out (full size of segments) and then a box to hold the digits.

I hard coded everything first, which means I had numbers every where. Not a good way to do it but I was learning.

The outcome was pretty exciting! Here’s the first one with a single digit in it. There’s a lip so the digit can’t fall out the face.

IMG 0304

I was pretty excited at this point but I could see all the stuff I did wrong. Those digits were SQUEAKY tight. The reason is the segments are square but the 3D print isn’t exactly a perfect square corner. There’s some gusseting going on. I could file it out so it wasn’t wasted.

The other issue was that I didn’t have the border around the digits quite right. Cause I’m learning. Time for version 2…

IMG 0305

And the back:

IMG 0306

I made the frame (cube) to hold the digits 1mm wider and .5mm taller and they fit easily. To hold them in a dab of silicon and that’s all you need.

Of course as a programmer, I started to mull over how I’d get the code to do more than 2 digits. Say I wanted, 4 or 6? What would I have to change. Maybe I could create different versions of the code for different digit counts.

That’s the point the programmer in me returned. Variables. Let the code calculate the size based on the digits. Yeah. As it turned out, pretty darn easy to do. For me. Probably not for non-programmers.

I re-did the code like so:

OpenScad Code

Whip out the digits and a digital micrometer, edit the values, render and presto:

OpenScad 3D View

Export as an STL file, slice it, print it and for four digit counts:

IMG 0307

And six digits:

IMG 0308

The openScad code follows. Next up, I plan designing some bezels for push buttons and some TFT displays.

And this, is exactly what I got the 3D printer for.

22
Jul

Me & 3D, printing that is…

I decided to build a 3D printer a month back. Right after deciding that I’d never have any use for one.

A friend pointed out with all the Arduino stuff that I do, a 3D printer could be a valuable asset for doing mounts, panels, widgets and doodads. Especially the latter two.

At the Maker Faire in Vancouver last month there was a glut of 3D printers. Oddly I didn’t see any of them printing anything. I know why now. It’s a black art. In other words, you just don’t take one out of the box, plug it in and start printing. Sure there are some that imply this, but when I’ve talked to the owners of the same, they all admit there is some “tweaking” to be done.

Since I like building I thought I’d rather build one. My second reason was that if the thing broke, at least when I built it I’ve had a good idea of how it worked so I could fix it. As it turns out that was a good idea.

3D Types

There’s two main types of 3D printers, both available in various configurations in kit form. The first is the standard Cartesian models. In these types, normally, the head moves X & Y and the Z (height) is a table that moves up and down.

Then there’s the Delta. These work within the Cartesian plane but can’t be confused with one because they have three arms that do all the moving. The printer bed is fixed below the three arms in a triangular tower. These are designed for speed and a bed that does not move.

Lastly there are machines that use Polar coordinates. You have to see one of these in action to marvel at how it works. They are fairly rare at this point.

Kossel

The local makers that I’m a member of is selling a Kossel 3D kit and since I knew beans about 3D printing, I figure I’d be a good test for the kit. In other words I went into it blindly and completely unarmed.

This is what the kit was supposed to be like after it was assembled:

Kossel 01

Unfortunately many of the parts in my kit were printed incorrectly and I ended up rebuilding it a couple of times after one of the members graciously reprinted some of the parts for me. As a gag I sent them a photo of what my build was going like:

Kossel Turbo Encabulator

That photo was hanging on the wall at the Maker Space for a while…

Kit

I’ve built plenty of kits in my life, but this was more of a box of parts than a kit. The “assembly” manual was a PDF online that actually refers to the same “delta” printer but it has different components so, you can’t really follow it 100%. And since you don’t know what’s going to be critical and what isn’t, failure is almost guaranteed.

Thus, you have to build one, to know what you really need to pay attention to. I learned the hard way and even with help from one the most astute members in the group, I hit brick walls. Hard. A lot.

As it turns out, building the kit is the easy part. Calibrating it is a nightmare. For a number of reasons. The least of which is because no one seems to be able to explain the calibration process in simple terms. They kind of know what has to be done but they don’t seem to have a procedure for doing it.

Calibration

The really VAGUE “how” is you find dead center on the bed, measure some distances on your printer, you put that in the firmware (Marlin), you send that to the printer. Make sure it always goes back to dead center. If not, you adjust the values again, re-upload the firmware, retest, until it does.

You use software like PronterFace or Repeatier to control the hot end.

Once the middle is found, you setup the height of the print area. More firmware update.

Next you measure the gap at four points on the bed. One by the X, Y and Z towers, one dead center. The gap is a piece of 20b bond paper you use as a feeler gauge. All four POINTS MUST BE EXACTLY the same “drag” on the paper. If it tears the paper, too close, if it doesn’t touch the paper, too far away.

I found a web site that kind of describes it. Check the May 30th, 2013 and Dec 22, 2012 for the info. Read them both.

Delta Calibration

Using PronterFace I managed to get mine “flat” in less than one hour. That’s huge. But it only worked that way because I modified my printer. To do the “gap” test, you adjust the top end stops higher or lower, each one at a time, until things work. And if you change one, it does tend to affect another. I used a 3mm screw like this:

Kossel Adjuster

So you home the end, run it down to the bed, check the gap, and adjust the screw to raise or lower the hot end. I was using less than 1/8″ of a screw turn to tweak mine at the end of the adjustment phase. But it’s a major easy way instead of trying to move the end stop switches up or down by .1mm or less.

When you finally get the bed “levelled” you breathe and think you’re done. Ha. No way.

Next thing is to set up the extruder to give the right amount of PLA, and then finally, print something.

I assure you that if you print a 30mm x 30mm square it will not be. Measure it with a digital micrometer. Either the X or Y will be out. For sure.

Back into the software you go and adjust one of the numbers in DELTA_DIAGONAL_ROD. Of course when you do this, well, you have to go back and adjust all the gap points at the towers and in the middle again.

At some point in all this you’ll get close. Maybe even exact. Now you can print! Maybe…

Slic3r

The objects are in STL files and you need to “slice” them into layers for your printer to print. And I’ll tell you there are a LOT of numbers in the Slicer software that you need to set. No one can tell you what those numbers are, so you get ballpark numbers for a start.

On my printer I’m not running it at max speed. I run it about 60% of max. And it runs just fine. To me speed isn’t as important as a reliable print. Other guys want to print maximum speed. If you’re doing a coarse print resolution that might work. I use a depth of .24mm for the first layer, .3 for each layer after that.

Heating the hot end and the bed is another thing. I run my hot end at 210, first layer at 215. That’s where it’s the happiest. The bed is heated to 50c for PLA and I use some Elmers Glue Stick to LIGHTLY coat the print area. It sticks REALLY well so don’t add too much!

So my printer works very nicely now and I was testing some glues to glue PLA pieces together the other night. Two different kinds.

PLA Glue Test

The glue on the left doesn’t work well at all. The Crazy glue sticks! So I printed a Minion and glued him together.

PLA Glue FrankenMinion

Kind of looks like a FrankenMinion but he’s stuck together quite well. Next I printed some feet and a base for the little guy.

PLA Glue MinionFeet

Finally I glued him to the base.

PLA Glue Minion W Feet

And yes, he’s supposed to be bent over like that. Because this is not just a printed thing, it’s my

PLA Glue Cellphone Holder

Cellphone holder…now how cool is that…

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.

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.

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.