Archive for June, 2013

4017 based keypad matrix scanner

June 27, 2013

So, here’s  a simple concept I modified to be a lower pin count and fewer processor cycles less.  The original example I found here used a 74hc595, which is an 8-bit shift register) to scan one bit through the register and through some clever trickery with pull ups and pull downs read out serially what row and column that button is in.  My modification did away with the shift register (which you have to prime with one bit every time you scan) and replace it with a decade counter.  The decade counter does just what we’re using the shift register to do, scans one bit out many outputs.  The decade counter can start in an unknown position, but the start up reset circuit (a diode, capacitor, and resistor to temporarily pull the line high until the cap is charged, then pull it low always after that) sets it back to a known state.

I haven’t seen anyone else try this particular setup before, partially because if through some cosmic radiation (or something more likely)  and a bit gets flipped then you’ll be off-by-one for the rest of your days.  This can be gotten around by triggering the reset line before every read, but I’ll try my hardest to keep the pin count down.  The next problem is that the decade counter resets after ten cycles, not eight.  This should be able to be remedied by tying the reset line to the 9th output, but I haven’t had much luck making that work.  The solution  I came up with is to manually clock the device twice after every shiftIn().  My code here makes it easy to implement the keypad polling in whatever code you’d want.  This could be expanded to a 4×4 matrix with minimal modification (it was originally designed for such, but I’m not using one).

The circuit is fantastically simple to wire and to code for.  I didn’t have any circuit board I was willing to sacrifice to this temporary setup so this is some old wire wrap board (no copper).

This was to be used in the OpenAccess system, but it was abandoned like lots of other parts.

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.

Rre-purposing an HP laserjet control panel

June 27, 2013

One of the things I salvaged that I didn’t think would be that easy to get working was this HP control panel.  It turns out someone else has already done the legwork to get it working for the most part.  The original source I have for my specific control panel is here.  That site has a really good description of these HP modules, but I can certainly say they are not all the same.  It seems to me that the VFD controller (m66004) is SPI, there is also a shift out register (74hc595), and a shift in register (74hc165).  All of these devices being SPI you can control them all with very few wires.  The module I have has a VFD and 8 buttons, I have an m66004 and 74hc165 on my board.  There is also another version that uses a 74hc595 to drive LEDs as an output.  The arduino library doesn’t need to be modified to remove the LED driver code, but you just don’t have to use the LED output functions.  The board I have also has 9 buttons, one more than the shift register can support.  It appears that the 9th button is connected to the 2nd and 8th button inputs meaning that it cannot be detected independent of the other two and those other two cannot be detected together without incorrectly detecting that the 9th button has been pressed.  The code is 0-indexed, so it’s buttons 1, 7, and 8 that are tied up and button 0 is the first LED.  The demo code has everything in it to demonstrate how to use the functions.  The part I find most interesting is how easy it is made to define custom characters.  Here is my version of the code that does my best to detect the 9 buttons and doesn’t use the LED output commands that don’t apply to my board.  The original arduino library hosted here may have more button functions implemented than mine (there are button isPressed, wasPressed, and wasReleased for people that want to poll constantly or just check periodically).  

Siemens PLCD5583 arduino library/demo

June 26, 2013

OK, now I pulled one of these off the front of a rack mount server (dell, I think) and it’s really a pretty old design.  This display uses an 8-bit data bus for the character to display, and a 4 bit address bus to pick the digit to display it on. They also have a plethora of other features: individually flashing characters, blinking the display, brightness control, lamp test, and clear.  First: the flashing characters.  You can set a register for each character to set that character as either flashable or not, and set the characters that can flash to flashing or not.  There is a second bit that can be set to blink all the characters at the same time.  Next we have the lamp test function: this one sets the character to all on, and all the segments are on to see if any of them are out.  The clear function is pretty obvious, the brightness control has three bits of control from off to full brightness.  The code I have here on github is not a library (yet) mostly because I think I should use shift registers to minimize the pin count.

“Computer” speakers

June 26, 2013

This is a very old one, maybe I’ll update with an approximate date later, but it has to be before 2006.  So, I’m a smart ass, and so are my friends, for the most part.  We had a pair of computers that were close to absolutely useless, some old HP pavilion compact towers.

 They were absolute crap, no good for anything, but for some reason we got the crazy idea to turn them into a set of speakers.  So we did just that.  First we stripped the cases of all the computer bits.  Then we stripped the cases of all plastic bits. Then we stripped the cases of all internal riveted-in metal bits.

We turned these into metal rectangular prisms.  Once we had the cases prepped we needed a donor amp and speakers.  The amp was sourced from an old pair of speakers that came with a Pentium 4 era eMachine desktop, the speakers were surplus paper cone car speakers.  No, we didn’t match the impedance, yes they were probably both 8 ohms.

Now we have speakers whose magnets can seriously affect CRT monitors and cases that fit them pretty well, now how do we put it all together? Duct Tape!

That’s black duct tape, this adventure pre-dates gorilla tape

Here they are assembled, they worked wonderfully until we gave them away to a friend.

 

The rest of the photos are here.

 

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.

Simple ethernet link tester

June 26, 2013

I have an ethernet cable tester, it takes a 9v battery, has some 4000 series logic and some LEDs and blinks them based on the integrity of the cable.  This new tester takes some nearly useless old technology and makes a fantastically simple device that simply reports the state of the ethernet link to actual running network equipment.  I will state flat out that I got this idea from this instructables article and that I added no content to it whatsoever.  I am posting about it because I want more people to know about how easily this hack can be done, and how useful it is.  To start off with we have an 8p8c to DA15 network adapter.  Yes, I am going to be pedantic about connector naming, see here for the D-subminiature wiki article, and here for the RJ45 vs 8p8c debacle.  This is commonly known as an AAUI (or AUI) to RJ45 adapter, meant for connecting two ethernet connections that are not electrically identical.  The hack is truly simple, just hook up ground and power (supposed to be 12v, we’re running it at 9v) and away we go.  There is also a momentary push button so power is normally off, but that’s optional.

 The two ethernet converters I modified had different indicator lights, the Link light on each light up when a valid device is at the other end, and one even had an Rx light that glows when the network sends broadcast messages.  I have no idea how such little hardware can determine a valid link, but I assume there is a hardware level detection done independent of any actual data transfer over the cables.  The whole gallery is here.

Cordless headphones revival

June 26, 2013

So, who here hates bluetooth audio? Now who knows what it is? Good, all the same hands stayed up.  I have an alternative to this crappy option: go old school!

Ok, now I picked up these headphones some time in the past, probably at a garage sale.  They are, specifically, Optimus 33-1145 900 Mhz headphones, FCC ID: CLV-A900T.   Originally these headphones had a Ni-Cd pack that allowed them to be re-charged form the base station, it was long dead.  So, to get these operational I need a power adapter, and a new battery for the headset.  Let’s start with problem 2 first, the battery.  The battery supplied 3 volts, was triangular in shape, and had a charger port on the side of the headphones where it could plug into the base.  I really wanted a cheap solution, so I took the best of my 2xAA battery holders at the time (from an old AV receiver IIRC) and glued it right on the outside.  I removed the charging port and re-located the power LED that the battery covered up now.

the on/charge switch is now the on/off switch

Good, now the headset is converted to replaceable batteries (or, you know rechargeable AAs or whatnot) let’s look at the base station.

with mods applied

Here is the back, it has a DC power jack originally spec’d for 18v, a 3.5mm headphone jack for charging the original battery, a volume control, audio in in a less than useful format for my purposes, and a frequency fine tuning knob.  Now let’s look inside and see what I did.

So, right away two things should stick out: that yellow wire bypassing a voltage regulator and that charging jack doesn’t look stock.  The charging jack was removed, flipped over, and glued back down to be a 3.5mm audio in port (it’s wired in parallel with the other audio jacks on the bottom [with shielded cable even!]).  The regulator was there because the original power brick was apparently very unstable and needed to be cleaned up for audio use.  I did this so long ago I can’t remember why I spec’d the new power supply at 16v, but I trust myself because it’s working.  So now we have a working headphone set, cool! but what other features do we want?

Another headphone jack of course! I could have done this right and used a switched jack, but that wouldn’t allow me to tether a friend to me so we could both listen together.  My motivation for this was mainly that now I can play music (I mainly listen to audio books, but I’m strange like that), walk around the house, and when I get to a place with a set of powered speakers I can settle in, plug the headphones into the speakers and keep listening rather than have to queue up the track on whatever computer was nearby and hooked up to those speakers.  So there you go, replaced a toasted voltage regulator, replaced rechargeable batteries with replaceable, and even added a new feature.  I think this one worked out pretty well.  Full album is here.

Replacement power supply build

June 20, 2013

I say build, it’s more a mod.  A long ,long time ago in a college town far away I helped a friend move into his frat house.  After I did this one of the housemates gave me an old monitor and power supply simply because he didn’t need it.  I gladly accepted it, but when I checked to make sure it was the right power adapter I noted it was a 12v 1a one, the display called for a 16v 3a one.  Now, I don’t know exactly the audience I have (yes I do, it’s web spiders) but I’ll tell you right now: there’s no way that will work.  I mentioned this at the time, but was assured that that was the adapter he always used for it (no it wasn’t).  My persistence at wanting this thing to work may seem misguided, but here’s the thing: this isn’t a computer monitor, it’s a TV.  Now I know what you’re thinking  that’s worse right? Right.  But in this case I don’t want better, I want more.  This TV (Phillips 20pf5120/28) has a cable tuner (useless), a composite input (expected), an s-video input (expected, but appreciated), a component input (cool! my first component input), and a dvi input (what?).  The DVI input can only do a resolution of 640×480 (and only digital), but it’s a 20″ 4×3 LCD TV, what more can you expect?  Let’s look at the specs for a new power adapter, shall we? 16v DC: that’s not too hard, if it were 12 or lower you could use a linear reg on a computer power supply to get that, but it’s not too bad.  3a: here we have a problem; that much current usually warrants the power supply to be inside the device it’s powering so those are a bit hard to come by, or at least they were.  I say that because we are now in the era of scrap laptops.  Yes, that’s right, laptop computers are being thrown out left and right for all manner of faults: broken screen, dead battery, won’t boot, broken power adapter (more on this later).  The thing about laptops is that they take a lot of power, sometimes upwards of 4.5a.  The problem now becomes the voltage.  Laptops generally run off of somewhere between 18.5v and 20v to charge their lithium ion batteries.  Let’s see what the junk drawer has to offer.

image taken post mod

We have a nice 19v 3.25a laptop power supply: perfect! Ok, there’s still that voltage problem; there are two ways to tackle this: a switching regulator, or a linear regulator. The switching regulator is a much more efficient design, but requires parts I did not have on hand.  The linear regulators could not pass enough current (1.5a max) but that’s ok, we’ll just put 2 of them in parallel to get that extra current through.

The design of the linear regulator circuit is simple, we use a fixed voltage linear regulator and a voltage divider made out of two specially chosen resistors to set the voltage to whatever we want.  For this one I just pulled out my phone and used electrodroid, but the calculation is simple to do if you want.  The heatsinks are mandatory since I’m running these regulators at the ragged edge of their tolerances.  There you go, a 16v 3a dc power supply that will give you second degree burns if you handle it wrong.

I swear I build these things better when they aren’t just going to be used by me

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 Raijuu.net 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 Raijuu.net 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 Raijuu.net 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).