Hi everyone!
Im about to start a bigger, commercial project with a company
I need to build:
Phase 1) A prototype to show that the hardware works in ONE unit. I will use an Arduino Mega and some interfacing circuitry: Optocoupled inputs, 24V drivers for relays, motor drivers, temp reading, etc
Phase 2) If phase 1 works, I will have to reproduce he desing for 40 units, in which I won't be using an arduino mega + all the external hardware but instead using the schematic from the Mage + the schematic from the required additional interfacing and create a single board for the design to send it to fabricate to JLCPCB probably with SMD component placing.
Has anyone ever done this? Basically use an Arduino board to create a custom board based off this one with additional components?
I have done this a few times with microcontrollers. one thing that is nice about using open source development boards is that you work from the schematic and add your own components or remove some of the components you don't want or need to create your own product.
I would look to one of the more modern chips for any future designs unless there will only ever be 40 units produced. The ATMega2560 has been around for at least a decade and has received at least one Product Change Notification - End of Life.
I tried KiCad and Eagle before settling on DesignSpark. I was trying to make a custom part (by modifying an existing part) and every step was "difficult" with the 1st two. With DesignSpark I finally accomplished it. It's still not "easy", but I didn't expect it to be... Some people go to school to learn PCB design.
So far, I made one very simple board (a solid state relay). I had the boards fabricated by Seeed Studio/Fusion. I made a couple of mistakes and I had to scrap the 1st batch and go with Rev 2. That was disappointing, especially with such as simple board, and I was trying to be extra-careful and double-check everything. But not that surprising and I was mentally (and financially) prepared for it... I've worked in electronics a long time (not designing boards) and I don't think I've ever seen a board come-out perfect the 1st time. I'd recommend leaving enough time & budget for at-least one revision of the board.
I'm working on my 2nd board design now. A little more complex but not as complex as the Arduino.
With "only" 40 units I wouldn't build a completely custom board unless you really need to. I'd build a shield (a plug-in add-on board). In fact, the board I'm working on now is a "shield". (I'll probably need 4 or 5 of them.)
You'll save a lot of development time and it will be easier to test & debug your production units if you have two (or more) separate boards/modules, and you won't have to troubleshoot the microcontroller part. I once worked on a product with 3 microprocessors (and a bunch of other stuff) on one board. It was a nightmare to troubleshoot.. Sometimes we didn't know which section wasn't running and some boards just had to be scrapped.
Thanks everyone. I'm not sure yet if an ATMEGA328 is going to be enough, that's why I picked Mega2560 for my prototype as there will be "some amount " of inputs and outputs and this may increase during the the first steps of pre-production.
I believe that having a custom created board is going to
Provide a much better credit of my work to my customer as he will see a single board containing all the components instead of a bunch of cards connected thru a lot of wires
Be way more consistent and solid, as these boards will be mounted on trucks going on and off road so vibration and harsh environment will be in involved, so wires may end up jumping all over the place. Having all on one board makes this more reliable
This project will end up needing a CE (European Community) certification, for what I prefer to pass my test on a nice setup than on a mess of wires
Also I don't want to be involved in assembling all 40 boxes with all this, I need to have the reliability to order them assembled from a PCB manufacturer all in one, the project budget has room for this
enough GPIO? enough 16-bit timers? enough UARTs? enough program memory?
with the RP2040, you get a dual-core Arm Cortex-M0+ processor with an internal 133 MHz clock, 264kB on-chip SRAM, 2 × UART, 2 × SPI, 2 × I2C, 16 × PWM, 1 × USB controller and PHY
It loses on the 100 pin ATmega2560 in GPIO only. You will need off-chip flash just as the Nano board, which also has a schematic and BOM you can reference.
Probably in GPIO, but Im not sure yet. I need some pulse detectors, digital inputs, thermometer, bipolar stepper driver, LEDs, pushbuttons, digital outputs, and who knows that else, but it would be too bad to start a design that's a little close to the limit and then just because I need one more output having to switch to a completly different board with all the changes it would take
Yes there are several options, but they add complexity to the schematic.
But anyway, why not stick to an Atmega 2560? I will have to build 40 of them and that's it. I mean, Im not sure if an END-OF_LIFE notice will truly affect me much (Im open to hear on this)
As I said above, if only ever 40 units will be produced, it may not affect you. There is over 7K in stock at mouser.com and 68K in stock at digikey.com. There's nothing wrong with the chip.