Introduction: AVR LCD Namebadge
I found this great instructable that shows how to breadboard this same circuit, and this is based on it.
This is my first project that I've taken from breadboard to schematic to protoboard to functioning PCB, so I'm going to try and document some of the pain I went through along the way, as well as some things that helped, in hopes that your first end-to-end electronics design is a little easier.
Step 1: Supplies
- Decently-sized Breadboard (I used an 840-hole)
- Breadboard hookup wires (I prefer stiff hookups for on-board work and longer flexible ones for ISP hookup and long runs)
- Multimeter with conductivity testing mode (beep!) and DC voltage mode
- Soldering iron - I have a 50-watt that I love.
- An etching vessel - see PCB etching instructables.
- A drill and PCB drill bits (I used sizes 65 and 75). A mini drill press helps too.
- A hot glue gun (optional, but barely - the wire broke twice on me with very little force applied)
- An AVR ISP programmer (I built a USBTinyISP)
- Helping hands (optional)
- An ATtiny2313 (or 2313A, which is what I used - functionally equivalent)
- An HD44780 LCD with a single row of pins
- A 20-pin DIP socket
- A 7805 Voltage Regulator (you can definitely get away with a low-amperage one too, I just had these laying around)
- A 100uF capacitor
- A 10uF capacitor
- A 330-ohm resistor
- A 10K-ohm resistor
- A 1N4004 diode (other diodes will probably work fine too - make sure to read the datasheet though)
- A 5K linear potentiometer (or between a 1.5K and 2.5K resistor if you don't care about contrast adjustment - YMMV)
- A 9V wired connector - preferably one that doesn't suck (I have suck ones.)
- Breakable male header strip - you'll need 16 pins, but these usually come as 40-pin strips.
- Etchant - again, see etching instructables
- Solder, preferably very thin stuff. I'm using .015 diameter.
- PCB, single sided, whatever color you see fit.
- Hot glue sticks - awwww yeah
Step 2: The Schematic
I've attached the eagle schematic. Feel free to let me know your opinions about it in the comments - I'm very new to eagle, so I know it could be better. Study it enough to know what's up.
Step 3: Breadboard It
You are welcome to jump ahead right to making the PCB and diving in, but I recommend breadboarding it beforehand so you know what you're getting into. I've attached a picture of what my breadboarding ended up looking like. See this instructable for intimate breadboarding details.
Step 4: Programming
git clone git://github.com/hank/lcdiesel.gitYou can view the source code for this project here:
I've made some tarballs for your convenience, but getting the latest version of the code is preferable. There's no good way to do this from github at the moment - it's in my huge repository of junk that I don't recommend you clone (it's big..).
All this code is written in C, a real programming language. Sorry, Arduino folks. I encourage you to learn AVR programming if you want to complete this project - it's completely worth it. The Arduino is great for getting excited about microcontroller development boards, but there's nothing better than ordering a chip from Digikey for a dollar and being able to do just as much with it as with a $40 Arduino. </rant>
You're going to need avr-gcc, avr-objcopy, and avrdude. I'll leave that up to you to figure out. Make sure to set your fuses up without CLOCKDIV8 and at 8Mhz. I used my favorite fuse calculator to generate the following settings line:
avrdude -c usbtiny -p t2313 -U lfuse:w:0xe4:m -U hfuse:w:0xdf:m -U efuse:w:0xff:mIf you're going to get into AVR programming, learn about the fuse calculator - take it for a spin!
Step 5: Etch a Board
Here's the board file for eagle. I used a toner transfer, and it worked fine. Use your favorite etching instructable.
Step 6: Drill Eet
Get out your high-speed drill and PCB drill bits and drill out all the holes. I used a smaller bit on the holes for the IC socket, and a slightly larger one for almost everything else.
Make sure to insert the IC socket the right direction. Mine is currently backwards, which would be an issue if I didn't know the circuit like the back of my hand.
Solder the header pins onto the back of the LCD, with the short end through the LCD holes. This leave us some nice long pins to go through the PCB. Insert it with pin 1 at the left edge of the board viewed from the top. The LCD should not be on top of the IC. You should now have something like the picture shows (just not on protoboard).
Step 7: Solder It
Now that it's all drilled, place your components. Make sure to orient the capacitors correctly if necessary (I used electrolytics, which are polarized). Remember - stripes look like minus characters - stripe to ground. Make sure your diode is the right way - stripe away from positive voltage input. Think of that stripe as a little wall for electricity - you don't want it coming in from the side the stripe is on. The 7805 is oriented with the heatsink plate against the board, and if you look at it with the pins facing you, the left pin is VIN, the middle is GND, and the right is VOUT. See the datasheet for further descriptions. I ended up with 5.06V DC very steady measured at my ATtiny VIN from a 9V battery said and done.
My etching didn't come out how I wanted on this one, so I was struggling to make sure my connections were tinned and fully connected to eachother. An etch job can make or break a project.
Step 8: Test It
Now that you're done soldering, run through all the point-to-point connections with your multimeter - Battery to diode to cap input to regulator, regulator ground to ground, regulator out to resistors, etc. If you have some connection that doesn't pass muster, try to find the break, and either tin over it with solder or use some sort of soldered jumper to bridge the gap (like a wire lead clipping). Once you hear enough beepity-beepity-beeps, we can test with the powah.
Now comes the moment of truth. Plug in a 9V battery and see what happens. If there's nothing going on, unplug, feel for heat on the components, and test your connections again with your multimeter. If it works, tell a special person in your life about your accomplishment!
Step 9: Glue Stuff
I assume you found where to glue the red wire for the battery (to the pad with the input of the diode) and the ground connection (I may have left that off the board layout - just drill a hole where you want it anywhere on the huge ground polygon on the copper side of the board). I have mine right next to the ":D" part of the board. Anywhere in the giant copper area is fine - that's all grounded. These are the two wires that gave me trouble. Once you solder them, the casing melts a little and gets soft, and the wire becomes very easy to break. Just take your hot glue gun and go to town on the top of the board where the wires hit it. If you've ever used hot glue, you'll know what to do. If not, I'm sure there's some website you can learn it from. Maybe a YouTube video even.
Step 10: Wear It Like You Stole It
So, now that you're done, you have a fully functioning LCD nametag you can customize! How cool is that? I now have 2, since I did one on protoboard and then took it to an etched PCB. I might be adding some sort of enclosure when I figure out what I want to do. There's a really neat Lexan clear enclosure Instructable I want to try out...
Step 11: Appendix I: Protoboard
After breadboard was completed for this, I decided to build it using protoboard. I used this crappy Chinese protoboard I got from eBay, which worked, but wasn't anything like the RadioShack protoboard I used before. I highly recommend finding protoboard with copper contacts in sets of 3 or more stripes. Single through-hole copper pads are not convenient, burn off easily, and can be a huge pain to join into lines or buses. I've attached a picture of what mine ended up looking like - I know it's ugly as all get-out, but it proved the design worked, and allowed me to move on to eagle.