Building an AVR project without a board.
It is rare that I do a micro project without using a PCB or a prototyping board of some kind. Something like a arduino Pro Mini is cheap enough but they are still bigger and more expensive than a bare chip. Most of my home project don't need a crystal clock and often only use a small number of I/O pins.
A micro-controller like the AVR mega328 is (or can be) a true single chip micro - all you need to do is feed it power and you can have a functioning computer on a chip.
Using a surface mounting package would be possible but using a DIP is much easier.
Working with a DIP on it's back is something called "dead bug" construction - sometimes the chip is glued down for convenience. If the pins are flattened out it becomes "squashed bug" construction.
Making some of the solder joints requires three or four hands unless you get organized. I've found some curved locking forceps reduces the number of hands required back to two.
FYI the forceps themselves were held in place with a magnet. I wire-wrap straight onto the IC pins when I only need one (or maybe two) connections. A touch of solder is probably a good idea because the wrapping probably isn't as reliable as it is when using proper wire wrap pins.
I choose to pre-program a boot loader and application into the chip using my DIP programmer. I only needed to add a couple of small caps, two wires, one resistor and a LED to have a minimal circuit built. Once a 5V supply was attached with easy-hooks the micro booted and blinked the LED.
It is really nice to get feedback early in the build process to know you are on the right track.
I use 8 pin DIN connectors to hook my devices to a TWI serial bus. I feed 12V nominal to the bus and have 5 volts regulators on each of the devices. In the above photo a DIN connector and a poly-fused 5 volt regulator (7805) has been added. The Regulator is glued to the micro. The two TWI pin are connected the the plug.
The micro now has coms and can be controlled by the PC. Software updates are also now possible. I was also able to test the ADC pin I need for the next phase of construction.
I'm guessing most people don't have two wire networks handy so a serial upload such as used by the arduino would be more useful in general.
This project is indented to be a practical device. It is a TWI compatible air-quality sensor module. The sensor used (futurlec MQ135) is extremely simple to use. The sensor is a little power hunger because it has a heated element. The heater is connected to 5V and the regulated needs a heat sink to handle the current.
The resistance across some of the pins (4 pins because they are paralleled, you only need 2) changes with air quality. I simply use a resistor in series with the sensing pins to form a voltage divider. One side of the sensor is grounded, the resistor goes to 5V.
Using a resistor value of about 600K is good to give an output voltage compatible with the ADC. The ADC is programmed to use the internal 1.2V reference.
This arrangement is a little crude and won't be linear. It is good enough for my needs.
The 470K resistor is the previous photo was moved onto the back of the sensor for easier access and another 100K added in series. The whole thing was then ruggedized with polymorph.
Unfortunately those DIN plugs are very hard to solder to and I had to remelt the plastic to repair a bad earth connection.
The sensor worked fairly well and the above plot shows the response (downward spike) to solvent marking pen. (A similar plot is on the TWI page).
There are a couple of minor problems. One is the sensor gets too hot for the polymorph and I had to leave a gap behind the sensor. The other is the sensor value (or my air quality) has continued to drift and the resistor needs to be changed again - this should be fairly easy.
I didn't time how long the build took but it seemed like quite a few hours. Using a arduino would have been quicker but probably not lot. Because of the high sensor current I would have still needed a separate regulator. I'm guessing that using a arduino wouldn't have save more than 30 minutes in construction time.
The mega328 is massive overkill for this application, even a 6-pin tiny-10 could probably do the job given enough development time.
Although I have some tiny devices laying around in case I develop masochistic minimalistic urges in general I use nothing smaller that a mega168 for anything.
At under $5 a chip for a mega328 and under $4 for a mega8 - a lot of micro fun can be had for not much money. This type of construction may be a bit advanced for a beginner but after learning the ropes on something like an Arduino it should be possible make something useful based on a bare chip and a few hours of spare time.
Note that while AVR ISP programmers are quite cheap mega168s and 328s can be also bought from sparkfun with arduino boot loader already programmed into the flash - all for and extra dollar or so.
eddie
http://www.futurlec.com/Gas_Sensors.shtml
http://www.sparkfun.com/commerce/categories.php?c=21
http://www.sparkfun.com/commerce/categories.php?c=7
http://www.sparkfun.com/commerce/categories.php?c=103