Custom A. Nano assembled board (with bootloader)

Hello guys! Long time since my last post. I hadn't worked with Arduino in the past two years sadly. So please don't kill me if I have some stupid questions! :smiley:

So, I want to start a new project for a client: an Arduino nano with some sensors that talk trough serial with a C# app that I wrote. Pretty simple, I can handle building a working prototype.

The problem is that I need it to look professional, so I need a custom PCB (because I need to wire some custom buttons and connectors to the casing) and a custom 3D printed case. I can do the case also, no problem.

But I need help with the custom PCB (from what I know, I can use some services like JLCPCB) but I need the following:

  1. An easy to use software/service (like EasyEDA) that can import schematics (because I want to use an official Nano schematic), and export the gerber files.
  2. A service that can both print the custom PCB and do the components assembly.
  3. I know that the microcontroller (ATmega328P) has to be flashed with the bootloader. How can I do that? Or, do I need to do it at all (or the IC comes flashed already)?
  4. Can I somehow "lock" the board after I finish everything so that no one can upload any other sketches into it?
  5. Some advice (any, really).

Thank you!

  1. An easy to use software/service (like EasyEDA) that can import schematics (because I want to use an official Nano schematic), and export the gerber files.

Easy to use: Fritzing.org
I'm not aware of any program that allows to import schematics written by another application. So you might have to reconstruct the schematics in the chosen application.

  1. A service that can both print the custom PCB and do the components assembly.

There are lots of the available, impossible to suggest one if you don't specify the criteria you apply. I'd use one in your region so you can get to them if you have any problems. You will learn that component assembly isn't cheap if you don't produce high numbers.

  1. I know that the microcontroller (ATmega328P) has to be flashed with the bootloader. How can I do that? Or, do I need to do it at all (or the IC comes flashed already)?

Add an ICSP interface and do it yourself or let the assembler do it. Again quite expensive for low quantity charges.

  1. Can I somehow "lock" the board after I finish everything so that no one can upload any other sketches into it?

You can do that but you lock yourself out too.

  1. Some advice (any, really).

Why does it have to be a custom PCB? If everything goes into a case you can use a Nano and other breakout boards and wire it internally. Sure if you produce 1 million of these devices you get it cheaper on a custom board but for a few hundred of devices the overhead doesn't pay off.

Thank you pylon!

Easy to use: Fritzing.org

I had it already, didn't know that it can do this :smiley:

impossible to suggest one if you don't specify the criteria you apply

I need to make between 100 and 1.5K pieces. And to be already assembled. Preferably to be cheap (but good, so not that cheap). I'm in Europe so something close.

Add an ICSP interface and do it yourself

If you are talking about this https://www.arduino.cc/en/tutorial/arduinoISP, I think that I can do it. I will test this in a few days once the parts arrive.

You can do that but you lock yourself out too.

No problem, since I will ship the end-product and I don't think that I will need to flash it aver again. But how? I googled around but nothing specific.

Why does it have to be a custom PCB? If everything goes into a case you can use a Nano and other breakout boards and wire it internally

Well..., that's a good question. Originally I wanted to go with that, but I think that it was a better idea to have a custom PCB so I can solder the sensors and connectors directly on board, and also to remove some unnecessary pins. Plus, it would look better with some custom logo/texts.
But you might be right.

One extra question, please. :smiley:
6. Is there any way to change the board's name while it's connected to the USB port? So it will appear as "MyCustomBoard" rather than "Arduino ...".

I need to make between 100 and 1.5K pieces. And to be already assembled. Preferably to be cheap (but good, so not that cheap). I'm in Europe so something close.

I used wedirekt.de for the PCBs of some of my projects, professional service, rather good prices but of course more expensive than the Chinese.
To populate it there are a lot of options, do a google search for it. It depends a lot on the circumstances. Do you buy the parts yourself? Do you expect the partner to buy all the parts or provide only the standard parts?
For one project I had a local school doing a mini series with their apprentices. I won't do a recommendation there as I don't know a European company that offers all these services, at least none I've worked with.

If you are talking about this https://www.arduino.cc/en/tutorial/arduinoISP, I think that I can do it. I will test this in a few days once the parts arrive.

If you want to do that for more than 100 boards, I strongly recommend to buy a programmer, p.e. USBtinyISP.

No problem, since I will ship the end-product and I don't think that I will need to flash it aver again. But how? I googled around but nothing specific.

Google for SPIEN fuse bit. According to the ATmega328p datasheet this fuse bit is not available in serial programming mode, so you might have to buy a parallel high voltage programmer to actually set it. I never used it as my designs are open source anyway.

Plus, it would look better with some custom logo/texts.

Is that worth the high additional effort? I never did the calculation for 1500 pieces but for 100 pieces it will be much more expensive.

Does your Nano show up as "Arduino"?

If you want to change that, you must use an MCU with USB built-in (p.e. ATmega32U4) and do the USB stuff custom. I've done it for one of my boards but expect that to be a lot of work and quite inefficient to support if you want to use the Arduino IDE.

3AgL3_DJ:
3. I know that the microcontroller (ATmega328P) has to be flashed with the bootloader. How can I do that? Or, do I need to do it at all (or the IC comes flashed already)?
4. Can I somehow "lock" the board after I finish everything so that no one can upload any other sketches into it?

You don't need the bootloader, you can directly burn your code onto the atmega328 using an ISP programmer, then anyone who wants to reprogram the chip will need to use an ISP programmer. Leave the pins for the ISP connections off and mount the board in a fixture with probes to contact the necessary connections and it gets even more difficult for the casual user.

I'm not familiar with the lock bits, but if they can be rewritten with a high voltage programmer then anyone serious about reprogramming your board will be able to do it, or will just pop the chip off and replace it.

If you go the non-bootloader route...

you can use one of these (and not break out the ISP pins)

I have used this specific device many times to flash some boards..

@OP

How detailed is your board?

You will have to grab the nano scheamtic and board file (unless you want t route everything yourself from scratch).. as well as for any other pre-made boards you want to add)

I have done many 'motherboard' PCB's... so my pre-fab's board just 'plug in... you can also break out any pins you want to make pads for 'sensors.'

That may be an esier route to go.

Example:

Just plug the Nano and DFPlayer in.. connect speaker, battery, switches and Neopixel rings... (done)

You arent really going to be able to beat the cost of a few USD bucks for a Nano... (pre-made)

Would be nice if there was an atmega328 board designed like the newer Nano Every and Nano 33 boards, that can be directly soldered down to another board.

Both the Nano and Pro Mini boards are designed to be soldered onto something else. I've used both in different projects mounted directly onto a custom PCB. I needed just a few, so ordered the bare PCB (cheap) and simply hand soldered on the parts. Easy peasy, works wonders.

The Nano has an ISP header making it easy to program by ISP. I don't see the need of locking it down completely; you indeed don't want a bootloader as that makes it too easy to mess up the software. No bootloader, ISP to program the thing, mounted in the case. If someone then opens the case and reprograms it... well, if they break it, they get to keep the pieces. Of course if you want you could put some epoxy putty on the ISP connection (of course you don't solder in the ISP header pins).