Archive for the ‘new device’ Category

LED Cylon Painting

July 1, 2016

I was inspired by a large bag of red ‘tombstone’ LEDs to make a larson scanner.  These LEDs are exactly 0.1″ across which makes them perfect to stack side by side on perf board to get an arbitrarily long bargraph (but in a nicer form factor).  This was to be put in a box that originally held the receiver for an aftermarket wireless video game controller.  I designed and actually fitted the circuitry in there first.  The plan was to make that take serial commands (or serial over USB) and have it be an ROS peripheral  for an AI, or natural language processor, or just a roomba with some attitude.  Following this build I was watching an episode of Futurama called ‘The Honking’ which featured this distinguished gentleman:

The quote goes:

That painting, the eyes are watching me!

[Farnsworth walks towards a portrait of Commodore LXIV.]

Hmm. It has motor eye sensors attached to motion detectors.

So does my butt, but I don’t frame it and put it on the wall! Although…

Then he got an idea. An awful idea. The Grinch got a wonderful, Awful idea… What if one of those paintings could follow you and was of a regal looking Cylon.  I commissioned a friend at i3detroit to mane the painting (a replica of a famous painting, but with a modified head/helmet) and got to work on getting someone else to help with the motion detection.  Yeah, I farmed out the work but that’s because I like it here in embeded-land.

The openCV code to detect faces wasn’t hard, it came from a certain mustache example some of you may be familiar with.  The painting turned out beautifully, and went to makerfaire.  The problem was that the raspberry pi is not the fastest computer for video processing and the pi camera does not deal with changes in exposure well.  The face tracking was a failure, but I hope to try that again in the future with a more powerful board.

The hardware is just shift registers, LEDs, and a pro mini.  The code is simple, but it’s a good thing I put in an auto-scanner routine for operation without a computer.  The manual control can set any LED position on, and then resume scrolling on command.

The code is here.

The pictures are here.

standalone heated bed controller

June 21, 2016

Back in the day when I was at college we had a RapMan 3d printer.  Do not buy this printer.  The version we had was flat-pack, made entirely of acrylic sheets sandwiching smooth rods for construction.  Staying up all night to get the first print got us a small ABS plastic cup and a rain of nuts, washers, and bolts.  If you tighten anything down enough to not shake itself apart you shatter the acrylic, and the controller is proprietary, so there’s not much you can do to it from that front.  We spent the first few weeks designing and printing replacement parts for the printer out of ABS because the acrylic was garbage.  The extruders were nice, but used a custom machined razor sharp worm gear that would just chew up material if it was too soft.  On top of all that, it didn’t have a heated bed.  If you’ve ever 3d printed something you’ll know that a heated bed is quite nice and helpful to get good looking parts.  Since we couldn’t interface with the damn proprietary controller we just built a stand-alone one.

We built this in one night, and to my knowledge it never got changed.  This is both a blessing and a curse.  If you half-ass something and it works ‘well enough’ people are not motivated to make a better one, this could mean even more time before you have a reasonable solution to the problem.  If the solution is truly good enough then it’s not an issue, but there’s a spectrum… The other thing worth noting is if someone decided to take a ‘good enough’ solution out of order and replace it with an un-finished ‘right way’ solution taking the functionality from 60% straight down to 0%.  These sorts of ‘fixes’ are the hardest to come back from because it involves either finishing someone else’s project, starting over, or putting back the first solution.  I would tend to lean toward the latter of these options, but that’s not always possible if the parts have been cannibalized in the course of making the whole system non-functional.

Being built in one night it used what we had lying around, in this case an original msp430 launchpad.  These had a bunch of features, plenty of reasons to like them, and most importantly an arduino abstraction layer ported to them.  Arduino may have a bad IDE with very few features and a convoluted system of adding boards and other support, but the important part is that it’s easy enough to get working fast and has enough of a community that making your first few projects work is super easy.  At the time when I documented projects it was on the IEEE Lab Wiki, considering that’s who it was built for and where people would look for documentation on how to use it.  These days I’m going through my google photos looking for something to document, not to bulk out the number of blog entries I have, but just to put together a repository of my knowledge.  I’m not planning on getting hit by a bus soon, but I bought my own house and am already not that healthy of a person.  Here is the excerpt from the wiki article I wrote:


The heated bed was purchased to increase the quality of 3d prints on the Rap Man. It is constructed from a bed from RepRapDiscount, borosilicate glass from Lulzbot and our own custom controller built from an MSP430g2553.


Maximum Build Dimensions

  • X: 214mm (~8.5″)
  • Y: 200mm (~8″)
  • Max Temperature: 110°C (230°F)
  • Power Requirements: 12V @ 8.5A


We wanted to use one of our launchpad MSP430s, but we wanted to do it fast, so rather than learn how to use TI’s IDE (we tried, there were major problems that varied between chips) we used Energia. Using some KEM-5161BR (common anode) 7-segments driven by 2 74HC595N shift registers. To conserve pins we configured the 8th bit on the second shift register to control the third 7-segment as either blank or display a “1”. We have the POT being read on one pin and the thermistor set up as a voltage divider on another pin. The FET (2 in parallel since we needed more current) hooked up to a digital output. The code is [[1]here].

Future Modifications

  • Replace the thermistor table with a function
  • Replace the on/off functionality with a PID controlled PWM
  • Move the FETs to a separate board (or further away from the pot
  • Replace the FETs with one rated for the current
  • Print a PCB


I’m actually not going to elaborate on that because I don’t remember anything else about the design, construction, or functionality. Looking back, my favorite part of the code is the comment “fitted graphically”, I think I’ll use that at work some time as justification for data.  On the subject of ‘future modifications’ I’m pretty sure none of that ever happened, although at least one person got burned by the FET (that really should have been a relay, way higher power with basically no heat).  This article’s ‘value add’ can be my story and perspective on the whole situation I guess.

pictures are hosted here

code (and an unbuilt board design?) is here

original wiki article for the lab is here

Wake-On-Lan Powerstrip

January 20, 2014

For the one of you that has this blog as an RSS feed you’ll probably have figured out I’m not staggering posts, I put the information out there just as fast as I write it.  I’m not looking to build a community, but more to be indexed on google so that people who are looking for help on specific subjects can get it.

This is a project that is a blatant rip-off… I mean derivative of a hack made by a friend of mine over at the i3Detroit hackerspace. His hack used the Wake On Lan feature to reset a server, mine could be used in the same way, but I tend to use it as a fancy lightswitch.  That article I linked to has a fantastic description of component choice that I won’t try to duplicate here, I’ll just go over the implementation I used and how it differs from his.

I will first start by saying that this design has gremlins.  It took me way longer to transpose the circuit from paper to breadboard and have it work, and I gave up trying to convert from breadboard to protoboard around attempt five or six and just started soldering components together and rolling up the breadboard circuit into a solder blob (which functions to this day).  I have since designed a board for this project.  I plan to eventually roll it into a tindie (or kickstarter kit campaign) but until I get around to that you can do it yourself with the provided schematic and eagle board files.  Feel free to make a surface mount one as well if you feel that adds much benefit (it’s just a cost savings in board fab and parts, the size is already as small as needed (as small as the network card is).

design document

My modification to the circuit uses the output pulse from the 555 timer to trigger the clock input of a D-latch (wired as a flip-flop) through a FET.  Let that sink in for a minute, read it over a couple of times slowly.  The last bit uses another FET to drive a relay based on the output of the flip-flop (a relay attached to the power strip).

breadboarded circuit

OK, so let’s start with the “through a FET” part.  A Field-Effect Transistor is a transistor that has an amplification curve such that it is effectively an on/off switch.  That means that while it is truly analog, if we use it right it can very easily be used to just pass whatever current you need with a small signal.  In this case I’m using it as a buffer so the 555 timer chip doesn’t have to drive the flip-flop directly.  This is overkill, but with the amount of trouble I had making this work in the first place I though it wise.

Now we’ll tackle the “D-latch wired as a flip-flop” part.  So, this may be a well known configuration (and having a bachelor’s degree in EE now I should know that) but I came up with it independently of anyone else.  The latch takes whatever is on the input and puts it on the output when the clock pin is twiddled (rising or falling edge, I’m not sure).  The chip I chose has a complementary output, that means they have the opposite of the output on another pin, so when the output is at 5 volts, the complement is at 0 volts and vice-versa.  I used this to my advantage.  I wired the complement to the input so that whenever I clocked the chip the output would change to the opposite as I latched in the complement to the output.

The modification I suggest is that rather than oscillating the output you could have two network cards with two MAC addresses and when you WOL one it turns on the relay, and the other turns it off, regardless of the state beforehand.

blobs that work so well

After this picture was taken I decided that having the neon lamp indicate status would be preferable because the one on the powerstrip sucked.  The blob on the left is the 555 timer, the one in the middle is the latch, and the one on the right is the relay.  The whole thing is built into a computer power supply body and powered off of a salvaged 5 volt wall-wart.  The software I use is either wakeonlan for linux or any wake on lan client for android and I can blip the power from the internal network.  If I can ssh into a server on the network from the outside then I can blip the powerstrip from anywhere on the internet.  That is not really useful because there is a small chance of the circuit bouncing (an RC damper could help) and my current one doesn’t turn it off, it only changes the state.

whole thing

There it is, a way to use up all those PCI network cards wasting space on your shelf.  No code, COTS parts, and you can flip a bit on your network.  This is essentially a network attached bit, get 16 (one for on and one for off) cards and you can have a very very slow 8-bit bus.  Throw on two more for a strobe line and you could bit-bang a dot matrix printer on the network.  The cool thing is that you can literally solder the input 8p8c (RJ45 to some of you) jacks in parallel since they’re passively receiving.

The eagle layouts will go up just as soon as I go home and upload them.


Eagle layouts are up now, I invite you to do better (because it only took me a night).

design for though hole component version

Teensy 3.0 based dumb POV globe

June 27, 2013

So, here’s a completely custom design I had, a POV globe done in 9 hours.  The motivation was easy, I am the president of the Michigan Technological University IEEE Student Lab, and we needed to have lots of blinky things to show off to prospective freshmen touring the university the next day.  We had some old stuff, but I had heard that there was a group on campus that couldn’t manage (over a number of years) to build a working POV globe.  I immediately stated that it should be a trivial task and that I could do it easily.  This statement was, of course, met with a suggestion that I should build one… so I did.  This is it:

I have to say that the big seam on the right was closed much better the first time I used it, and the paint jub on the base was done by a friend who wanted to help with the project.

The main parts of this are as follows: a computer power supply, a PC fan, a strip of metal bent into a ring, some foam board for the sides of the ring and the base, a 555 timer based PWM circuit, a Teensy 3.0, a battery, and some LEDs.  First I’ll go over my design philosophy for the base.  The base is literally made of a computer power supply and a PC fan screwed down to it as seen here:

The blades were broken off the fan so there would be no massive air currents or problems caused by having no air to suck up from the bottom.  The metal ring was simply hot-glued on to the ring and balanced so that there was minimal wobble.  The PWM circuit seen closer here:

As you can see, it’s a very simple circuit, I built it right on to a DIP-8 555 timer chip and have had no problem using it this way.  The reason I chase to do a PWM circuit rather than just use a POT as a voltage divider to vary the speed of the fan is that the fan is designed to run at 12v and is most stable (has the most torque) at that voltage.

Now, let’s look at the Teensy circuit:

So there are two things I have to say about this: I know it’s overkill, and the schematic is slightly wrong.  It should have the LED that’s going to pin P13 should go to P16.  I couldn’t figure out why that pin kept outputting data/clocks/noise on that pin, so I just re-mapped the output pins in an array in the code.  It was pointed out to me that if I had latches on the outputs that I could be assured the columns always turned on at the exact same time, but that’s for another later version which I’ll talk about later.

The battery is a cellboost single lithium ion cell + charger + step up converter to output 5v.

I thought it was the easiest solution considering I couldn’t use a slip ring connector to deliver power since the only axle was the PC fan and I wasn’t going to hack that apart any further than I had to for reliability’s sake.

At this point I feel I should address the lack of any timing mechanism.  I didn’t add a timing mechanism for three reasons, one: I didn’t have a slip ring connector to pipe in the tachometer from the fan, and two: I didn’t have a hal-effect sensor handy (the easiest way to get timing), and three: I didn’t have time.  The timing is done simply by setting the delay in the code to a sane value and fiddling with the POT until it processes very little.

Now that I have a spinning blinking thing, let’s pick something to display.  The earth is the most obvious thing that comes to mind, so I did it.  I got a picture of the globe as a Mercator Projection because of the way I placed the LEDs it meant simply dividing the picture into squares and representing the land/water data as binary.  I did that using this picture:

Yes, I did it manually, but hold on, that’s not the worst thing.  once it was represented in binary in code I just had to iterate through the columns and rows and write out the value in the array.  That’s not so simple when you’ve got the syntax for boolean evaluating operators wrong in arduino.  The absolute first revision of the code used one loop, the main loop, and a whole bunch of digital writes.  I feel kinda dumb, but I was also up for about 36 hours at that point.  The final code is here, and the github repo also has some other stuff in it related to this project, like a presentation I prepared to explain what I did.

There’s a glitch in Australia that was fixed in a later revision

I have an updated design that uses a parallel EEPROM and a bunch of discreet logic.  I will have a post about it soon if I can find the paper I wrote it down on.

simple VGA splitter

June 26, 2013

Here’s a dead simple hack that anyone with a soldering iron and some reasonable skills can do. Take a piece of radioshack protoboard, 4 board mount vga ports (salvaged is easiest), and some solid core 80-pin IDE cable and build one of these.  They do degrade (dim) the signal by not being as bright since the 75 ohm termination is broken by simply wiring them in parallel, but this is no worse than buying a splitter from monoprice.  My use case was wanting one monitor at the main desktop, one at the workbench, and one at the couch but not needing the images to be different since I can only be in one place at a time (for now).  This 4-way female connection allows one input and 3 outputs using conventional male-to-male vga cables (none of this male-to-female KVM cable stuff).  I tried to do this only populating the data pins to one monitor and just duplicating the RGBHV to the others, but for some reason that didn’t work.

DIY Power Supply

June 15, 2013

This was one of those projects I knew I had all the parts for and it just took being bored one night to decide to actually do it.  I decided I wanted to make my own power supply, not just a modified computer power supply, but entirely from scratch.  This may not have been the best idea since it’s entirely based on linear regulators (I did put heatsinks on them, but no ventilation).  Anyways, here it is:

I should emphasize that I purchased none of the parts to build this project myself, they were all either donated, salvaged, or found.

The base circuit for this I got from here and I modified it slightly to suit my needs.  I decided that I wanted 5, 12, 3.3, and a variable voltage output (at this point I realize I could have done all of this with a computer power supply, but too bad!).  The second place I got inspiration was this EEVblog post, I decided I needed some more equipment and built some.  Now, some design decisions based on parts on hand.

First, it only goes up to about 14vDC.  it was the best transformer I had on hand at the time (although before rectification I read it as about 12vAC, I have no idea why it’s higher once rectified).

Second, I have fine and coarse knobs since I couldn’t find my 10 turn pots (they had ball bearing based planetary gears).

Third, I opted not to have power cut switches for the regulator inputs (space concerns) but I do have output switches. I originally wanted to cut power to the regulators because they would just be dissipating heat otherwise.

<where my schematic would be if I bothered to make one>

OK, now that that is out of the way I can explain a bit of my design process.  I took the base circuit from and modified it to suit my needs.  I didn’t put in a fuse since I didn’t have one on hand (well, I didn’t have a panel mount holder).  The power connector, rectifier, and power switch are from a computer power supply, the transformer came out of some old piece of equipment, probably a radio, or amp, or something (it was in my ‘transformers drawer’), the large filter capacitor is of unknown salvaged origin.

As you can probably already see the entire thing is put together with computer power supply wiring and ethernet cable (how else would you know I built it?).

Up to this stage we have a 14vdDC power supply with a switch, now let’s get some useful voltages.  The 5v and 12v legs of the power supply were built exactly according to the schematic, except I calculated the resistor for 25mA (1.2v red LED) and I put a switch between the output and the LED.  The 3.3v leg was basically the same exact circuit as the variable leg except with r1 and r2 fixed.

The variable portion of this build was the same as the 3.3v leg, I had some pots lying around from an old equalizer whose transformer blew and figured a 1k and 5k in series would constitute decent fine and coarse pots.  I called that a 6k r2 and set r1 toso the max voltage was just below the point where the lm317 started freaking out about not enough input voltage.

That basically covers the entire circuit, the enclosure is a standard radio shack project box I got from a friend’s box of un-finished projects (I think), the screws for this did not come with the box, I assume the originals were pan head and these are not.

The banana jacks came off an old electronic educational board (the sort of thing that exists so you can build circuits with just banana cables).

The project was compressed onto this proto board as much as possible, but the LEDs and resistors were done hanging.

This has been a simple overview of my power supply (I intended on posting this a long long time ago, but I got sidetracked thinking I was going to make a schematic).  

Magnetic card emulator

June 15, 2013

This is a project that developed more out of curiosity and a bit of mischief, but developed into a useful device.  Let’s start with what a magnetic swipe card is used for.  In the united states we use magstripe cards for student IDs, credit cards, drivers’ licences, pretty much anything that requires us to quickly and easily authenticate ourselves.  I understand that the rest of the world has moved on to RFID, QR codes on phone screens, NFC, and all other sorts of authentication methods, but this is the united states, and we’re big.  I don’t get how that means we’re perpetually behind the technology curve, but ok.  I have heard arguments that “of course our internet is crappy and expensive compared to the netherlands and south korea, we had it first, it takes a lot of money to upgrade these systems”.  Shouldn’t profit scale linearly with population? actually if you count start up cost, a larger population should amortize the start up cost to be lower per capita so the ISPs and banks in this country make even more per person than in smaller countries.  I guess having one or two major companies doesn’t really breed steep competition (hi google, keep it up!).  This card standard has been around a while, it uses three distinct stripes that can hold data in well defined ways as seen in the ISO standards mentioned here.

These cards communicate by having opposingly magnetized areas in the stripe that induce a current in an electromagnet when they change polarity.  One way to simulate one of these cards is to simply create a chunk of magnetized card that has the same transitions, but the easier and more software definable way is to use an electromagnet to simulate these transitions.  Now, having 3 distinct electromagnets makes it hard to simulate a multi track card as you have to feed different magnetic fields to each electromagnet.  This would make simulating a drivers’ licence difficult because they use multiple tracks to store data.  Now, if you only need to simulate one track then you can do what I did, which is to create a big honking electromagnet and spam all electromagnets simultaneously.  This method is only useful for the least secure and cheapest of all magstripe cards. Guess which ones My school uses?

The seed idea for this came from people recording and playing back these signals from an ipod.  This method looked cool, but I really wanted to be able to define the card ID on the fly.  This brought me to the arduino card emulator, but that code was a bit off from what I needed it to do.  After a friend re-worked the code we have this.  The place with all the zeroes is where you put the card number as read by your friendly track 2 ps/2 keyboard pass through card reader.  Oh,you don’t have one? check out this sourceforge project.  This emulator only uses an h-bridge, an arduino, a coil of wire (I unwound a transformer for some), and a sheet of metal.  The metal I chose is a small pile of sheets from the transformer glued/taped together.  I used that metal because I knew it wouldn’t hold a magnetic field and would transmit the field change fairly well.

I suppose this is a fairly short post, mainly because it’s a fairly straightforward project.  The arduino pro mini used in this version has a power LED, it dims as the h-bridge draws current from the batteries and browns them out.  This unintended feature is nice to see it actually “swiping” the card.

The non-malicious use of this device involved the fact that my school gives us ID cards that deteriorate at a surprising rate and charges ~$10-$30 for a replacement, since they only use track 2, I use this.

UPDATE: I have been asked for specifics, I used a 5V arduino pro mini and fed the ~6v directly into the VCC pin of the pro mini.  Taking a look at the schematic on sparkfun you can see that the RAW pin is the input for raw voltage to be regulated down to you VCC voltage, I’m running a bit higher than the arduino is spec’d for, but with some old alkaline batteries you usually don’t get over 5.5v (which is the top end of the spec for the 328).  I assume you can use the 3.3v one, although I haven’t tested the code to make sure the timings still work right.  If you are in doubt you should check the integrity of your emulated card by making sure it shows up properly in the same ps/2 pass through reader you used to get the number in the first place. I? have no specifics on the coil size, but I think I used about a meter or two of wire (I could be wrong).  If you really want to be specific you can measure the resistance of the coil and the supply voltage and use V=IR to check your current draw and decide whether or not it’s too much for your batteries.

BOM (bill of materials):

arduino pro min (5v 16mhz knockoff from ebay)

momentary button

L293D (or SN754410)

magnet wire (salvaged from a transformer)

sheet(s) of metal (salvaged from a transformer)


electrical tape

hot glue


I would refer you to the datasheet of the H-bridge for further information, but if you still don’t understand after reading that I can probably help.

Easy Computer Power Switch

August 23, 2011

I can’t seem to find my inspiration for this (I blatantly ripped off someone else’s project) but I thought I’d post it.  I work on lots of old computers, and frequently when I’m testing a whole lot of motherboards I find it useful to have this header made out of a bit of pcb, a panel mount db9 connector shroud, and  an old pc switch harness.  There is no circuitry, nothing complicated or even innovative in this project, it’s compact and I find it useful.  (photos courtesy of my HTC dream [G1], new camera on the way)