{"id":5842,"date":"2019-04-13T11:50:54","date_gmt":"2019-04-13T15:50:54","guid":{"rendered":"https:\/\/dronebotworkshop.com\/?p=5842"},"modified":"2023-04-12T11:39:58","modified_gmt":"2023-04-12T15:39:58","slug":"arduino-pro-mini","status":"publish","type":"post","link":"https:\/\/dronebotworkshop.com\/arduino-pro-mini\/","title":{"rendered":"Programming the Arduino Pro Mini"},"content":{"rendered":"\n
<\/a> <\/a> <\/a><\/p>\n Today we will take a look at the Arduino Pro Mini, a small yet powerful member of the Arduino family.<\/span><\/p>\n Although the Pro Mini is a small device it is quite powerful, as it uses the same processor chip as the Arduino Uno. In fact in some ways it is even more versatile, and it’s small form factor and low cost makes it ideal for use in permanent projects.<\/span><\/p>\n However programming the Pro Mini is done a bit differently than an Uno, mainly because the Pro Mini has no USB port.<\/span><\/p>\n Of course, there is a way around this, so follow along and see how the Pro Mini can be useful for your next Arduino design. And, as a bonus, we will build a battery-powered controller for a small robot arm.<\/span><\/p>\n The Arduino Pro Mini was originally developed by <\/span>SparkFun<\/span><\/a>. Although no longer available from the <\/span>official Arduino store<\/span><\/a> it is an open-source design and is now manufactured by several different companies. You will have no problem finding one at a very low price.<\/span><\/p>\n <\/p>\n As its name would imply the Pro Mini is a very tiny device, it\u2019s not much bigger than the DIP version of the ATMega328 chip. The Pro Mini uses a surface-mount ATMega328, giving it the full power of the Arduino Uno in a much smaller package.<\/span><\/p>\n In fact, in many ways, the Pro Mini is even more versatile than the Uno.<\/span><\/p>\n One way in which it is more capable than the Uno is that most Pro Mini designs have two additional analog input ports, which can also double as extra digital I\/O pins. \u00a0This is due to the surface-mount version of the processor having more leads than the DIP version that the Uno is based upon.<\/span><\/p>\n <\/p>\n Another way that the Pro Mini outshines its bigger brother is that it is available in both a 5-volt and 3.3-volt model. \u00a0This opens up the possibility of creating battery powered projects, or directly interfacing with 3.3-volt logic devices.<\/span><\/p>\n The 3.3-volt Pro Mini runs at a slower clock speed, 8 MHz. For most applications, this will not be an issue.<\/span><\/p>\n But for all its extra versatility the Pro Mini has one feature lacking – it has no USB port.<\/span><\/p>\n While this may seem like a major drawback it isn\u2019t really, in many Arduino projects the USB port is only used for programming and debugging. \u00a0Once that is done with the USB port just sits there, taking up both space and consuming some current.<\/span><\/p>\n To program and debug a Pro Mini you will use an external device, called an FTDI Adapter.<\/span><\/p>\n FTDI is an abbreviation for semiconductor manufacturer <\/span>Future Technology Devices International<\/span><\/a>. \u00a0In addition to interface chips, the company also manufactures a wide range of video adapter and other integrated circuits.<\/span><\/p>\n The adapters we are interested in are produced by several manufacturers and are used to interface USB or serial ports to microcontrollers. \u00a0They are easily obtained on eBay or Amazon, as well as most well-stocked electronics stores.<\/span><\/p>\n FTDI adapters come in several shapes and sizes, all of them will have a USB (usually Mini USB) port and a 6-pin connector to attach to the Pro Mini.<\/span><\/p>\n The FTDI adapter not only provides a USB port to allow you to communicate with the Pro Mini, it also supplies power. <\/span><\/p>\n <\/p>\n Because the Pro Mini is available in both 3.3-volt and 5-volt models it is critical that you give it the correct supply voltage. The FTDI adapter will have a method of selecting the correct supply voltage, this is usually in the form of a jumper, a switch or a trace on the circuit board that needs to be cut or jumpered.<\/span><\/p>\n Make sure you get the voltage setting correct, applying 5-volts to a 3.3-volt Pro Mini can damage or destroy it!<\/span><\/p>\n Your FTDI adapter will have a connector, usually a 6-pin male header, to attach to the Pro Mini. In most cases you can just directly attach it, however one important thing to note is that this connector (and the connector on the hPro Mini) is not always mounted the same side up.<\/span><\/p>\n <\/p>\n In the above image, I show a couple of Arduino Pro Minis and two FTDI adapters. The connector on the blue Pro Mini (the 5-volt one) is reversed from the connector on the red Pro Mini (the 3.3-volt one).<\/span><\/p>\n The two FTDI adapters also wired backward from each other!<\/span><\/p>\n The connections on the FTDI adapter for the Pro Mini are as follows:<\/span><\/p>\n To connect the FTDI adapter to the Pro Mini you need to match the signals up as follows:<\/span><\/p>\n <\/p>\n Note that the Transmit and Receive lines are crossed between the two devices, which makes perfect sense if you think about it. <\/span><\/p>\n You will also note that the CTS input to the FTDI adapter is grounded, or held at a digital LOW. This essentially tells the adapter that it is always clear to send data. The Pro Mini will have an extra pin that is grounded for this purpose.<\/span><\/p>\n Use the diagram above and check the labels on the connectors for both your FTDI adapter and Pro Mini and you should have no problem connecting the two devices to each other.<\/span><\/p>\n After you connect your FTDI adapter and Pro Mini together it\u2019s time to program it.<\/span><\/p>\n Most FTDI adapters use a mini USB (not micro USB) connector, so you will need to ensure that you have the correct type of cable. The mini USB cables are not as popular as they used to be but they are still used for many cameras and microphones.<\/span><\/p>\n Connect the other end of the cable to your computer. If your computer is a Linux or Mac then you are ready to go.<\/span><\/p>\n For some Windows users you may need to <\/span>install drivers<\/span><\/a> to get your FTDI adapter recognized by your computer.<\/span><\/p>\n Programming the Pro Mini is no different than programming an Arduino Uno, however, you do need to setup your <\/span>Arduino IDE<\/span><\/a> for the correct type of board and processor first.<\/span><\/p>\n Here is how you do it:<\/span><\/p>\n Your Arduino IDE is now ready to use with the Arduino Pro Mini.<\/span><\/p>\n You may now use your sketch with the Pro Mini. All of the example sketches, such as Blink, should work without modification.<\/span><\/p>\n As an example of using the 3.3-volt Pro Mini, I have created a very simple robot arm controller, meant to be used with the MeArm robotic arm.<\/span><\/p>\n If you are not familiar with the MeArm you can read about constructing it. You can also use this controller with any arm that has four servo motors, or expand upon it.<\/span><\/p>\n The real purpose of this hookup and sketch is to show you how to use a 3.3-volt Arduino Pro Mini. I\u2019ll be the first to admit that the controller is very basic, one day soon I\u2019ll show you a much more capable controller.<\/span><\/p>\n The hookup for the robot arm controller is shown below:<\/span><\/p>\n <\/p>\n The interesting things about this hookup is how the reference voltage for the analog inputs is established.<\/span><\/p>\n The potentiometers are hooked up to provide a variable voltage to four of the analog inputs. On a 3.3-volt Pro Mini this voltage should vary between ground and 3.3-volts. \u00a0A higher voltage would overflow the analog to digital converter in the Pro Mini and could also possibly damage it.<\/span><\/p>\n Our power supply, however, is 6-volts. This can be provided by either a bench supply or batteries. A 6-volt supply is ideal for the servo motors, but it is too high to use for the analog reference voltage.<\/span><\/p>\n The Arduino Pro Mini is powered using the 6-volt supply connected to its RAW voltage input. This employs the built-in linear voltage regulator on the Pro Mini to derive the 3.3-volts it requires.<\/span><\/p>\n When the RAW voltage input is used the VCC pin on the Pro Mini now becomes an output, instead of being a voltage input. The output is 3.3-volts from the internal regulator.<\/span><\/p>\n This is the voltage used as a reference for the analog to digital converters. <\/span><\/p>\n Once you have everything hooked up you\u2019ll need to upload the following sketch to make it all work.<\/span><\/p>\nIntroduction<\/span><\/h2>\n
The Arduino Pro Mini<\/span><\/h2>\n
Arduino Pro Mini Pinout<\/span><\/h3>\n
Using the FTDI Adapter<\/span><\/h2>\n
FTDI Voltage Select<\/span><\/h3>\n
Connecting the FTDI to the Pro Mini<\/span><\/h3>\n
\n
Programming the Pro Mini<\/span><\/h2>\n
Arduino IDE Settings<\/span><\/h3>\n
\n
Robot Arm Controller<\/span><\/h2>\n
Controller Hookup<\/span><\/h3>\n
Controller Sketch<\/span><\/h3>\n
\/*\r\n Robot Arm Control Demo\r\n mearm-controller.ino\r\n Demonstrate use of 3.3 volt Arduino Pro Mini\r\n Controls 4-DOF Robot Arm with 4 potentiometers\r\n Powered by 6-volt power source\r\n DroneBot Workshop 2019\r\n
Welcome to the Workshop!<\/a><\/blockquote>