Skip to content

Archive for November, 2015

28
Nov

Tardis NightLight

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

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

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

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

IMG 0691

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

IMG 0692

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

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

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

Anthony’s Latching Power Switch

Latching

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

IMG 0738

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

IMG 0740

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

Here’s the Tardis without the internal lighting off:

IMG 0695

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

IMG 0696

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

6
Nov

Minecraft Cube – LED

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

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

IMG 0672

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

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

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

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

IMG 0673

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

IMG 0674

Top view:

IMG 0675

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

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

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

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

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

IMG 0681

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

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

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

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

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

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

IMG 0688

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

Cube Control

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

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

IMG 0686

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

5
Nov

Minecraft Torch – 3D Style

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

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

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

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

Thingiverse Torch

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

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

IMG 0676

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

IMG 0679

And then pressing the plunger to turn it on…

IMG 0680

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

4
Nov

IoT – ESP8266

IoT or Internet of Things has been gaining momentum for a while now. The first I’d heard of it was last year when I was introduced to a Spark Photon. A 3.3v Wifi enabled controller with some I/O and a cloud based programming software solution.

My initial reaction was disappointment. First off, 3.3V, my world revolves around 5.0. A new “language” or “script” to learn and being tied to a cloud for developing for it. So with three strikes against it, it wasn’t something that I was getting any warm fuzzies from. Another solution looking for a problem to solve.

Then along came the Photon, Spark Core and a plethora of Wifi things for Arduino (well, micro controllers in general). The Wifi things caught my eye since most could be a access point or client. I think I ordered almost every variety of them that came out.

Thus everything from the USR-232_WIFI, CC3000’s to ESP8266-01. They all shared pretty much the same communication route. That being of Hayes modem AT style commands. Yeah, Hayes. From the early 1980’s. I got the feeling we’d come full circle on that dog and pony show. Ugh.

However the ESP8266 was so economical that guys would devise all kinds of circuitry to restart them to maintain connections, or spend hours to make them more reliable. Finally adding a LUA interpreter because reliable the early ones weren’t. But they were cheap. You just knew folks would keep hammering at them.

As it turns out the ESP8266 is a fairly powerful micro controller with WiFi capability. So from the first sign of it in August 2014 until now, there’s been a LOT of people beating this thing into submission. For them, my hats off to you because we are now at a point where I can actually use them without spending time and energy debugging them.

So what’s the specs on the 8266?

  • 32-bit RISC CPU: Tensilica Xtensa LX106 running at 80 MHz
  • 64 KiB of instruction RAM, 96 KiB of data RAM
  • External QSPI flash – 512 KiB to 4 MiB
  • IEEE 802.11 b/g/n Wi-Fi
  • Integrated TR switch, balun, LNA, power amplifier and matching network
  • WEP or WPA/WPA2 authentication, or open networks
  • 16 GPIO pins
  • SPI, I²C,
  • I²S interfaces with DMA (sharing pins with GPIO)
  • UART on dedicated pins, plus a transmit-only UART can be enabled on GPIO2
  • 1 10-bit ADC

There are two devKits 0.9 and 1.0 that make connection and programming MUCH easier! Starting with version 1.6.4 of the Arduino IDE you have the ESP8266 core libraries built in. You program the 8266 just like it was an Arduino, even the blink sketches.

GitHub has instructions and information…really once the IDE boards manager has installed the ESP8266 and its variants, using it is pretty simple.

I’ve built a couple of projects now where at one time I’d have an Arduino, ethernet board, Wifi dongle just to get WiFi. Now I do the whole thing with the single devKit 0.9 or 1.0.

I’ve connected LCD’s, DHT sensors, RTC’s, switches, and even NeoPixels. All work flawless. If there’s one area that you can get caught with, it’s that it’s still a 3.3V chip and jamming it with 5V signals is not good if you want longevity from the board. Use a level shifter or voltage divider if need be.

In closing, now that I have used the ESP8266 12 and 12E devKits, I can’t imagine using Wifi any other way. I feel we finally have a product that’s worth of the tag, IoT.