Monday, June 9, 2014

Project dump

Sorry for not updating the blog in a long time. Anyways, here's what I've been up to.

1. Misadventures of the skeletonDAC

Because of a̶l̶i̶e̶n̶s̶   bad engineering, my Dell E6410 laptop makes copious amounts of high-pitched hissing, beeps, and other funny digital noises out of its headphone jack. While occasionally amusing, it's also incredibly annoying when trying to listen to music, so I decided to obtain an external USB DAC. One of the cheapest decent options is the DIY skeletonDAC, which can be built for about $20. It has a completely imperceptible noise floor and sounds great. 


Not mine...


The skeletonDAC has some substantial SMD soldering involved, including soldering a PCM2704 DAC chip with 0.65mm pin pitch. Yikes. All I had was a cheap $5 iron and some 22 gauge 63/37 solder.

SMD soldering actually isn't too bad. On my first attempt, I used the flood and wick method, which is exactly what it sounds like - you flood the pins with solder, and then remove the solder bridges with wick. The results were acceptable:




As documented previously, I accidentally soldered the chip in backwards during attempt 1 and destroyed the chip attempting to desolder it.

In attempt 2, I tried flood and wick again, but I accidentally went too aggressively with removing the solder bridges and bent and destroyed several pins of the PCM2704 while wicking.

I switched to flux-based SMD soldering in attempt 3, which works absolutely fantastic. With flux, you can do cool things like drag soldering chips:



With flux-based SMD soldering, you apply solder to the tip of your iron and transfer it to the pins. This is a huge no-no with through-hole soldering, but works exceptionally well for SMD if you flux the pins of the part you're trying to solder.

Unfortunately, DAC attempt #3 started exhibiting strange issues. It first refused to turn on, then started sporadically spamming volume down and mute (shorting pins 22 and 24 on PCM2704 to pin 27). After several soaks in isopropyl alcohol (I suspected uncleaned flux residue was shorting the pins), the thing worked, but had serious high-frequency attenuation.

Thinking I might have damaged the chip with heat, I made a 4th build, which also attenuated the highs.
 

It turned out the flux paste I was using was acid flux, the kind of stuff people use to solder pipes and really bad for soldering electronics.

Attempt 4.5 (using attempt 4's board, a new PCM2704, and proper flux) finally worked. Unfortunately, 3 days later, it fell victim into the same issues as #3. At this point I had spend $100 on building a $20 DAC.


Currently, it looks like the left and right channels are being mixed seeing as the output on the two channels looks identical in Audacity:


Intro to Jaco Pastorius' Continuum
Here's the non-attenutated output from my phone:

This is probably what's causing the attenuation, as according to the user DingoSmuggler on Head-fi, "Bass will always be in phase between L + R channels due to its long wavelength, but mids and highs will often be partly out of phase relative to the mic placement and/or any stereo effects used which results in attenuation when summed.".


I probed the outputs of my DAC, both before and after the output DC-blocking caps, and there seem to be no shorts. Still investigating...

2. RGB swing arm Lamp


I didn't just use the Colorize function in GIMP,  I swear.


This was my final project for my EK 156 Design & Manufacture class over at BU, which I worked on with Vinny Celeste and Nick Maresco.

It's a swing arm desk lamp that uses RGB LEDs, specifically 3 of these $5 ones. The lamp is mechanically made pretty much entirely out of 6061 aluminum, save for a sandblasted polycarbonate "lamp shade".


For the electronics, I decided to etch a board at MITERS and installed it in an inexpensive aluminum die cast enclosure. It uses an LM2576 buck converter to take 24V from a wall wart down to the LED forward voltage (2.5V for red and 3.5V for green/blue), and feeds it into a PWM circuit. 


Complete with lazily drawn inductors.

Admittedly, I voltage drove the LEDs (LEDs are current driven devices and are much better done using constant current) and furthermore used some obscene 555-based PWM circuit instead of say, just using a TL494, both of which are major design issues. On the other hand, it works (well, at least until the LEDs blow up because lol voltage driven LEDs).

Also, I learned TO-220 MOSFET tabs aren't ground and will lead to issues if you ground them.

I ended up getting a B in the class, but whatever.

3. Imaginary Over Due Scooter


Inspired by Noel Hwang's scooter , which he built last summer, and following Charles Guan's excellent guide, I decided to build own electric kick scooter.

Design goals:
- 15mph top speed
- 2-5miles of range
- Regen braking (this is more out of curiosity than actual necessity)
- <$450
- Be sort of lightweight


Following Noel's advice, I decided to use 5" wide aluminum 6061 U-channel from McMaster as a chassis. I would have preferred to fabricate a T-nutted aluminum chassis or a welded steel one, but I don't have easy waterjet access, and steel would require painting.


Other tentative specs:

Fork: Crufted off a Razor A3
Motor: Hobbyking SK3 6364-190KV brushless DC motor
Controller: Kelly KBS36051

Wheels: 5" x 1-5/16" Colson Performa 65A solid wheels (donut tread because turning)
Gear ratio: Probably 9:25, #25 chain sprocket
Battery: 10S 2P A123 26650 LiFePO4 cells, 33V bus
Chargers: 2x Turnigy Accucel 6S chargers in series (because screw paying $120 for a 10S charger




If I wanted to, the U-channel could easily fit 8S 5P A123s, which would net some obscene amounts of range. However, my use case for a scooter is mostly for short 2-4 mile hops rather than 10+ mile trips (which I would either take the subway or use my bike for), and fitting in that much battery would make the scooter really heavy. My expected use case for the scooter involves bringing it on the subway and using it for the short hop between the subway station and my final destination, which favors a more lightweight scooter. I decided to shave down the U channel and run 10S 2P instead, for lighter weight and a slightly lower ride height. 

In reality, I would like to build something very lightweight with hub motors, like Charles Guan's RazEr or RazEr rEVolution. People warned me against using hub motors for my first ever EV, however. Also no waterjet access.

Anyways, random incomplete CAD drawing:

This photo probably shows nothing other than laziness at CADing
Currently, the scooter is a pile of parts sitting on a shelf at MITERS, while I try to find some time to get down to actually making it. More to come...



Sunday, March 23, 2014

SMD soldering is easy, but not when you're an idiot.

Over the weekend I attempted to build a SkeletonDAC. The board is tiny and involves plenty of SMD soldering, including soldering an SSOP-28 chip (with pins spaced 0.65 millimeters apart). I had a $5 el-cheapo iron, a tweezer, some 22 gauge solder, and some wick. Challenge accepted.

 The SkeletonDAC page has an excellent guide/tutorial on building a SkeletonDAC, which I followed pretty closely.

The method for soldering the SSOP-28 chip was to anchor the chip by soldering down its first and last pins, and then lathering solder over all the pins until it was stuck to the board. This solders the chip to the board, but also solder bridges all the pins, so the solder bridges were removed with copious amounts of solder wick. Be aware that solder wick is sort of abrasive and will easily remove solder mask.

The results were pretty good considering I was doing this with a $5 iron and thick solder, and soldering the chip took about an hour. I checked over the soldering with a loupe and found all bridges.


Having some sort of loupe is immensely helpful in checking that all the pins are correctly soldered without destroying my eyesight. I used a 50mm f/1.8 lens I had lying around, which works pretty well for an improvised loupe.

Soldering the 805 and 1206 resistors and caps was a piece of cake, and in my opinion, easier and faster than soldering through-hole parts since gravity isn't fighting you. If you're right handed, you first put a blob of solder on the right pad for every part. Then, you grab the part with tweezers with your left hand, and insert it into the blob while your right hand holds the soldering iron and melts the blob of solder, which anchors the part. You then solder the other side of the part. Soldering 20 or so SMD caps and resistors only took 40 minutes, with much of that time spent simply taking the resistors out of the packaging.

After that, it's straightforward soldering of through-hole parts.

Unfortunately, I was a massive idiot and soldered the chip in backwards, which I only realized after soldering everything else in. Attempts to desolder the PCM2704 ripped the pins off the chip, and at that point, I might as well start from scratch and order a new PCB. In the end, I wasted 3 hours and $15 worth of parts because of one extremely stupid mistake. Oh well. 

My other acts of idiocy this week included leaving a banana in my backpack, which then proceeded to commit seppuku and spill its insides all over my bag. Banana is actually a terrible substance when not eaten - it's sticky, hard to remove (especially when dried up), and gets everywhere. My notes are now covered in banana, and one of my laptop's USB ports no longer works since the contacts appear to be covered in dry banana. Derp.

Sunday, February 9, 2014

A fancier bass guitar headphone amp

A while back during the summer, I etched and put together an MXR headphone amp so that I could quietly practice my bass. It also worked fairly well as a preamp for hooking the bass up to my bookshelf speakers.

I followed the above circuit and laid it out in EAGLE with a few tiny modifications (replaced a 4.7uF with 10uF there, and such), and stuffed it in a scrap piece of 2x4" aluminum box channel. 


Unfortunately, it was fairly lacking in features, as all it had is a volume (actually gain) control. It lacked tone controls to adjust treble and bass, and I also could not easily practice along to a recording as it lacked a mixer.

I also made the board a bit too short for the aluminum box channel I used for the case, requiring a fairly long DC jack and frequently leading to the DC power getting cut as the connector jiggled and wiggled quite a bit.

So in light of its problems, I decided to make a new headphone amp.

Features I wanted:
-Runs off a wall wart (I was debating using a small transformer off Digi-key so I could do true split supply, but transformers are large and I didn't want to deal with 110V AC)
-Built in tone controls.
-AUX in, for practicing along easily to recordings
-Works

With my extremely limited EE skills, I ended up merging three circuits: the earlier MXR headphone amp, the Baxandall mixer and tone control from Elliot Sound Product's universal preamp, and the op amp rail splitter from Texas Instrument's TLC074 tone control .


All LM358s and 4558s are actually NE5532s (because laziness).

The circuit takes a (bass) guitar signal in, amplifies it with a JFET op amp, runs it through a Baxandall tone control, and mixes it with a line-in signal and runs through a class AB common collector amplifier to supply enough current to directly drive headphones. There's also a guitar-only line-out output, for recordings or other nefarious purposes.

Admittedly, some parts of the board are excessively tight and other parts are kind of sparse. Oh well.


Etched board.

Admittedly, I laid out one of the pots backwards and formed several solder bridges. I also apparently forgot to finish routing one or two small traces, which let to major butthurt in fixing (hint: before printing the board, View > Layer Settings > turn off everything except unrouted and make sure you actually routed everything). The posted EAGLE files have the pot traces fixed and has everything laid out, so don't worry about it.

With many of the parts soldered on.

For the case, I had crufted numerous LaCie hard drive enclosures that was sitting in a trash pile behind Warren Towers last semester.




I used the extruded aluminum part of the case. It was almost the perfect width, though I had to cut it down a bit in length. The PCB was mounted with nylon standoffs and M3 screws. The front panel was machined from 3/16" aluminum and held in by the potentiometer nuts. I unfortunately did not CAD out the front panel when designing the board, and had to spend substantial time with calipers and consulting datasheets to measure out where to drill the holes (it also took me two tries to get it right; definitely doing this a better way next time). I had to mill off some of the fluting on the bottom to drill the holes to mount the PCB, as the fluting makes the drill bit slip.

Mounted.

 I decided to panel mount the 1/4" jack, aux in jack, and the power switch, mostly because of the 80x100mm EAGLE light restrictions on board size (the pots took up most of the room on the board). I didn't have any 3.5mm stereo panel mount jacks available, so I took a PCB-mounted one and JB-welded it to the front panel.

Tentacles of DOOM

Front panel drilled and mounted. Also needs better lettering solution than Sharpie.
For the knobs I used these somewhat overpriced pieces of plastic from Tayda Electronics. To align the knobs correctly and symmetrically to the pots (important for Baxandall, as 50% pot setting means completely neutral), rotate the pot counterclockwise all the way. Then rotate clock about 150 degrees  - when the slot is perfectly horizontal, the pot is at 50%. Insert your knob and tighten your set screw.

Still needs a back panel.

It's still missing a back panel, which I will probably get laser cut or milled sometime in the future.I also currently don't have a means of attaching it (I will probably use vast globs of my preferred adhesive).

Should you choose to build this:
EAGLE files(no implied warranty/do this at your own risk/I'm not responsible for anything you do with this)

You'll need the Sparkfun EAGLE library for the DC jack and the 3.5mm audio jacks.

Among other bad EAGLE practices I have committed on this.
-EAGLE has no NE5532, and with the pinout being identical to most dual op amps out there. I just got lazy and put 4558 in its place on the schematic. So all the 4558s are actually supposed to be NE5532.The TL071 stays as a TL071. IC1 especially needs to be an NE5532 (or some other op amp that can output a decent amount of current, e.g. JRC4556 or TLV2462).
-The +12V and +14V are actually both 12V, just separate rails. I actually don't know how to specify separate rails of the same voltage.

Other stuff to note:
-I'm not actually sure R33 and R34 are necessary, and I merely included space on the board to solder them in if they turned out to be necessary (so far they don't seem to be not). I built my headphone amp without them and it works fine.
-Despite being designed for 24V DC in from a wall wart, the prototype decided to short (and later the transistors magic smoked) with 24V (despite most of the parts being rated for over 30V), so I run it off 16V.
-The 500K volume pot should be log/audio taper, while the 100K pots should both be linear.
-In many areas this board is unfortunately laid extremely tightly. If the pots you buy have anti-dust seals (a la cheap Alpha pots from Tayda Electronics), you'll have to remove them for the 500K volume control and the 10K treble control.
-Do not neglect installing C4, as the whole thing will turn into an AM radio if you don't low-pass the input. Trust me, having to listen to business talk radio while practicing bass is not pleasant.

Sunday, January 26, 2014

12V wall wart power supply in a jar


I did this project a while back and didn't document it terribly well, so I'll keep it short. About a year ago, I took apart a 5V / 12V SMPS wall-wart (for a long-obsolete Iomega Jaz drive, 5V 1A and 12V 0.75A, IIRC) out of curiosity and destroyed its casing by doing so. Soon after I found myself in need of a 12V source of power, and running a wall wart without a case is a great way to kill yourself, so I needed to find an enclosure for it. So why not put it in a jar?

I punched some holes in the jar's lid to add a 3-prong IEC jack, a power switch, a standard 5.5mm DC barrel jack for the 12V (which plugs into the power supply via a 3.5mm jack), and a USB charging port (for the 5V), all held in with hot glue. The PCB is wired to those connectors and hangs off those wires like in the picture.

I also added LEDs because cool beans. Presently it powers my crufted set of computer speakers, and I occasionally charge my phone off the USB port.


Wednesday, January 1, 2014

Defretting a Squier bass guitar

I picked up bass guitar in high school, mostly as a result of listening to excessive amounts of Jaco Pastorius.

After using my high school's bass for over a year, graduation forced me to buy my own instrument. I originally intended to buy a fretless as my first bass. Unfortunately, that plan fell through - I specifically wanted a fretless Fender Jazz bass, but used Made-in-Mexico Fender Jazz fretless basses were priced above my reach, and I didn't dig the look of the budget Squier VM fretless. I wound up with a white, fretted Squier Classic Vibes Jazz Bass that I quite liked, which I promptly installed flatwounds and a black pickguard on and played on happily for several weeks. Still, the temptation to defret (especially after repeat listens to the bass intro from Weather Report's "Cannonball") was just too great.

So why fretless? 

-Much more control over pitch. Without frets, you're free to play much more expressively.  Smooth glissandos, cello-style vibrato, non-12 tone scales, and much more are possible with a fretless that are impossible with a standard fretted bass.
-Listen to some Jaco Pastorius - "Cannonball" (from Weather Report's album "Black Market" and "Continuum" (from Jaco's debut album) are pretty good examples of the expressiveness possible on a fretless.
-Fretless looks awesome. There's no frets breaking up the clean, sleek lines of the bass neck. 

Unfortunately:
-Fretless is (much) harder to play in tune for obvious reasons.
-A finger has much more area than a little wire fret, so fretless also changes the tone (which can be good or bad). 
-For the same reason, fretless basses often have less sustain. 
-It's hard/impossible to slap on a fretless.
-Unless you epoxy/hard-coat the fingerboard, roundwound strings can't be used without wearing out the fingerboard.
-Because they're more of a niche instrument, resale values (especially self-defretted ones) tend to be poor.

In my case, I was willing to tolerate a change in tone, didn't slap, used flatwounds anyways, and didn't intend to sell this bass ever. So defret it was.

Anyways, photos! Credits to Noel Hwang for many of them.
(The Jamaican strap, which I originally did not realize was of the Jamaican flag, was found in a thrift store for $3)



My bass, pre-defret
Removing the strings.
Masking tape so I don't damage the surrounding wood.

The frets were glued in, so I heated them up with a soldering iron to weaken the glue before removing the whole fret with a chisel. Masking tape was used to reduce fingerboard damage, but I often ended up burning the tape with the soldering iron, and the fingerboard often got chipped anyways. The chipping was minor though, and didn't end up affecting playability at all.
Using a soldering iron to weaken the glue.


Coming out (with taped scorched from soldering iron)


One out, nineteen to go. A lot of that crud is masking tape glue residue,
which was easily removed later with a sanding block.

The general strategy was to use chisel (with the soldering iron applying heat) to get under the fret at one side and push it out of the wood and up, and then slowly using the chisel (or pliers) to gently remove the rest of the fret, going from one side of the fret to the other. 



A fret. (the nail clippers in the background proved to be useless)

I slowly spent the next hour or so pulling all the frets out. It went pretty well - there some light chipping of the wood around the frets as I pulled them out, but nothing too heavy. The frets got a bit harder to pull as I went down the neck, most because it was harder to find a place to use as a fulcrum for the chisel.The last 3 frets or so took forever.

I also went too long with the soldering iron for the 2nd fret and ended up burning some of the wood, forming a cavity after the rosewood smoke cleared:




There was also some darkening around the wood on the other frets. I ended up filling the cavity with CA (super glue) and sanding it. It's visually still a bit noticeable, but it's perfectly flush with the wood.

No frets!
  I decided to fill the fret slots with black .020" styrene sheets, often available at hobbyshops; I bought mine's off Ebay at $7 for two 12"x12" sheets. I ended up using far less than that. The strings of a bass are at pretty high tension and pulls on the neck quite hard, so it's definitely advisable to fill them in. Black styrene looked decent against the rosewood, although they later proved a bit hard to see. 

I cut them into small strips the width of the fret slot with a pair of scissors. The bottom of the slots also have a slight radius, so it's a bit wise to cut a slight C-shape into the bottom of the styrene.



After being cut to width, CA was applied to both faces of the strip of styrene and the strip was inserted into the fret slot. It sticks pretty much upon contact, so you need to align it just right when you insert it.


Afterwards I shaved the plastic strips down as best I could with an X-acto knife. It doesn't have to be perfect, since the whole fingerboard is getting sanded later.



There were a few chips from earlier that I filled in with blobs of CA. They take a while to dry. The blobs were made flush in the sanding process later.

Noel was bored and decided to make me a 9.5" radius sanding block as a break from his electric scooter project  (Thanks Noel!). I put on a breathing mask (rosewood dust is quite an irritant) and sanded down the fingerboard until all the styrene strips and CA filler was completely flush and smooth.

I put the strings back on, picked it up, and plugged it in. What does it feel like? A bass with no frets. It takes a while to get used to, but eventually I got the hang of it. Playing it in tune is still tricky, but the gains in expressiveness is well worth it.
My bass in its final form.

Also, never use fretted vibrato (up and down) on a fretless. This will wear out your fingerboard really fast, even with flatwounds. Use cello-style (side-to-side) vibrato by rolling your finger. It sounds better that way, too.