Showing posts with label electronics. Show all posts
Showing posts with label electronics. Show all posts

Monday, November 24, 2008

Some Assembly Required

You may have noticed that some of those components from last time can't actually be dropped into a breadboard as is. I should note at this point that I've never soldered anything in my life (yes, I'm a terrible person, I know.) But it had to be done, and I had these cute little header pin things that you can solder into the breakout boards and all...

It actually didn't go too badly. I only burned myself once! It's actually surprisingly easy, as long as you pay attention to what you're doing.





After that, I was all set to start plugging things into the breadboard. However...

Fail #1
So remember how last time I mentioned that taking the LCD out of the frame was a bad idea?

I had a good reason, I swear. Look at the connectors on that:

(the above image courtesy of sparkfun.com)


They're some sort of weird spring-loaded... something. So I took the LCD out of the frame to see if it connected to anything that was a bit easier to work with - but no.




You can just barely see the groups of iridescent traces coming up off of the black insulated rectangle. How is that even conductive?? Anyone know?

Since there obviously wasn't anything we could do with it out of the case, Mike and I tried to put it back in, so it wouldn't get accidentally broken.

Ahahahaha...





Why is it always easier to get things out of cases than back into them?

Fail #2

Oops. It doesn't fit. Either I need to find a smaller cheap low-power LCD (I can't imagine I'm going to have much luck), or another pocketwatch. The thing is, the LCD would totally fit in there - if I could just get it past the ring where the front and back screw on.


Anyway, after that I started throwing things on the breadboard - I'm going to build and test the entire system on the breadboard before I start getting serious about final assembly.


From left to right, the things you see are: the whatever-it-is that's providing 3.3V, the SD card reader (you can see the square metal socket), the Arduino (it takes up, what, half the board?) with the audio output jack on the very end. You can see the extra power rail I tacked on, too; I wanted to have an easily accessible 3.3V rail. (3.3V power is color-coded orange on my board - orange is like red, but, well, less so. (Red is the traditional color for power.) I also have 5V on there, so I wanted to make sure it was clear which was which.)




See that big blue clump of wires on the bottom? Apparently the arduino vaguely prefers to use particular pins to talk to the SD card. Just for reference, it's:
CS (chip select/slave select): pin 10
DI (data in): pin 11
DO (data out): pin 12
SCK (clock): pin 13



And since DI and SCK are coming from the Arduino, we have to run it through a voltage divider to get it to a value that's safe for the SD card. We may also have to do that for CS; I'm not sure. Here I just used a pair of 10K resistors (the peanut-shaped things between the SD card socket and the edge of the Arduino) for each to cut the voltage in half - 2.5 volts is within the acceptable range according to the SD card spec, so it's all good.


Me being all industrious and such.


Mike, my partner in crime, looking up datasheets for me.

And then, uh, I got home and realized that even as fanatically neat as my breadboards always are, I was going to be super cramped on that board. So I went home and pulled all the stuff out of another board I had from an EE class (which I failed, incidentally. I was terrible at the math. However, I had the prettiest breadboards in the lab!), hooked them together, and transferred everything over.



Complete with my pinout cheatsheet!

Unfortunately, I didn't hook up the SD card reader again, because I ran out of colors of wire that were not red or orange. I may need to go swipe a couple feet of various colors of wire from one of the labs. *cough* er... did I say that out loud?

One last note - see how there's a power rail running under the SD and audio out boards? I've actually got them hooked up to power and ground underneath, like so:





(Like I said, I ran out of everything that's not power-colored, so I used green. Green is the new black. Right?)

For next time, I'll hook it up to the computer and write some code to try to get the processor to talk to the SD card reader and the audio jack. (Although if you really want to see it, I'll share my experience of getting the equivalent of Hello World running on the Arduino.) I'm limited with what I can do with the audio until I get the decoder chip, but presumably I can send it a sine wave or something. Also, I haven't looked too hard at it yet, but this looks promising.

Friday, November 21, 2008

Meet the Components

Look, look, my box of toys got here!!



The processor:



For the moment, I'm borrowing my friend Mike's Arduino clone - I can just drop it in the breadboard and go. I think I'll eventually end up with the ATtiny2313, mostly because it's the smallest AVR processor that SparkFun has with enough pins. But the arduino is good enough to play around with for now.

The SD card reader:

Not an awful lot to say about this guy. Aside from the fact that it apparently wants 3.3 volts, and the Arduino will only provide five. This'll be interesting...


Audio output:
Audio jack and its breakout board.



Sorry for the image quality; I hadn't quite gotten the hang of closeup mode on my crappy little camera.

Notice how the ground pin doesn't appear to actually connect to anything? All we could think of is that maybe it had a ground plane (is that the right term?) inside. This is probably also the explanation for the mysterious pin in the middle of the board and the jack that doesn't seem to connect to anything.

Audio decoder:
Will be appearing as soon as SparkFun gets the breakout board for the VS1053 in stock. Good god, that thing has more instruction memory than the processor. I was seriously considering punting the processor entirely and running everything on the decoder, but it looks like eight I/O pins aren't quite enough, if I want to have buttons and things. (The other reason why this chip is nice is that it decodes EVERYTHING. No, seriously.)

And our special guest star:

Sketchy 5->3.3V converter:

I don't even remember what this is. It's an accelerometer or something. But apparently it puts out 3.3V if you feed it 5, on top of its other manifold virtues. I'm pretty sure I can run all the components on 3.3V, but unfortunately, the only way I have to get power to the board right now is to plug a power source (USB or wall wort) into the Arduino, and it'll only output 5V. Hence the whatever-it-is (really, the Right Solution is one of these, but I didn't think of it until after I placed the order.)

LCD:


It's just a Nokia 3310 LCD. The internets love them for this sort of thing; they're cheap, small, and ridiculously low-power. I decided to pop it out of the plastic and metal surrounds, but this turned out to be a bad idea. More on that next time...

Sunday, November 9, 2008

It's a GREAT idea.

So. I had this crazy idea. Clearly, I need to build an mp3 player into a pocketwatch (i.e., a pocketwatch case with an mp3 player inside it.)

I've been trying to figure out how to design this. I decided to base my design on the Echo, since it looked like the smallest homebrew mp3 player on the market - with a few modifications. I'm going to use an AVR processor, because I can talk to it in C (as a friend of mine said, "Being able to speak in C to a processor is like finding out your mail-order Russian bride speaks English"). Also, I'm using microSD for storage instead of regular SD - I'm going to have to do crazy miniaturization to get it all to fit. Oh, and I'm using a cooler music decoder chip.

...ok, so it probably isn't really the same design now. But you get the idea.

Components I need to get:
-Pocketwatch case, as large as possible
-MicroSD card and some socket that can talk to it
-A processor. AVR?
-Audio jack and whatever associated hardware it wants
-mp3 decoder chip
-an LCD. I'm going to go with the same one they used for the Echo, because it's small and cheap.

I'll probably have to get a custom PCB made when I'm ready to put it together for real. batchPCB looks like they've got some pretty good deals.

Anyway, ordering from SparkFun now. More news when the box of toys gets here!