The previous two parts of this project description dealt only with the theoretic design of the tachometer; let’s throw it together onto a PCB! I used EAGLE Layout editor here. Only thing I had in mind, that it would be nice if the whole PCB would fit behind a 4×20 character LCD, with connectors on the side, so it would be kinda like a sandwich, plus it would make for a sturdy construction.
So, parts… well, for start, let’s use a DIP Atmega88, I think I will be OK with 3 pushbuttons (Set/Zero, Up, Down?) – and let’s leave provisories for later addons, for example, connect the ADC power pin with the Atmel-recommended snubbing circuitry.
After a few “let’s go back, delete half of it, then try again with the correctly sized components” – love ’em or hate ’em, I like using my spare parts bin 🙂
Go from the beginning, ok? What do we have here in F1? A fuse? You would not believe how many projects I saw where the current draw of the circuit was only limited by the PCB trace width. Use fuses, people!
Power comes from a yawn-inducing 7805, here in SMT format (haaaaate drilling by hand), with the – again – National recommended capacitors, 2x100uF plus 2x100nF.
I’ll later (when all kinks are worked out) design a proper power supply with a switching-mode regulator.
L1 is the 10uH inductor thru which the power is filtered to the Mega88’s internal ADC circuitry, C3 is SMT 100nF (L-C filter), again, Atmel does not recommend this just to piss you off because you don’t have an inductor at hand, and no, a small resistor will not work as intended – I speak from experience, If you omit the filtering, you will get an unstable ADC conversion; I had the bottom 2 LSB drifting…
SV1 is the header for programming the uC, I also designed it with a crystal resonator as an external clock (QF1), but in the end I used the on-chip 8MHz clock.
Signal input is on INT0 thru a resistor, on INT1 I have pushbutton S1 connected, S2 and S3 are connected to PortC 4-5, the rest of PortC is wired to header SV3 (Hey, who knows? Maybe they want temperature sensors and oil pressure sensors later!) PortC is (can be) connected to the internal ADC circuitry, this is why.
On to the LCD screen; SV2 is the connector for it, it has 20 pins, the LCD has only 16, but I figured, I still had spare pins that I’d like access to, like TxD/RxD – for serial diagnostics. The connections are as usual, 1-2 the power lines for the screen, 3 is the input for contrast control, 4-5-6 are the LCD screen’s RS, R/W, E pins. Because I’m using 4-bit communication with the LCD panel, pins 7-10 are empty, and pins 11-14 are connected to PortD on the Mega88. Power for the LCD backlight is on pins 15-16.
After some more fiddling with the components, this was PCB version 1.0 I came up with:
A few useful tips:
* if possible, avoid traces under potentiometers, so you can drill a 3mm hole in the PCB so the pot can be adjusted
* EAGLE’s default settings for the pad sizes are really not for the DIYer, they are for CNC drilling, you might want to adjust pad sizes in Design Rules, under Restring
Observe – default settings under Restring:
And with the Restring values tweaked:
Values that worked for me: (changed 25 to 55)