How to Use Arduino Pro Mini: Setup and Basic Example
To use
Arduino Pro Mini, connect it to a USB-to-serial adapter for programming since it lacks built-in USB. Upload your code using the Arduino IDE by selecting the correct board and port, then run your sketch like any other Arduino.Syntax
The Arduino Pro Mini uses the same programming syntax as other Arduino boards. You write your code in two main functions: setup() runs once at start, and loop() runs repeatedly. Use pinMode() to set pin modes and digitalWrite() or digitalRead() to control or read pins.
arduino
void setup() { pinMode(13, OUTPUT); // Set pin 13 as output } void loop() { digitalWrite(13, HIGH); // Turn LED on delay(1000); // Wait 1 second digitalWrite(13, LOW); // Turn LED off delay(1000); // Wait 1 second }
Example
This example blinks the onboard LED connected to pin 13 every second. It demonstrates basic output control and timing on the Arduino Pro Mini.
arduino
void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000); }
Output
The onboard LED blinks on and off every second.
Common Pitfalls
- Not using a USB-to-serial adapter: The Pro Mini does not have USB built-in, so you must use an adapter to upload code.
- Wrong board or port selected in Arduino IDE: Always select 'Arduino Pro or Pro Mini' and the correct COM port.
- Power supply issues: The Pro Mini runs at 3.3V or 5V versions; powering it incorrectly can damage the board.
- Not connecting the adapter's DTR pin: Without DTR connected, auto-reset for uploading may fail.
arduino
/* Wrong way: Trying to upload without adapter or wrong board selected */ // This will cause upload errors /* Right way: Use USB-to-serial adapter and select correct board */ // Connect adapter TX to Pro Mini RX // Connect adapter RX to Pro Mini TX // Connect adapter GND to Pro Mini GND // Connect adapter DTR to Pro Mini DTR (if available) // Select 'Arduino Pro or Pro Mini' in IDE // Select correct COM port // Upload code
Quick Reference
Here are quick tips for using Arduino Pro Mini:
- Use a USB-to-serial adapter for programming.
- Select 'Arduino Pro or Pro Mini' board in Arduino IDE.
- Match the board voltage (3.3V or 5V) with your power supply.
- Connect DTR pin for auto-reset during upload.
- Use pin 13 for onboard LED control.
Key Takeaways
Always use a USB-to-serial adapter to program the Arduino Pro Mini.
Select the correct board and COM port in the Arduino IDE before uploading.
Match the Pro Mini's voltage version with your power source to avoid damage.
Connect the DTR pin from the adapter for smooth code uploads.
Use pin 13 to control the onboard LED for simple tests.