Need advice on steps after prototype to miniaturize

Hi,

I have a working prototype of a clock module i am building. Right now it's on a breadboard and I am mapping the design into Eagle. I plan on making a custom PCB for it. Here's a little details:

  • arduino compatible mCU
  • sparkfun lcd breakout board (via i2c)
  • DS3231 rtc clock breakout board (i2c)
  • DS18S20 temperature sensor (via 1wire)
  • Rotary encoder (via 2 digital wires, no interrupt)
  • One digital pin to sense headlamps on/off

And a video (The video shows a teensy 2.0, but using my Arduino mini also works):

Not shown is the 12v->5v voltage converter circuit (7805 + diode + caps). This means I am using 2 pins for i2c and 4 digital input pins for my project.

I'd like to miniaturize this project, but i am not yet confident with soldering SMT. I am thinking of using an attiny2313 DIP, do a custom program (using AVR programmer), as well as a separate DS1307 DIP IC (+crystal) for the clock. Am I going in the right direction, or am I missing steps?

Thank you for your time,
Rob.

Why are you changing the clock IC?
I can understand changing the uC, but I would recommend that you try to keep everything as close to the same as possible, otherwise, you could easily run into unforeseen problems, as your prototype doesn't match your design.

Another suggestions is to buy one of the Surface Mount soldering kits from Sparkfun, bite the bullet, and learn. The biggest key is just having really narrow diameter solder, a narrow tip (Shorter is better for better heat transfer), and a good pair of tweezers. Switching to 1206 or 0805 sized parts are pretty easy to solder still and reduce the size by a lot.

Thanks. The reason i'm changing clock IC is i'm using the rtc1307 lib to read the clock, and ds3132 does not come in dip package.

I do have all the equipment to do smd, but doing an atmega scares me, i'd rather learn with experimenting on cheaper parts! I do intent to do all resistors, caps etc in 1208 or 0806 to get my feet wet. So any tips are welcome!

I do have all the equipment to do smd, but doing an atmega scares me,

OK so start with the easy stuff, keep the DIL package for the processor but use surface mount for the resistors and capaitors to start with.

"doing an atmega scares me, i'd rather learn with experimenting on cheaper parts"

So go surface mount on the Rs & Cs & Regulator, stay with DIP for the other parts & use sockets so you are not soldering the chips directly.

There ya go - 3 votes on 1/2 SMD design :slight_smile:

Awesome :D. SMD it is, leave the throughhole parts for breadboarding 8)

Thank you for the push. Got any tips on the components used? E.g. what processor to use? Does it really make a big difference between ds1307 and ds3231 rtc?

Go with what you can easily obtain.
I'm doing a clock now with '328P, couple buttons to set the time, shift registers for driving LEDs.
I have demonstrated code that tracks time well just within the '328P, no external RTC at all, using micros().
Haven't written it to recover from power loss, I suppose writing data to EEPROM could be implemented fairly easily,capturing data once a second across several bytes that move thru memory for "wear leveling" purposes.

CrossRoads:
Go with what you can easily obtain.
I'm doing a clock now with '328P, couple buttons to set the time, shift registers for driving LEDs.
I have demonstrated code that tracks time well just within the '328P, no external RTC at all, using micros().
Haven't written it to recover from power loss, I suppose writing data to EEPROM could be implemented fairly easily,capturing data once a second across several bytes that move thru memory for "wear leveling" purposes.

The whole point of my battery backed clock, is that the car's original clock sucks the car battery dry when not used for a while (as most classics do not drive that much). So i do need a separate super-low-power thing to keep time while it's stored.

With 328p i assume you mean the atMega328p? Isn't that a little overpowered for a clock? Oh btw, the driver chip on the 7-segment breakout is a 328 as well! Such a shame it doesn't have enough free pins or i'd simply reflash that one... SparkFun 7-Segment Serial Display - Red - COM-11441 - SparkFun Electronics

How small does it need to be? If you really want to miniaturise it, use SMD ICs and 0603 resistors and capacitors. You will need:

There are plenty of tutorials on the web on SMD soldering, such as Hotplate Surface Mount SMD Soldering Tutorial. I recommend putting the board on an aluminium plate rather than a steel plate, because it conducts the heat better. Also I don't put solder on the solder wick to start with, instead I wipe then flux pen over it.

If you want some practice, then I suggest you remove the components from an old hard disk drive PCB (heat it on the hotplate till the solder melts, then shake them off); then try re-soldering some of them.

dc42:
If you want some practice, then I suggest you remove the components from an old hard disk drive PCB (heat it on the hotplate till the solder melts, then shake them off); then try re-soldering some of them.

Thank you kindly for the tips and pointers, i see practicing on old hardware is a good idea. finally some use for those old 10/100 network cards and soundblaster boards i got stored in the basement ( yeah i'm that age)

@RobvdVeer,
Yeah, maybe '328P is a little overkill, but I only deal with a couple of chips: '328P, 1284P, 2560.
Buy 25 at a time, keeps the per chip cost down. And I know they all support Serial and SPI and I2C and analogReads & analogWrites and have enough SRAM to not have to worry about it, and I only have to make 1 mod to the IDE with every upgrade for the 1284P.

If I were to downsize the MCU, I'd look at an ATtiny84A before a 2313 -- four times the memory. The '84A comes in an SOIC package (as well as DIP), these are super easy soldering and barely over a buck in quantities of ten. The 328P TQFP and DS3231 are just about as easy. A good iron, good solder and flux, some magnification, tweezers and a Panavise make the SMDs easy, actually fun. I don't try to go smaller than 0805 for the Rs and Cs.

Nothing wrong with the hybrid approach recommended earlier, though, I've done that as well.

PS: Looks like a super job on the clock! DeLorean, very cool.

I chose the 2313 as it has more IO pins. If my calculations are correct, the 84a doesn’t have enough to support my features. Please prove me wrong!

PS: Looks like a super job on the clock! DeLorean, very cool.

Thank you very much. It’s only my second project. First one was lighting a lego truck. And cars don’t really get more awesome than a DeLorean. It got looks, understandable electrics,huge wiring loom for an 80’s car, and enough troubles to keep you busy (lol)

Edit: the 84a might be an option indeed. I found this comparison chart http://en.wikipedia.org/wiki/Atmel_AVR_ATtiny_comparison_chart

RobvdVeer:

[quote author=Jack Christensen link=topic=189039.msg1399350#msg1399350 date=1379720615]
If I were to downsize the MCU, I'd look at an ATtiny84A before a 2313 -- four times the memory.

I chose the 2313 as it has more IO pins. If my calculations are correct, the 84a doesn't have enough to support my features. Please prove me wrong!
[/quote]

Wouldn't try to. I wasn't counting pins. But what about memory, how big is the sketch currently?

It's now 13,624 bytes. And there's some dead code in it, and a lot of possibilities for optimisation; i doubt it'll even go over 14k.

RobvdVeer:
With 328p i assume you mean the atMega328p? Isn't that a little overpowered for a clock? Oh btw, the driver chip on the 7-segment breakout is a 328 as well! Such a shame it doesn't have enough free pins or i'd simply reflash that one... SparkFun 7-Segment Serial Display - Red - COM-11441 - SparkFun Electronics

Well you could use the ATmega168 instead, but these days its hardly any cheaper (and impossible to
buy preloaded with the bootloader I suspect).

With the surface mount resistors/capacitors, start out with 1206 size, and as you get experience switch
down to 0805 or even smaller.

And don't forget decoupling capacitors in your Eagle design.

MarkT:
And don’t forget decoupling capacitors in your Eagle design.

If you say it like that, i think i totally need decoupling capacitors. But really, tell me, what are they and why do i need them?

RobvdVeer:

MarkT:
And don't forget decoupling capacitors in your Eagle design.

If you say it like that, i think i totally need decoupling capacitors. But really, tell me, what are they and why do i need them?

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

RobvdVeer:
With 328p i assume you mean the atMega328p? Isn’t that a little overpowered for a clock?

Nah! Basically the same processing horsepower as the ATtinys. Plus more pins, more memory, and the peripherals are more advanced.

Oh btw, the driver chip on the 7-segment breakout is a 328 as well! Such a shame it doesn’t have enough free pins or i’d simply reflash that one… SparkFun 7-Segment Serial Display - Red - COM-11441 - SparkFun Electronics

I have a couple of those and I like them for breadboarding, they make things quick and easy, but I really don’t like the design. It uses the MCU pins directly as digit drivers and that pulls too much current, so there may be a chance of early failure. You may have noticed, a symptom of this is that the digit “1”, with only two segments lit, is brighter than say, “0” or “8”. This is because the MCU pin cannot supply enough current for seven segments simultaneously; it’s being overloaded.

Not sure if there are enough pins available, but another option would be to do the display multiplexing yourself (13 pins would be required). It’s a fun and interesting challenge, plus it could be done right with external transistors for digit drivers.

Well you may have more advice now than you can enjoy, so just my $0.02, strictly FWIW :smiley: