Is a custom atmega328 pcb doable for a noob ?

For development of my IR sensor project I will be using an optics board plugged into a pro-micro. I'll be reading 8 channels of ADC and outputting on 4 digital pins.

Thinking ahead to a final product it would be nice to have the arduino functionality on the optics board. In use there would be just 6 wires to the board ( 4 digital out, ground and 5V). For size reasons (and 8channels ADC) I'll need surface mount 328, therefore I might as well have surface mount IR devices as well, and I'll have to pay for assembly.

My questions are:

How bare can the 328 be when I use it? There's always so much other stuff on dev boards that I'm wondering what I might need.

I've got a 328 based board here, I recognise a CH340 chip which I don't think I need if I use serial programming. I've read I don't need an external oscillator, I don't need a reset switch. Voltage regulator: is that good practice I should follow? I'll be running from a computer USB socket. And then several leds/resistors/capacitors?

Assuming I can design the board OK. What sort of price (on top of the components) would I be looking at for assembled boards 1) a prototype 2) 100 production boards. Boards will have the 328 and say 30 simple (2pad) components.

Any tips thoughts welcomed.

Google minimal Arduino

Bare bones Arduino

Thanks guys. And thanks Nick Gammon. It looks quite do-able for me.

Now to find some assembly prices vs see if it's possible to solder 0.8mm leg spacing at home.

Bare minimum that can still work like UNO is 0.1uF capacitor on VCC pins (both of them), 2x capacitor and 16MHz crystal or for even smaller, resonator. I've used: CSTCE16M0V53 (pictured below) which is smaller than grain of rice and has crystal plus 2 matching load capacitors in one neat package.

s-l500.png

s-l500.png

You don't need a resonator if you run the chip on the internal oscillator.

I don't think I need speed, but does the oscillator speed affect the ADC speed?

I've decided not to mess around trying to make through hole prototypes myself. I will go straight to smd prototypes fabricated for me with the atmega328 on the board ($60 for 4 pcbs at jlcpcb).

I just got 125 pcbs from JLCPCB for under $30AU delivered.

Don’t forget you can buy a 328 in a dil package , that is a simplier route and you still make small boards that are easy to build and could be more reliable if you wondering skills are not 100%.

aarg:
You don't need a resonator if you run the chip on the internal oscillator.

internal oscillator is not recommended if the chip will be using SPI, I2C, or serial communication, people have had issues maintaining sync. Also resonator isn't perfect either, only crystal is optimal for serial communication.

I would experiment with internal oscillator and see how well it works. If it's prone to losing connection, use external crystal oscillator only. Adding solder pads to custom PCB costs nothing, and if the chip works fine with internal oscillator one can save about 25 cents.

wilykat:
internal oscillator is not recommended if the chip will be using SPI, I2C, or serial communication, people have had issues maintaining sync.

Why would the clock matter for SPI or I2C? These are completely self-clocking protocols!

I've found a minimal atmega328 project to use as a starting point on easyeda.com it has an oscillator but it really sounds like I don't need it (no comms except intial programming).

The current stumbling block is I can't find a simple IR photo diode in the jclpcb parts inventory, so I might have to get a heat gun and reflow those on later.

That’s surprising. Do they have an IR photo-transistor? You might be able to get that to work. Are you sensing a modulated IR source? If so, I think they make little IR “receivers” with the 38KHz demodulator built in. And finally, you can use an IR LED as a receiver, or make your own photo-transistor:

What IR photodiode do you use in your current prototype?

jimmer:
Now to find some assembly prices vs see if it's possible to solder 0.8mm leg spacing at home.

Soldering the ATmega328 in a TQFPs is easy enough by hand.

But unless size is a critical factor, then the 28pin DIP version is better choice, heaps easier to solder and you can use a socket making it easy to swap 'programs'.

The DIL version of atmega328 is too big and doesn’t have 8channels of ADC anyway (mentioned in OP).

I’m just sensing light level (everything I found at jcl is aimed at clever modulation stuff) I don’t mind using somthing more complex in a simple manner, but also they are all >$0.40 and I need 8 of them. I was hoping for eg $0.20 or so each.

My first mockup is using a no brand 3mm thru hole photodiode from ebay, possibly OP165A.

What I want to use is something like these:
https://www.mouser.co.uk/ProductDetail/Vishay-Semiconductors/VEMD10940F?qs=oa0mbLiKnLU8k416I0jwvw%3D%3D

As others have suggested, I recommend to use an ATmega328P in 28 pin dip format, and a 1/.2 or 1/4 sized protoboard. Easy to solder, cheap and you don't have to waste time designing and ordering a custom PCB.

Are you sure about the need for 8 ADC channels? You do realize that there is only one ADC, and you cannot make simultaneous measurements on two channels.

Or a Promini with 8 ADC. $4 each if you shop around.
A4,5,6,7 are labelled on the back.
https://www.amazon.com/XCSOURCE-Enhancement-ATMEGA328P-Compatible-Arduino/dp/B015MGHLNA/ref=sr_1_35?

ShermanP:
That's surprising. Do they have an IR photo-transistor? You might be able to get that to work. Are you sensing a modulated IR source? If so, I think they make little IR "receivers" with the 38KHz demodulator built in. And finally, you can use an IR LED as a receiver, or make your own photo-transistor:

IR Receiver Basis - YouTube

I hadn't looked under transistor, so was hopeful. But no luck still.
https://jlcpcb.com/parts

Make my own photo-transistor..... getting some else to solder up 2 cheap components does beat me buying and then soldering up a photodiode.

jremington:
As others have suggested, I recommend to use an ATmega328P in 28 pin dip format, and a 1/.2 or 1/4 sized protoboard. Easy to solder, cheap and you don't have to waste time designing and ordering a custom PCB.

Are you sure about the need for 8 ADC channels? You do realize that there is only one ADC, and you cannot make simultaneous measurements on two channels.

I'm not sure about the need for 8 channels, but I have 8 sensors so it made sense to me.

But I am sure that the DIP package is too big for my pcb.

For the first working prototype I could get a custom pcb with the sensors on it, and use an arduino for processing, but I thought I might as well work toward the final goal from the start (ie onboard processing)