Sunday, December 27, 2009

The Robot

I've been in school since August, which leaves little time for building fun side projects like I do when I'm not in school. What I have been building has related to our first senior design project, where we were asked to build a robot that could "perform" laproscopic surgery.

You can read about that here.

The project was interesting because we were allowed to use a $4500 computer and microcontroller to interface motors to, and it was definitely a good learning experience, as the popular cliche goes. I think the reason we were assigned this project is because our professor was asked to build one by some company, and he used us to get ideas for how he wants to build his. Whether or not that is true is something that wasn't discussed, but that's the rumors that are out on the streets.

While I was doing that, I have had lots of ideas for things to build which I will probably put up here in the next couple days since I have to go back to school in about two weeks.

First up, things I have actually done but didn't put up. First first up, Sue! I put the stock radio back in the center console but kept the aftermarket head unit wired up. I have to find another glove box from a junkyard to cut apart to put the aftermarket head unit in. I don't want to cut apart the stock glove box, just in case I want to change it later on. Pictures will come later.

Sue also needs a new distributor. I spent a couple of weeks hunting down new seals for her current distributor to try and fix an oil leak, removed the distributor to replace the seals I thought were broken, but I don't think that any of those things have fixed the oil leak. I think the only solution is to take the distributor itself apart and fix a seal on the inside, which I probably won't be able to find parts for, so it may be more economical to just replace the entire distributor itself. Or, just ignore the problem since it's not a dramatic leak. Not sure what I'm going to do yet. Something to note though, when the distributor comes off the engine block, oil will come out. So that's something that needs to be prepared for, unlike what I did, which was panic when oil started pouring out of the engine.

Here's the more exciting vehicle stuff. I bought a truck!


It's a '99 Nissan (of course) Frontier, with a King Cab and four wheel drive. It also has really nice 31'' 10.50 BF Goodrich all-terrain tires on it, and I've added a nice UWS toolbox and Cobra CB radio with a quarter-wave whip antenna. I got the truck for a considerable amount under Kelly Blue Book, after learning my lesson with the 300ZX. DON'T BUY ANYTHING OVER THE KBB PRICE BECAUSE YOU ARE SURE TO LOSE A LOT OF MONEY IF YOU TOTAL IT. That said, there are some things wrong with the truck that I kind of like because now I get to fix them. The other important thing, I have found, is that it is a lot more fun to go romp around in the woods with a 4x4 truck than to tear around on a road in a sports car and be paranoid about cops all the time. Plus it's a lot safer. Any way...

The most noticeable is the paint job is very, very bad. Paint flakes off at speed on the interstate from areas on the hood, the doors, the gas cap, and a few other places. The plan is to find some white primer and just keep the truck from rusting. It's a truck, so it doesn't matter [to me] what it looks like as long as it's functional, but I would like to keep the body in good condition.

Most of the rest of the things wrong with the truck are very, very minor. Right now the right passenger-side turn signal doesn't work, and I found out a month after I bought the truck that the fog lights don't work. It seems like they're not wired up properly from the factory, so I'm going to have to figure that out. It's a puzzle!

I was given two 10'' MTX subwoofers and put those in the KC part of the cab of the truck. I got a fairly small Pioneer amplifier to push them and they add just the right amount of bass to the speakers. I believe I will be upgrading the speakers in the doors so that they will be able to keep up with the subs, and possibly upgrading the amp on the subs as well. The goal is quality though, not quantity.

I will hopefully be adding a 1000-watt power inverter somewhere in the truck as well. That, however, will be a separate entry here if I do it. I have a 300-watt inverter now (not in the truck) but it's not enough power to run a drill or other power tool so it's not as useful as I think it should be. I think that's about all on the truck.

The REAL interesting stuff coming up is going to be the designs for the light switch in the kitchen in my apartment. My roommates and I are tired of getting up off the couch to turn off the kitchen light when we're watching TV (since we have a projector, the light in the kitchen washes out the picture), so I'm going to build something with a Arduino microcontroller that allows us to turn off the light from the couch without getting up. In the future, it may also be able to turn on the kitchen light when people come in the front door. But that's something for the future!

Saturday, July 4, 2009

Fridge Speakers

Long story short, if you leave your iPod in your car in the summer in Charleston it will probably break. Especially when you used to cook pizza in the summer on your car's black vinyl interior. So now, on my iPod, the chip that controls the headphone jack only works if it's cold. Go figure. And as I'm poking around on the internets looking for someone who will give me more than $20 for my initial $400 investment, I got frustrated and decided I'd do something with my iPod. Since it can only work when it's cold, it seemed logical at the time to build some speakers into our refrigerator and play music on the cold iPod, so when someone is getting a refreshing beverage they'll be refreshed with some pleasant tunes while the door's open.

First thing's first. I don't want the speakers to be on all the time, using up power and being annoying to everyone around, muffled behind the closed door of the refrigerator. So I had to figure out how to wire the speakers into the refrigerator light so they'd turn off when the door shuts. After many ideas, including photodiodes and relays (my previous project was supposed to use relays and then it turned out to not need them, so I was wanting to use them here), I found this neat gadget at Home Depot for $3 that makes life a lot simpler.


It converts a light socket into two power outlets and a light socket. So I plugged that in to the light socket inside the refrigerator and put the light back in it and plugged the speakers into the now available 120V receptacle.

Here are the speakers that I bought at Goodwill for $4.99 but they gave me a Canadian penny back, so they were an even $5. In this picture they've already (obviously) been installed in the refrigerator.


So now the speakers turn on and off with the opening and closing of the fridge door. Next up is getting that pesky iPod wired up. The iPod is set up to play a playlist (summer playlist now) continually all the time.


Any way, the iPod can't start up and get a song going fast enough for the typical trip to the fridge (plus I don't want to write a program to get it to do that), so I decided to have it play music all the time. It doesn't use up that much power so this isn't a big concern since the speakers turn off when the door shuts. But, since the receptacle I installed at the door light are only on when the door is open, I had to apply external power to the iPod by running an extension cable out to a regular wall outlet.


Works perfectly. I love random ideas. The only downside here was that I did this on the Fourth of July in the afternoon, and didn't consider the possibility that the iPod and speakers would be set to an insanely high volume (which they were), and that I wouldn't be able to tell since the iPod hadn't gotten cold enough to work yet. Then we left to watch fireworks, and my roommate and I came back at different times late at night (not in the best frames of mind) and opened the fridge to grab a drink and got extremely surprised by random tunes from a place they are not normally playing. Once the volume was adjusted it caught on pretty quickly though!

Wednesday, May 27, 2009

Xbox Media Center: ccxstream

So I modded my xbox a while back, basically turning it into a media center. I keep TV shows, movies, and games on it. It's pretty handy. Any way, it only has a 200 GB hard drive in it, and a while back I discovered a program called ccxstream that allows me to use another computer as a media server, thus making the xbox's hard drive as big as any server it can connect to.

Any way, after upgrading to 64 bit Ubuntu a while back and trying to run ./ccxstream from command line, I got this error:

bryan@SERVER-UBUNTU:~/$ ./ccxstream
./ccxstream: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory


I've gotten this error before and since then forgot how to fix it, so I'm putting it up here in case I one day forget again. The fix for this problem is to install the appropriate libreadline file, which can be done by:

bryan@SERVER-UBUNTU:~/$ sudo apt-get install lib32readline5
Reading package lists... Done
Building dependency tree
Reading state information... Done
lib32readline5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
bryan@SERVER-UBUNTU:~/$


The key is that it's the 32-bit libreadline file. The one the 64-bit OS looks to is the 64-bit readline file, which my version of ccxstream doesn't like.

Tuesday, May 26, 2009

Something I Worked Out While Driving My Truck

OK so this is probably not going to have any pictures, but I need to get this down somewhere. I was thinking about Chase's Eclipse, and how the relay circuit I built was pretty big since I used relays instead of an IC. The reason I chose to go with relays in the first place is because I couldn't figure out a way to get an IC to tie into a real-life circuit. What I mean by "real life" is a circuit that has voltage AND current. And yes, I know that there is a little bit of current in an IC, but never enough to really work with. Definitely not enough to trip a relay. So the question I had always wondered, was how do you get a circuit at 5 volts and almost zero current to do anything useful?

I think the solution involves finding a field-effect transistor with a cutoff voltage (or "cuton" if it exists) of 5V. Then, tying the IC output to the gate of the FET and using the source and drain as the "switch" for the main circuit. FETs can usually handle exponentially more current from source to drain and only need a voltage at the gate to turn them on or off. I think this is a perfectly good solution to minimize the scale of Chase's circuit and increase reliability. (Relays wear out after about 500,000 operations.)

But any way, last night Chase and I were working on the Eclipse and remembered that the rear center plate that actually says ECLIPSE is the stock plate, and it's tinted red. So no matter what color the lights are on the inside, on the outside they'll be red. So this pretty much negates the need for the circuit whether it's built from ICs and FETs or from relays. We're still going to put 7000 mcd white LEDs back there, only they're just going to be wired straight into the brake lights and that's it.

More on that later.

Saturday, May 23, 2009

Felicity's Floor Mats and Shift Knob, More from Sue

So I ordered new "Z" emblem floor mats for my '92 Nissan 300ZX. The ones that were sold to me with the car were cheap generic rubber floor mats, and there can't be any of that in a car that is nearly a classic. To the best of my knowledge, the 300ZX came with mats that said "300ZX" up until '92 when Nissan switched to the "Z" emblem. They look pretty sleek, especially compared to the old mats, and really round out the interior.


I also bought a new shift knob. The old one's leather was wearing off and that's something that also needs to be fixed. The stock shifters had black stitching, and this one has red, which I think is a nice touch. I think that the JDM 300ZX had red-stitched shifters but I'm not sure. Any way, it looks pretty good.


This picture shows how badly I need to pull out the 10-CD changer that some idiot did a very poor job of installing. The plan is to get some black plastic to cover that panel in the dash and have a friend of mine engrave "300ZX" on it.

This was just a good picture, showing the new shifter and the new passenger side floor mat.

I also finished Sue's trunk liner a while back and only just now got around to putting pictures up. It's gotten a good bit of use since I installed it, and with all the stuff sliding around on it, it seems that I'll be carpeting it soon.


Monday, May 18, 2009

Hit the STOP button!

OK first of all, for my one reader, which is probably just me (and maybe Bradley) but that's ok since I only really made this blog (interesting post-production note: the blog's spell checker thinks that "blog" is not a real word) to keep myself in line any way, I know I haven't been up on things. I've been working on "The" Power Supply for Relay for Life, where I was on a team with the company I work for, which just so happens to be the power company. We weren't allowed to use generators so I mentioned I had a non-generator/silent power supply we could use to run lights and a projector. This plan was highly successful and somewhat ironic, when the actual power to the high school we were at went out and the power company team at the Relay for Life were the only people with lights on. Anywhere.

Any way, I'm not sure yet if I want to put the power supply up here, despite the fact that it's probably the coolest thing I've ever built. That project took up a good bit of time though, along with the fact that I was also working on an air conditioner for my car (Sue) because she doesn't have one built in. But I might put pictures of that up sometime.

On to better things! As you all know, I have a '92 Nissan 300ZX named Felicity, and up until recently I thought I could modify the the stock rear center panel to look something like this:


Any way, the stock center panel lettering is actually silver paint on a black backdrop. I did not think that was the case. On the other hand, my buddy Chase's '99 Mitsubishi Eclipse has a backlightable rear center panel:

[picture of this later]

The idea for my Z was to run a set of red LEDs off of the brake light wire, and a set of white LEDs off the tail light wire. In the Z (and apparently most Nissans of that era) there's separate brake and tail light circuits that never operate simultaneously. So when the brakes come on, the tail light circuit voltage drops to zero. This would be easy to wire up.

The Eclipse, not so much. The tail light circuit stays on all of the time, and the brake lights come on as needed. So simply moving the circuit design from the Z to the Eclipse wouldn't work because the white and red LEDs could be on at the same time. No one wants this.

So I said to myself, "Hey! How about some logic gates and what not?" and I replied "Yeah that'd be great, but none of my professors up in college taught us how to actually use ICs in a real life circut to run anything useful, they only just taught us the inner workings of logic gates just in case we went into the bustling industry of logic gate fabrication." Then I told myself I'd figure something else out than some lame integrated circuit. I mean, I am an electrical engineer, after all, and when we build computers (or logic) we do it almost 100% with hardware. No one wants to see any software. That's slow, and boring. So, this is what I did:

I bought three 40A relays. One is an 8-pin DPDT relay from Radioshack. The other two are standard four-terminal automotive relays. The plan is to use the 8-pin relay as a NOT gate which would be connected as a "normally closed" relay connected to the brake wire. Then, the other two relays would be connected in series to form an AND gate. One of the relays would accept input from the "normally closed" relay from the brake wire and the other would be wired up to the tail light wire. Basically, this is the logic implemented:

The brake light is connected to the top input, and the tail light to the bottom input. The white (tail light) LEDs are connected to the output. When both are on (when the tail lights are on and the brakes have been applied) the NOT gate tells the AND gate to output a logic-0, which turns the tail lights off. Otherwise, with the brakes off and the tail lights on, the AND gate outputs a logic-1 which turns on the white LEDs. Meanwhile, the red brake LEDs will be wired straight into the brake light circuit. The only logic needed is to tell the white tail light LEDs to turn off when the red brake light LEDs come on.

Here is my circuit diagram of what I planned to build. The relays are numbered 1-3 and labeled "normally closed" or "normally open." In the picture after this one, relay 1 is the relay on the top left, relay 2 should be the relay on the top right, and relay 3 should be the relay on the bottom right. More or less, relays 2 and 3 are interchangeable. The actual circuit ended up not being wired up exactly like this, since my idea of where a +12V DC voltage source should be were off a little. But you can see my changes now:


Definitely rocking the free prescription drug post-it note pad. NOTE: When this circuit is moved to the Eclipse, the 12V DC sources connected to switches labeled Bs and Ts will just be wires tapped into the brake/tail wires. This was a drawing of the circuit model, not the circuit that will be put into practice. The resistor labeled TL is the tail light LED, the brake light LED is not pictured in the drawing because it is so simple to wire up. And... I don't know if that's actually the symbol for a relay, but that's my artistic interpretation of what it does. Although I guess you wouldn't actually call it "art" since it's useful and makes sense. But I think it's neat. The circuit I drew up makes sense to me, and that's what's important. ALSO IMPORTANT: A fuse, or many fuses, must be built into this at some point.

But any way! This jumbled mess is the circuit that I physically built:


Actually that picture had two misconnected wires. Also, the breadboard has a bunch of other junk on it from previous projects that you may or may not remember. But I fixed all the problems and the circuit worked amazingly well, after I wired up a 12V DC rectifier to the circuit so I could just plug it into the wall to test it. Any way, the red test LED came on when the brake switch was in the GO! position regardless of whether or not the tail light switch was in the GO! or STOP! position. Likewise, the white LED was on when the tail light switch was in the GO! position but only if the brake switch was in the STOP! position. You get the picture.

I tried taking pictures of the lights with the switches in various positions. That just washed out the pictures, and it was impossible to tell what color light was on. Any way, more on this when Chase and I actually put the circuit in the car and get real lights for it.




PART 2!

I'm going to start by throwing in a picture of the rear of Chase's Eclipse to show everyone what we're working with. It's a '99 model with a really big rear wing, but it's non-turbo. I'm not an Eclipse guy so I'm not really sure which version of the Eclipse it is. I also like how you can see just a little bit of my 300ZX in the background.




Any way, here's the rear center panel from Chase's '99 Mitsubishi Eclipse. The plan has been to backlight it somehow, and now we're going with a simpler single-color design which does not involve any relays, transistors, or ICs. Kind of boring, but it'll look good when it's done. This next picture gives a general idea of how much light comes through the center panel.


The back of the rear center panel was covered in a silver mesh. We sanded it down pretty well to remove as much of it as possible without losing the textured effect. The more light that can come through, the better.


The next post should be us finishing it up. I just wanted to get these pictures up here.




PART 3!

All right! This one looks pretty good when it's finished so hang in there.


First thing's first. We started out by measuring where the lettering was in relation to the back of the panel and drilling the holes. Chase made a measuring error here but it ended up working out. We had ten 7,000 mcd white LEDs from Radioshack, so we were going to drill ten holes. Well, Chase measured and divided and marked eleven spots somehow. So we decided to use nine LEDs to everything would still center up (leaving the two on the end out.) The picture above shows the LEDs installed in the plastic backing of the rear center panel, which more or less just snaps back together.


This picture shows the underside of the panel, with the LED leads sticking out of the back. We made sure that all the anodes and cathodes of the LEDs lined up to make it easier to wire. We started with an aluminum grounding rod because I thought it would be easier, but aluminum oxidizes really fast if the soldering iron gets near it. We eventually removed the aluminum grounding rod in favor of stranded 16-gauge copper wire. Probably a little more work but it did the job right.


The next step (even though I'm writing it somewhat out-of-order from how the pictures show, but it happened in the way I'm writing) was to solder in the current-limiting resistors. Since diodes have [essentially] no resistance, simply connecting them to a power source would cause a short-circuit, which would definitely ruin the LED and potentially damage other things. The resistor values are calculated by:

(available power source voltage) - (voltage drop across LED) = (LED rated current) * (resistor value)

In this case:

12V - 3.3V = 25 mA * 348 ohms

The available power source voltage (car battery), voltage drop, and rated current values should all be known. The manufacturer of the LEDs should definitely be including the current rating and the voltage drop.

Apart from that, I'm doing this math from memory, so that's at least the general idea. The resistor color codes are clearly shown in the picture so I might be changing this later on. It is important to note that Radioshack doesn't just have a 348 ohm resistor laying around, so I believe we went with sets of 320 ohm and 20 ohm resistors.

Also important to note is the power that will be dissipated by these resistors. The current that will be drawn across the resistors is known, and using P=IV and V=IR, we can deduce that

P=I^2 * R, and since I=0.025A and R=320 and 20 ohms, we can show that the most power any resistor would dissipate is about .21 watts. This is why we chose quarter-watt resistors.



After we finished tying up all the lose ends, we cut off one of the bolts on the center panel and used the now-freed hole in the body of the car to run the wires back in. Then we cut a 5-amp fuse in line and tied it all into the brake wire. This is the result:


Awesome. I especially like how it kind of looks like an actual eclipse. (The event, not the car.) The camera I use sucks for taking pictures of lights, so imagine a better version of how this looks and that's actually how it looks. Also, it wasn't quite dark outside, so at night the lights will appear to be much brighter. Maybe I'll get to take a picture of that later on.

As a side note, you can see Sue a little on the right. She has a fresh coat of wax and is extra shiny.

Sunday, April 26, 2009

Sue's New Trunk Liner

So the first thing I'll be doing to my old Sentra (on this blog, any way) is building a custom trunk liner. Here's a picture of the trunk, which reminds me that I need a new scissor jack and tire iron.


The old liner was made out of cardboard and more or less disintegrated over the course of the past twenty years. To top that off, a few weeks ago I was at a friend's house working on Sue with the trunk liner out, and someone thought it was garbage and ran over it with their jeep. Can't really blame them, though.


I made some measurements and bought some 3/4'' plywood and cut it into four separate pieces. They fit down nicely and line the whole trunk, as opposed to the old one which only covered the spare tire bay. There'll be a hinged part in the middle so I can get the spare tire out if need be. (I've blown three tires since I was 16 and started driving this car. The wheels are so old they don't hold the air in the tires very well any more, and if I don't stay on top of it the pressure gets real low.)


Any way, I realized after starting the project that I won't be able to put it all together and then put it in the trunk, so I'll be doing some manual screw driving with my back end hanging out of the car. But that just adds to the excitement!

I'll finish this project up soon.

Friday, April 24, 2009

160 GB MP3 Player for $160

My first MP3 player was pre-iPod, and I bought it second-hand from a friend of mine in high school for $100. It's an Archos Jukebox Recorder 20 and is probably the greatest MP3 player ever made to date, despite its age.

Let's run down what made (and still makes) this media center great. First of all, it doesn't have a scroll wheel. That means that if you're driving, and you know the song you want to hear is three songs from the one you're listening to, you press the button three times and you're there. No more mucking about with the scroll wheel always going either too fast or too slow.

It also uses a standard parallel-ATA laptop harddrive. So, remove the default 20 GB hard drive and install a 160 GB hard drive, and for about $60 you have the largest MP3 player ever created. Probably. It's about double the size of my music collection, which is good because my old iPod was still too small for that. This is what I will be doing.

Also worth noting, the outer casing is INCREDIBLY durable. Especially those little rubber stopper things. And you can't scratch it without trying, unlike my old iPod which would scratch if you looked at it funny. And, the greatest thing about this MP3 player is that it has digital AND analog inputs, and you can record MP3s straight up at about 180 kb/s. I used to use this all the time to rip vinyl records, or record live shows. Just hook the MP3 player right up to the mixer's output and there you go. Oh, and it has a built-in microphone. In case you don't have a mixer.

There are probably a few other things that I'm leaving off about this MP3 player, oh, like how it's basically just an external hard drive that coincidentally plays MP3s. None of this "you have to have a special program to put music on" or "hopefully you have iTunes, and you don't use Linux, otherwise you'll never get it to work without doing something really crazy." Nope. Just plug it in with an A-A male-male USB cable to any computer and drag-and-drop. This is how MP3 players should be. (Listen up, Apple.)

So this one had a bad hard drive. I just realized how much I relied on my iPod, and it recently broke. Something about heat, and one of the ICs getting damaged. Something overly complicated. Any way, I was motivated to fix this and plugged it up, and it sounded like a bad hard drive. So I removed the old one:







Sure enough, it's just your standard 2.5'' laptop hard drive. So no problem! Just run to BestBuy and pick one up. The hard drive kind of lifted out of its mount, which I guess was a little weird. I felt like I was straining the pins on the motherboard. But everything worked out.

It's important to note that this MP3 player does not work properly on AC alone, the AC adaptor is pretty much only used to charge the batteries, even when the player is running. It must have batteries in it to work. Which reminds me of ANOTHER thing that makes this MP3 player great. It takes four AA batteries AND can recharge a set of rechargeable AA batteries! So, getting a set of rechargeable AA batteries and the MP3 player will take care of them for you! And when they run out on a long road trip, just pop in some Duracells or whatever and it'll still work. No more messing around with weird Apple proprietary adaptors and permanent batteries that wear out after a year of use.

Any way, the MP3 player won't work without batteries. With the new drive in and no batteries, I kept getting a "hard drive register error" and remembered that this was a quirk with this MP3 player. It really needs batteries! Good ones!

While I was out I remembered another cool thing about this MP3 player. It has discrete on/off/play/pause/volume up/volume down/back/forward buttons. Unlike an iPod, which has to be all synergizing.


Appropriate song.


Getting new software on the new hard drive wasn't too complicated. I use Ubuntu Linux and using GParted to initialize and format the partition to FAT32 would have worked had I tried that first. It's what I ended up doing. But I had to be all "Windows will probably be able to do this easier" even though I had never done it in Vista before. Mistake. Leave it to Microsoft to hide such a key feature way in the back of some utility and make it impossible to figure out without using the Google. Any way, once the drive is initialized and formatted, everything works just fine. All the firmware was already on the MP3 player from before, so it wasn't necessary to flash it with new firmware. I did already mention the issues with the batteries, so once I figured that out everything was smooth sailing.

Monday, March 16, 2009

A boring one... but whatever.

So I used to be a Windows user in my lesser days. Any way, two years have gone by since I switched full-time to Ubuntu, I haven't found a replacement for Quicken until now. (I was listening to the Moody Blues and it just came to me... Online banking! Yippie!) So here's what I did to install GNUCash in case I forget later.

first of all, (can I put code tags in this? I'm going to try.)


sudo apt-get install gnucash


We'll see if that worked later. But you get the idea. Any way, this is what I came up with. Here's a screenshot of the first thing the program did after I opened it! Almost nothing. About par for the course for an open-source program though.

Not even a wizard to show me the ropes. After some Googling, I found the wizard, which wasn't actually much help.

So yeah. The wizard wasn't very self-explanatory. I used this Wiki and this blog of all necessary banking information and numbers and such to find the necessary information on my bank, because apparently BB&T isn't a large enough bank to be listed on that wiki, and because this program isn't as intuative as Quicken and has all the monotonous banking numbers built in already. Whatever. Google helps.

After plugging all the numbers in and then hitting the "Get Accounts" button on the "User Configuration" tab of the setup wizard, I think I'm good to go.

--

I'm not good to go yet. Something isn't jiving and it's too late to fix. Peace out.

Thursday, March 12, 2009

$5 Radio? Think Again.

My latest project has been unofficially going on for about four years now. When I was in high school I discovered that the Goodwill in the town I grew up in didn't just have second-hand clothes, it had second-hand electronics. So I bought a Sega Genesis for $10 and an awesome purple tie for $2 before stumbling over this radio:

It is a Fisher Studio Standard AM/FM Stereo Synthesizer Tuner, FM-271A with 16-station (8FM/8AM) preset tuning system with electronic memory and a message on the back that says it is DESIGNED ONLY FOR USE WITH FISHER CA-270/CA-274.


I do not have a FISHER CA-270/CA-274, I only have this radio. At $5 it wasn't like I was spending real money. Any way, this is apparently more of a problem than I realized at the time I bought it. When I got home and tried to turn it on, I noticed the following:


It only accepts 19V AC as input power AND it uses some weird, small, two-pronged thing to get it. The reason for this is that Fisher probably meant for it to be plugged into its partner amplifier only, so your average Joe couldn't just go out and buy the radio without buying the accompanying $200 amplifier. Or however much it cost. You get the point.

But I'm not about to let some marketing scheme get me down. I'm going to build a power supply for it that will accept 120V AC and output 19V AC.

The solution for this problem isn't as simple as it sounds. The problem is, in fact, many fold. (Many fold?) First of all, electronics like this nowadays generally want some sort of DC voltage as an input. The solution for this would be very simple: build a full-wave bridge rectifier and voltage regulator (the parts would cost about $5 all together, making this a $10 radio). The radio probably came out of the 80s before electronics like this got real big.

Secondly, I do not have the tools or materials to simply build a 120:19 step-down transformer. This would be the easiest solution provided I had those two key elements. The best I can do is a 120:25.2 step-down transformer from Radioshack (25.2V CT 2.0A Heavy-Duty Chassis-Mount Transformer with Lead), and then build a voltage divider out of resistors on the secondary of the transformer to drop the voltage down to the required 19V (the radio is considered the load).

Voltage Divider - Wikipedia

So the first step is to get the math straight. The sticker on the back of the radio says that the power specifications on the radio are 19V, 10W. The resistive component of the impedance of the radio is found to be 36.1 ohms because P=IV=I^2*R=V^2/R and 10=19^2/36.1. The current flowing through the radio is found to be 0.526A because V=IR and 19=0.526*36.1.

The supply voltage from the secondary of the transformer is 25.2V and the radio needs 19V, so using a voltage divider Vo = [R2/(R1+R2)]*Vi where Vo is output voltage (19V), Vi is input voltage (25.2V), R2 is the radio's resistance (36.1), and R1 is the value of the resistance that must be found to build the voltage divider. This value is found to be 11.78 ohms, or, in engineering terms, about 12 ohms.

This is where another problem arose. The only place I could find any resistors with this small of a value was in a pack of 500 quarter-watt resistors from Radioshack. But just using a single 12-ohm, quarter-watt resistor as R1 in this voltage divider circuit would lead to a quarter-watt resistor absorbing about 3.32 watts, which would cause what we in the electric power industry call a "material failure." So I had to dig through the rest of the 500 resistors to find a combination that would be equivalent to one 12-ohm resistor but also not let any single resistor dissipate any more than about .2 watts (to be on the safe side). This is the model that I determined to be the safest and best course:

Believe it or not, the first five rows of resistors make a 12-ohm equivalent resistor that dissipates the appropriate amount of power without overloading any single resistor. If I had had more resistors available to me that were of a particular value, I could have done a much simpler job, but that would have involved me buying more $12 packs of 500 resistors at Radioshack, most of which I will never use in the first place. Also, it is physically impossible to use less than fourteen quarter-watt resistors to dissipate 3.32 watts.

I've tested this model quite extensively in B2Spice and do not see any power dissipation issues and will hopefully get to work building the power supply for this radio this weekend.

NOTE TO SELF: FUSE THE CIRCUIT TO AVOID POTENTIAL FIRE.




OK I just built the resistor for my voltage divider. I built it according to the model and that came out a little on the high side (about 15 ohms) so I removed all of the 2.2 ohm resistors at the top of the circuit and added some more 100 ohm resistors in parallel on the bottom of the circuit which brought the resistance down to 12.4 ohms. Half an ohm is nothing, if the radio argues with this then I'll do something more drastic.


Those ICs are just some operational amplifiers that I don't have any place else to put. But yeah, there's the circuit, and it should work fine once I buy the transformer and hook up a fuse in line with this. It's coming together. And yeah, I also know it's Friday night so I'm going to do something much, much less nerdy now, like go play football in the mud or head to a bar. Probably the bar.




PART 3!


So it's late at night, and I finally got the radio working ( ! ) which is pretty exciting. After several jams on the staple gun, I got all the electrons going in the appropriate places.

I got the original voltage divider circuit working. In the picture you can see the transformer (the big, stainless-steel box on the left, screwed onto the board) attached to three much larger resistors than were in the previous post. These are specialty 10-watt resistors that Radioshack makes that I did not know about until I was in trying to find the transformer. There are two one-ohm resistors and one ten-ohm resistor, which makes life a LOT simpler than that array of resistors I had set up before. Much easier to wire up and I know the power ratings are good.

Once I had the circuit wired up I tested it and got about 13.4 volts, which seems high but is to be expected since the rating on the transformer is higher under no-load conditions. The voltage should drop a little bit once current flows through the circuit into the radio.

Any way, the radio works perfectly (from a power standpoint) so the next step is out of the scope of this blog: Hooking the whole thing up to some speakers and rockin' to some tunes on the radio! Assuming the radio itself actually works...

--

UPDATE: The radio does work, and works surprisingly well. However, I have had to make some changes to the power supply design. First of all, when it is plugged in the transformer was always energized, and when transformers are energized from one side or the other they do use power. This transformer had a tendency to get significantly hot even if the radio wasn't on. The solution for this was to add a switch to the primary side of the transformer. This lets me turn the transformer off without having to unplug it from the surge protector.

Saturday, March 7, 2009

Sue!

One large ongoing project I have is my "old" car. Her name is Sue, and she is a 1989 Nissan Sentra that my dad purchased brand-new in 1988 when I was only a year old. My dad used this car as a daily commuter for about 14 years until he got a new Civic. A year later when I was 16 I started using this car as my primary vehicle, pretty much just driving to school and back and doing lots of teenager things.

My dad has been telling me about once every two years that "It'll be great if this car gets you through a year of high school/through high school/through your first year of college/through college/a year or two longer." Since she's made it this far, I've decided that she's not worth anything to anyone but me so I might as well turn her into a project car (even though I'm more or less the original owner). Sue is very, very reliable for being 20 years old, so the plan is to restore this car to how she was when she was driven off of the showroom floor.

This is Nissan's famous GA16i engine. It's a fuel-injected inline-four that develops around 90 horsepower and probably an insignificant amount of torque. It is a great engine for getting to and from work (I work in North Charleston, the seventh most dangerous city in America, on Ashley Phosphate road, a road that is one of the most dangerous roads to drive on in the country) and for getting surf boards to the beach. This engine has a timing chain, which means it'll run forever as long as the valves and seals are kept up. This particular engine has around 170k, which actually isn't a whole lot for a 20 year old car.

The two things that are not visible from these pictures are the wheels and the muffler. The wheels are the original wheels, but the original paint fell off sometime before I was 16. I painted them gray with Rustoleum but that's starting to fall off now, too. It also dosen't help that Sue has front disk brakes and rear drum brakes, which causes brake dust to accumulate on the front wheels but not on the rear wheels.

The muffler is not visible because it is non-existent. It fell off about eight months ago and just hasn't been replaced. The lack of a muffler gives the GA16i quite the exhaust note, but it's not so loud that its noticed by cops. And it helps to be in South Carolina where there are no state inspections of vehicles. Hooray!

You can see the amount of work that'll need to be done to the interior. I've removed some of the front console and the entire center console, and you might be able to see the huge cracks on the dashboard that have come about from parking this car outside for about five or six years. That'll need to be replaced too. Everything else is in pretty good shape except for the seats, which have some pretty big rips in them. If I can find some new seats to replace these, I'll remove the seat covers.
I recently removed the back seat, partially because the rear deck and tail light assembly need to be replaced due to sun damage. The other part is that I will hopefully be able to fit my 8'2'' surfboard in the car without putting it on the roof rack (I don't like driving long distances, i.e. Florida, with what is pretty much a huge wing strapped to the top of the car). The rear seats are in good condition, but all of what is in this picture is incredibly dirty and some parts have started to rust. The trunk needs to be de-rusted as well because my dad drove it around for at least a few years with a leak in the trunk that allowed a large amount of water to collect in the spare tire bay.

Needless to say, this car has not been too popular with some of my friends who just happen to be girls. (On the opposite end of the spectrum, anyone who has ever driven this car and has helped me work on it loves Sue.) After I bought and (through no fault of my own) crashed a motorcycle (Ana Maria, an 07 Kawasaki Ninja 250R), I now have Felicity, which is my "new" 92 Nissan 300ZX that gets 16 miles to the gallon and goes from 0-60 in about five and a half seconds.

Monday, February 23, 2009

It has some kind of aesthetics.


Let me start by saying that this is an old and already completed project, but I felt like I needed something other than computers up here to sort-of dial back the "power nerd" thing I had going on. Then again, maybe building a lamp from scraps isn't the most normal thing, but it's at least better for you to read about than me messing around with UNIX. Eew.

Any way, my roommate and I moved into a place in Charleston a while back and were not prepared for the condition our apartment was in. It was in great shape, but didn't have any lights in it except the kitchen. And maybe the bathrooms. There were light switches for the main rooms, but you needed to provide your own lamp. I had only brought one lamp because my parents wanted to throw it out (hooray cheap college-type furniture from the 80s) and that had to go in my room so I could get dressed and do other important "life" things. I don't remember what my roomie did for a lamp, but we didn't have any lights besides the kitchen and our TV in the living room. We talked about biting the bullet and spending money on a lamp from Wally World, but then I realized I could probably build a lamp for cheaper than I could buy one. (Plus, I like building stuff. I also really hate going to Wally World.)

First I found my trusty roll of electrical tape. Then I gathered spare building materials. I had just finished building a sort-of shelf for the trunk of my car (more on Sue later) and I had some spare wood left over. Toss in an old extension cord to connect all the bits, and the only parts I had to buy were the switch and the base for the lightbulb, and these ran me about $5.

From the top down: I electrical taped the base for the lightbulb to one end of the leftover wooden post I bought for the legs of the shelf I built. Sure, I could have glued it, or bolted it down, but times were rough, and we only had daylight available for a couple hours a day. No time to be dainty.


Also, I went with the classic incandescent bulb. It's not a matter of light quality, or that I'm a huge fan of Thomas Edison (he was kind of a dick). It was just lying around so I used it. But once it burns out I'm totally going with the flourescent bulb. Those babys might not be real environmentally friendly, or great to have around pregnant women, or easy on the power grid, or safe in general, but they are real easy on the power bill, and what really counts is saving me money.

Next I cut up the extension cord and attached it to the various parts, making sure to run it through the light switch too. The switch has a neat feature where it illuminates when it's off so you can tell where it is. I didn't know that when I bought it, but it is quite handy.


Pretty much all that was left was making it appropriately tall, which was accomplished using some orange stakes and another piece of wooden post. And lots of electrical tape. The base I used at first involved wood, but it didn't survive moving, so now I just have it zip-tied to a futon. It's not the most attractive thing, but it works. And this current model has survived three moves, so even though the electrical tape might not look savory, it does the job without starting fires. And that's always a bonus.


As a side note, I feel I should mention that you should NOT build the lamp in a place you don't want it to stay, put a CFL (compact flourescent light) in it, then lift it up to move it without first noting available clearance between the lightbulb and the celing. Otherwise, a glass tube filled with mercury is liable to shatter on the celing and shower you with bits of glass and other unsavory things.