19

I have played a bit around with a Arduino Uno that came in a kit with a breadboard and components. Soon I would like to make some more permanent things.

I would prefer a smaller and cheaper unit than the Arduino Uno but that is almost as easy to use as the Arduino Uno, and very similar to use.

Is the Arduino Pro Mini 328 - 5V/16MHz a logical next step? At 1/6 of the size of the Arduino Uno it is plenty small. At 10 $ a piece the price is also good.

I understand that I must solder to get it to work. That should not be a problem.

Will I also need a USB serial board to program the unit?

3
  • 2
    next smaller with 328p is Nano
    – Juraj
    Commented Nov 11, 2018 at 19:55
  • 1
    ATmega32u4 chips are also a good move (same as Leonardo) for 8-bit micro. Coding is slightly different from UNO/328p (especially with serial), but you avoid the USB/serial converter. Eventually, you can make your own PCBs and use the SMD chips, for a really compact project.
    – MichaelT
    Commented Nov 11, 2018 at 20:06
  • 1
    Pro Mini, 5V 16MHz Module With Crystal Oscillator ($2.18CDN): aliexpress.com/item/…. PL2303HX USB to UART adaptor ($0.70CDN): aliexpress.com/item/….
    – VE7JRO
    Commented Nov 11, 2018 at 20:12

6 Answers 6

12

I think the first best choice is to remove the ATMega328p-pu chip from your Arduino UNO and incorporate it into your final circuit. The chips are only about $1.50.

That way, you can just use your UNO as a programmer instead of the final device that you deploy.

I'm not sure why there isn't more documentation about the proper way to remove the ATMega328p-pu chip and using it on your breadboard, after completing your programming.

I explain exactly how to do this on my blog: http://raddev.us/arduino/post/2018/07/03/arduino-uno-using-your-atmega328p-u-as-stand-alone

But, here are the basics. First you remove the chip. It will look like the following after you do so. (Note: I'm using the Elegoo clone of an UNO).

atmega328p-pu chip removed

Next, you apply power to pin 7 and connect pin 8 to GND.

Need A 16MHz Crystal

But, the chip won't seem to run your sketch at this point. That's because you actually need a crystal to run at 16MHz.

The UNO board has that chip installed and that is why it works. You can see it here:

16MHz crystal on UNO

Finally you add the 16MHz crystal and a couple of 22pF caps and your chip will run standalone (no UNO).

You add the crystal to pins 9 & 10. You can see all the details by reading my blog entry or reading the atmega328 datasheet.

crystal on breadboard

Finally, Just Wire Everything Else Up

After that, just wire the rest of your circuit up to the proper pins and you can run your ATMega328p-pu standalone.

It's actually a nice learning experience too.
Just buy replacement atmega328p-pu chips for your UNO and you can create all the projects you want to for very cheap.

12
  • 3
    You'd be well served to add some circuit protection in there, since the 328p doesn't have any of it's own. Otherwise, this is a great way to go.
    – SnakeDoc
    Commented Nov 12, 2018 at 18:09
  • 1
    @duskwuff, I believe that is only when you're doing DAC. This is just a simple example to get someone started in the direction of using the chip as standalone. I assure you the code to blink the LED in the sample does run. Also, when I was starting out I created the circuit I mentioned in a comment above and I never connected AVCC and GND and the circuit ran for two years. Of course, i'm not saying that will always be true. Just mentioning the way the chip actually works. As always, check the datasheet for exact specs and especially if you experience something different. Thanks.
    – raddevus
    Commented Nov 12, 2018 at 18:41
  • 1
    @raddevus Refer to Table 28.8 in the datasheet: "AVCC absolute min/max: 1.8V/5.5V". Leaving AVCC unpowered is out of spec, and may cause damage. The GND pin on pin 22 isn't specifically associated with the ADC, and must be connected to GND.
    – user7800
    Commented Nov 12, 2018 at 18:55
  • 1
    @duskwuff Thanks for the enlightening discussion. I agree with what you are saying and will change my docs and circuits soon to insure that is always connected. FYI - I started working with ATMega328p-pu via the fantastic book AVR Programming : Learning to Write Software For Hardware (amzn.to/2PS9OOA) and in those first circuits the author, Elliott Williams, does not hook up those pins either. I think I was influenced by that. The book really is great though and the author is knowledgeable. Thanks again, great discussion.
    – raddevus
    Commented Nov 12, 2018 at 20:45
  • 2
    @reddevus. To be more precise, the crystal that you indicated in the red box in this answer is the crystal used by the microcontroller handling the USB communication, and not by the ATmega328p-pu chip. You can see from the Uno schematics that the ATmega328p-pu chip actually uses a resonator: mouser.com/ProductDetail/Murata-Electronics/…
    – anon
    Commented Dec 6, 2019 at 16:03
7

Check the STM32F103C8T6 development board, cost about $ 1.5, and is faster/has more memory than the Arduino Uno, and is much smaller.

It can work with the Arduino IDE, but not all libraries are supported, so check before you want to use it if your used libraries are supported, or if there are different libraries you can use instead.

Update

Differences:

                       Arduino Uno       STM32F103C8T6 Mini Dev Board

MicroController            Atmega328P           Cortex M3
MIPS/MHz                        1                   1.25
Operating Voltage [V]           5                   3.3, most pins 5V tolerant
Input Voltage   [V]            7-12               USB only
Input Voltage (limit) [V]      6-20                (USB)
Digital I/O Pins               16                   37
From them:PWM Digital I/O Pins  6                   12
Analog Input Pins               6                   10
DC Current per I/O Pin [mA]    20                    ?
DC Current for 3.3V Pin [mA]   50                    ?
Flash [KB}                     32                   64
SRAM [KB]                       2                   20
EEPROM [KB]                     1                    -
Clock Speed [MHz]              16                   72

I2C                             1                    2
SPI                             1                    2 (18 MBit/s)
UART                            1                    3
CAN                             0                    1
USB                             0          USB 2.0 FS 12 MBit        
DMA                             0          7 channels (ATsP, SPI, I2C, USART)
RTC                             0                    1
CRC                             0                    1
Unique ID                       0                    1

Programmed by                  USB                 SWD Debug (around $5)

IDE                         Arduino IDE         Arduino IDE, CubeMX, ...
Libraries                      Many               Limited

Dimensions  [mm]            68.6 x 53.4           53 x 22
Weight       [g]               25                    ?
Price (cheapest)  [$]         2.50                 1.50

Note: as written earlier, despite the mostly better specs, not all libraries are supported. Also a programmer need to be bought (only once, cost about $5).

3
  • 1
    You can also avoid getting the programmer if you get the Maple Mini clones (same uC, almost same HW, but with a bootloader already flashed)
    – frarugi87
    Commented Nov 12, 2018 at 8:44
  • 1
    @frarugi87 Or you can use the builtin UART bootloader (activated by setting BOOT0 high) for initial programming.
    – user7800
    Commented Nov 12, 2018 at 18:34
  • The STM32F103C8T6 is a great part. But it still is only 3.3v. It isn't a drop in replacement for the Uno. Try to connect it to a 5v character LCD and you will have problems, if it works at all. (the LCD)
    – Rudy
    Commented Nov 13, 2018 at 0:47
7

For my product, I went from an Arduino Uno:

Arduino Uno R3

to the Arduino Pro Mini:

Arduino Pro Mini

Yes you will need a FTDI cable for programming and serial coms to the PC, but providing you don't need coms all the time, you will only need the one cable to upload the program to each device. They can be found pretty cheap too.

However I notice that the Arduino Pro Mini is retired now, so it may be a bit harder to source (it is still available on AliExpress). So for this reason, I suggest that you instead try the Arduino Nano:

Arduino Nano

which has the added advantage of onboard USB, meaning you no longer need the FTDI cable for programming or coms.

The ATMega328P that is the processor of these 3 boards does not have native USB, which means that the board also needs to include the FTDI FT232RL IC that is used in the FTDI cable. Having this IC can add additional costs to your bottom line.

For a few dollars cheaper per device, you can use a microcontroller (such as the ATMega32U4) that has native USB coms (and hence you save on the FTDI IC). One such product is the Arduino Micro:

Arduino Micro

All of these boards mentioned are native within the Arduino Ecosystem and (apart from the retired Pro Mini) should be easy to source online or at your local electronics shop. Your Arduino Uno program will work for all of these alternatives - you just have to change the board in the Arduino IDE:

Arduino Board Selection

There is one more board that I would like to mention - the DigiSpark:

Digispark

It is only suitable for smaller programs, is limited in some of its features and is not an oficial Arduino board. Having said that, there is plenty of Arduino support - and its cheap!

4

If you want to stick with using Arduino and it's toolchain, you can order just a bare ATmega 328p (the microcontroller at the heart of the Arduino Uno) and use it by itself!

They're fairly low cost ($1.50-$3.00 range) and are breadboard friendly. For a more permanent solution, you can solder them into a proto-board (perfboard), or even a custom designed circuit board once your design gets to that level.

Here's an excellent guide from the Arduino folks about setting up an Arduino on a breadboard, using only raw components such as the ATmega 328p. This design uses an external 16MHz clock crystal, just like an Arduino Uno.

If you're OK with using the internal 8MHz clock onboard the 328p, you can do away with most of the extra components and just run the raw chip like in this guide (using the Arduino Lilypad Bootloader instead of the default Arduino bootloader). This will save even more money!

Either way, you'll need an AVR Programmer unit, since there is no USB port built into the 328p. This will be the most expensive part of this setup, but good news is you only need one, and it can program any 328p's you need. They can also be used to program non-standard chips that are capable of being programmed over Serial Tx/Rx pins, such as the ESP chips (you just hand-wire them). Very useful to have one of these if you're serious about these types of microcontrollers.

ATmega 328p Microcontroller Chip

ATMega Pin Stickers

Perfboard

AVR Programmer

19
  • 1
    If you order your ATMEGA328P-PU with the boot loader already installed: ebay.ca/itm/…, then a PL2303HX USB to UART adaptor ($0.70CDN) will work to upload "code": aliexpress.com/item/…
    – VE7JRO
    Commented Nov 12, 2018 at 0:10
  • I always found it odd that Arduino uses a special bootloader for programming instead of using the built-in programming interface. Commented Nov 12, 2018 at 1:57
  • @immibis not sure what you mean exactly, but the arduino bootloaders do a lot of things that make working with the arduino's (and Atmel chips) a lot easier, including resetting of pins, switching to external clock, handing-off to your code, etc. Without it, you'd essentially need to write your own... which would be a waste of time since for majority of cases, the stock Arduino bootloader does everything you want anyway.
    – SnakeDoc
    Commented Nov 12, 2018 at 7:43
  • 1
    @immibis I think it is much easier to have a serial port interface rather than a programmer interface from the PC. Moreover, especially at the beginning, I think (personal opinion) that they wanted a complete system on a board, and integrating a programmer on the PCB was much harder than writing a serial bootloader. Consider that the first arduino boards had a serial port (Arduino RS232), so only one programmer was needed to program a lot of them (they were used at school)
    – frarugi87
    Commented Nov 12, 2018 at 16:46
  • 1
    @frarugi87 that's probably true, but for real beginners, plugging in a USB cable and using the Arduino IDE to upload "sketches" is about as easy as it can be. I think they made the right move to make it super accessible, especially for those who have zero microcontroller experience.
    – SnakeDoc
    Commented Nov 12, 2018 at 17:37
4

I like the Nano and the Pro Mini. I like to work with it on a breadboard with other modules. If there is more circuitry involved I found it much more convenient than using an Uno. There are faster processors but for a lot of projects the 16Mhz 328 is more than sufficient. And like the Uno, these two are 5 volt powered parts. Sometimes what you need to connect to doesn't work well with 3.3 volt processors.

The Pro Mini and the Nano with easily be soldered into 0.1" spaced "Veroboard" (or equivalent) If you don't mind buying cloned parts, the cost of a Nano and Pro Mini is only a couple of dollars. Buying parts off Aliexpress, or even Ebay, can save you a lot, as long as you are patient when it comes to delivery.

The module that I am now use most often is the ESP8266. It is a powerful WiFi platform that only costs a few dollars and has quite a mature Arduino framework. Often I use this as the only processor in the design. I have even used it as the basis for a data logger and completely ignored the WiFi capability. 20x4 character LCD, current/voltage measurement chip (INA219), and a SD memory card, powered by a 18650 lithium battery.

There are lots of good inexpensive options.

4
  • 3
    you might want to point out that ESP12 modules do NOT have .1" pin spacing, which is a bit of a nuisance. There are inexpensive breakout boards, but these are quite wide and hard to use with solderless breadboards. Other than that, they're pretty handy. For about $1 more than a bare ESP12 module you can get a Wemos D1 mini (clone) that is about as easy to use as an Arduino Pro Mini or Nano.
    – Llaves
    Commented Nov 11, 2018 at 21:58
  • Where did I say to use the ESP-12? I didn't go into a lot of detail on the ESP8266 because that really wasn't the focus of the question. I thought it was worth mentioning since a lot of people are not familiar with it. I totally support people using the Wemos D1 mini platform. It is a ready to go solution unlike ESP01, ESP12, etc. USB to serial and an onboard regulator makes a big difference. But I still feel the Nano or the Pro Mini is the most appropriate answer for the person who asked the question.
    – Rudy
    Commented Nov 12, 2018 at 23:40
  • It's hard to consider any atmega based system in 2019 in comparison to the ESP systems, so you might mention for $2 with an ESP8266 you get a 40MHZ processor, a full development board ( not a chip ), wifi, and USB-based programming and monitoring without any extra cables. And also mention the ESP32 systems, which are more expensive at $7 to $10, but contain two CPUs, a full RTOS, multiple MB of flash, adds BT to WIFI, and native USB support. Compatibility with Arduino is included, and even running the provided RTOS they include Arduino libraries. Commented Dec 28, 2019 at 4:30
  • The ESP8266 has a 160MHz processor. It is a great option but it does have limitations. It only has one A/D converter and a bad one at that. The digital IO pins also have quirks. Pull up resistors are on by default at power up on most. Three IO pins set the operating mode and special care must be taken. The ESP8266 also needs a decent power supply. With the ESP8266 there is a lot of code running in the background and your code must co-exist with it. I really like the ESP9266 but it is not a great general purpose microcontroller. The ESP32 is better but also with issues.
    – Rudy
    Commented Dec 29, 2019 at 14:59
2

Arduino Pro Micro clones are super cheap and all you need to program them is a normal micro USB cable. You will probably have to solder the headers to do anything useful. They are available in a 3.3V/8MHz and a 5V/16Mhz version.

Pro Micro

3
  • ProMicro has a 3.3v processor. That can be a problem with some designs. It isn't a drop in replacement for an Uno. But it is an interesting part.
    – Rudy
    Commented Nov 13, 2018 at 0:35
  • 1
    No, just as with the Pro Mini there is a 5V/16MHz and a 3.3V/8MHz version.
    – AndreKR
    Commented Nov 13, 2018 at 6:07
  • Sorry then, my mistake.
    – Rudy
    Commented Nov 14, 2018 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.