Using the Arduino Pro Mini & FTDI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today in the workshop we are working with the Arduino Pro Mini a tiny Arduino with big capabilities we'll see how the Pro Mini works and how to program it using an FTDI adapter we'll also build the battery-powered controller for a small robotic arm it's a small world after all so welcome to the workshop [Music] hello and welcome to the workshop today we're going to be working with the arduino pro mini now as its name would imply the pro mini is a very tiny Arduino but it's only tiny in size as far as capabilities the pro mini has the same capabilities as an Arduino Uno and that's because it uses the same microcontroller tip that the Kuno uses the 18 mega 3:28 in fact many pro minis have two additional analog to digital converters that the uno does not have so in that respect it's even a bit more powerful now there is one thing that the pro mini does not have however it does not have a USB port and in order to program it you're going to need a device called an FTDI adapter I'm going to explain how that works and show you how you hook it up and program the device one nice thing about the pro mini is that is it's available in both a 3.3 and a 5 volt model so you can use the 3.3 volt model for low powered logic circuits and also for battery-powered designs and we're going to be building a battery-powered project with our pro mini today so what I'm going to do is show you the pro mini show you the FTDI adapter and how you connect the two together how you work with them with the arduino ide and then we're going to build our battery-powered project now the project we're going to build today is going to use this device I don't know if you remember this it's been quite a while but this is the me arm robotic arm and it's a small robot arm that has four servo motors on to it we are going to build a small controller for our me arm using a 3.3 volt Arduino Pro Mini and it's going to be powered by four batteries and I think it's a very interesting project especially when you see how you can design with 3.3 volt logic there's a couple of techniques that I'll be showing you there so let's start off by taking a look at the Arduino Pro Mini now let's take a look at the Arduino Pro Mini the Arduino Pro Mini was originally designed by Sparkfun the Pro Mini has now been retired from the official Arduino board list so you can't buy one directly from the Arduino store anymore however since the Pro Mini is an open-source design it is still manufactured by several companies and is widely available the Pro Mini uses the 80 mega 328 surface mount chip there are two versions of the Arduino Pro Mini a 3.3 volt 8 megahertz version and a 5 volt 16 megahertz version because it uses the same processor the Pro Mini has similar features to the Arduino Uno it has two additional analog inputs because it uses the surface mount version of the chip one difference between the pro mini and the uno is that it has no USB port in order to program the pro mini you will need an FTDI adaptor let's take a look at some of the pins on the Arduino Pro Mini first we have the digital input/output pins next we have the analog inputs there are eight of them however on some pro minis only six of them have been brought out to the board on the side of the pro mini is the connector for the FTDI interface the VCC pin is where you apply either 3.3 or 5 volts to your Pro Mini depending on which model you have the raw pin can use unregulated voltage in this case the pro minis built-in linear voltage regulator will reduce the voltage to the correct amount there are also two ground pins and to reset pins and there are two pins for serial input/output these can also be used at digital i/o pins 0 and 1 now when you purchase a pro mini it usually comes without the headers attached the headers are included in the package and will need to be soldered on sach Lee allows a lot of versatility because you can use different connectors or just connect wires directly to the pro mini board so now let's start working with the Arduino Pro Mini now here I have some Pro minis as well as some FTDI adapters for you to take a look at now first we'll start with the pro minis this is a 5 volt Arduino Pro Mini and this is a 3.3 volt Arduino Pro Mini as you can see other than the color they look quite the same and so it's very important for you to know what type of Pro Mini that you are going to be getting now I've got pins soldered on to these Pro minis over here you can see pins here for the FTDI adapter plus pins I've soldered on the bottom a bit in order to plug it into either a socket or into a solderless breadboard or dis solder it directly onto a printed circuit board and I've done the same with this one over here this is how they come from the factory this is actually three of them of the 3.3 volt ones and as you can see they don't actually have any pins on the meaning to solder them on the 5 volt one came in the package with some pins on it makkhi kind of amused you probably can't read that but it says caution static sensitive devices not to be handled by unauthorized personnel now I'm not sure how you get authorized to handle an Arduino Pro Mini but it's going to take my chances now these are two FTDI adapters this one has a jumper on the back for the three or the 5 volts and it's actually already connected as 5 volts if you wanted to use it for 3.3 volts you'd have to actually slice a small trace and put a solder bridge over it in order to do that on this one they have a jumper over here that you can set for either 3.3 or 5 volts and that makes it a bit easier both of them as you'll note have USB connectors and they use mini USB is not micro USB so you'll want to make sure you have the right cable for that and the final thing I wanted to show you was this this this is just a little piece of perf board that I soldered up with a couple of female headers and some male headers and it is connected pin 4 pin and this just allows me to plug a pro mini into one of these and experiment with it a little bit easier than I and especially if I don't want to be using a saw less breadboard there's no problem with using a solderless breadboard but the pins can sometimes stretch the contacts on the breadboard and so there you go a few arduino pro mini z' for your amusement now let's go and start to actually work with these devices FTDI adapters are available in several different shapes and configurations now as you are going to be powering the arduino pro mini from the FTDI adaptor during programming they also have a method of selecting the output voltage and it's important that you set that correctly some adapters will have a small switch others will have a jumper whereas others may have a trace on the circuit board that you need to create a solder bridge over whichever method your adapter uses make certain that it is selected for the correct voltage for your Arduino Pro Mini FTDI adapters have several output pins however there will be a set dedicated to programming the pro mini the connections are as follows the DTR or data terminal ready the TX our transmit rx or receive the VCC which is the power that is being sent to the pro many the CTS are clear to send input and a ground connection now in most cases the pins on the FTDI adapter will line up with the pro mini however be aware that some FTDI adapters and some pro minis do not have pins that line up also be aware that some of them are mirror images of the other ones it's always best to check your connections in order to connect the Neph TDI adaptor to a pro mini you need the following connections the DTR on the FTDI will be connected to DTR and the pro mini the TX are transmitted on the FTDI will be connected to the rx or receive on the arduino pro mini the RX are receive on the ftdi will be connected to the TX or transmitted on the many VCC will be connected to VCC on the Pearl many the clear descend input should be grounded so that it is always clear to send most Pro minis have an additional connection that is grounded for this purpose and of course the ground could be connected to ground so now you know how to connect your FTDI adapter to your Arduino Pro Mini so I've got both of my Arduino Pro Mini he's a 3.3 volt 1 and a 5 volt one and I've also got my 2 FTDI adapters that I showed you earlier now if you remember the 2 Pro minis have their pins reversed and the same was true of the FTDI adapters now had I put a female connector on to the pro mini I could have plugged the FTDI adapter directly into it but I just decided to use jumper wires and to make things easier on myself I use the same colored jumper wires for the two Arduino so now you just hook these up according to the diagram that I showed you matching all of the pins on the Arduino Pro Mini to the FTDI adaptor and you should be fine now remember to set the voltage correctly on your FTDI adaptor this one has now been strapped for 3.3 volts and this one already has a jumper set on the back for 5 volts and so what I'm going to do right now is I'm going to run a very simple sketch on both of these and show you how you can use the Arduino IDE to program them now remember the FTDI adapters require a mini USB not a micro USB your standard USB cable so you will need to have a mini USB cable for the two devices so let's go and take a look at the Arduino IDE and see how we set ourselves up to program both the 3.3 volt and the 5 volt Arduino Pro Mini alright here we are in the Arduino IDE now I've connected my 3.3 volt Arduino Pro Mini up to the USB cable so we'll work with that one first the first thing you need to do is to go into tools and go into board and select the correct board so go down and select arduino pro or pro mini next you need to select the correct processor in frequency so mine is an 18 negative 320 8p 3.3 volt 8 megahertz this is important to do otherwise your timing loops can be off in your program notice that some older pro minis use the 18 mega 168 these really don't exist anymore but you might have an old one so you might want to take a look at your board just to make certain that you're using the 18 mega 328 okay after that you'll need to go and select the port which should be pretty obvious as it is with any Arduino program now keep in mind that if you're using Windows you may need to install an additional USB driver for your FTDI device if you're using Mac or Linux like I'm using that shouldn't be a problem now that you set it up you can pretty well use the arduino ide as you always would so let's go and open everybody's favorite sketch and that is of course under basics the blink sketch now the blink sketch is a great sketch to test out new Arduino board lifts because it's a very simple sketch and we all know how it works however one thing is when you buy a new pro mini or pretty well any Arduino board it already has the blink sketch loaded on it so it's really not that exciting to watch the Arduino just do the exact same thing it was doing when you took it out of the box so what I like to do is I like to modify the blink sketch so let's change the delay time and turn the LED on for four seconds instead of for the one second and that's turn it off for two seconds and that should be distinctive enough so that when we load that up to the processor and look at the built in LED we should be able to see it flashing at a different rate than it was when we first that end is to make certain that the processor was working so now that we've done that let's upload that to the pro mini and it's done uploading and we'll take a look at the results for that in a moment but first let's go and disconnect I'm going to disconnect the pro mini right now and I'm connecting up my other pro mini now this is the 5 volt one so again I'm going to need to go into tools the board is correct but the processor is going to need to be changed over here so now I've changed the processor and just make sure it saw the port is it saw the port okay and now let's upload that and it's done uploading as well ok so now let's go and take a look at both of our pro minis we should see the blink sketch running we're just going to be using the onboard LEDs to monitor it and we should see it staying on for 4 seconds and then going off for 2 seconds and so here we're back at the breadboard looking at the results of our modified blink sketch now I've got the 3.3 volt Pro Mini hooked up right now and as you can see the LED is staying on for a long time and off for a shorter period of time which is how we modified our blink sketch I'm hoping you can see this blue built-in LED so that does seem to work now what we'll do is we'll just disconnect that and we'll move over to the other pro mini the 5 volt version and it uses a red LED and as you can see the same effect staying on for longer than the original blink sketch and going off for a shorter period of time and so that's a very simple demonstration of course but it does show you how you can program the Arduino Pro Mini z-- so now let's go and do something more interesting with our pro minis now before we move on to construct our me arm controller I want to mention one last thing about hooking up the FTDI adaptor to the pro many now in the experiments you saw me perform I used a series of jumper wires in order to connect the FTDI to the pro minis FTDI input but I actually didn't need to do that because in both cases the adaptors either lined up correctly with the correct pin outs in the same order or they were just the opposite and I could have turned one of them upside down either the pro mini or the FTDI adaptor and they would have lined up of course they both use male pins so it would have needed some sort of a female to female connector and an easy way of doing that in this case is to use something like this does that solderless breadboard and plug your pro mini into one side and the adapter in the other side now again you have to be absolutely certain that the pins are lining up correctly so use the diagram that I showed you earlier to verify that and if indeed that works then this is a far easier way than using jumpers so I just thought I'd throw that in for you now on to our robot arm controller now the controller itself is very simple in fact you can probably imagine how it works I've got four potentiometers controlling for servo motors so we simply use the pots to control an analog voltage going into four of the analog inputs and then we drive the servo motors with four of the digital outputs there's nothing special about that what I really wanted to illustrate with this circuit is not so much how to control a robot arm but instead how to use a six volt power supply with the 3.3 volt Pro Mini now the pro mini as you recall has a raw input and that's where you feed voltages that aren't regulated so you can feed the 6 volts into the pro minis raw input and use that to control the Pro Mini because the pro Mini has a built-in linear voltage regulator and the 6 volt is also the correct voltage for driving the servo motor and indeed that's what we're going to do but what's interesting is that if you look at the schematic for the Arduino Pro Mini you will come to realize that the VCC pin the pin you would normally connect 3.3 volts to is and output in this mode so what I've done in this circuit is I've connected my input voltage up to the raw pin and I'm using that 3.3 volt output as a reference voltage for the potentiometers because I can't use the six volts because at the top end the Potts would be giving up six volts and that would be very dangerous for the arduino pro mini to feed into it plus it wouldn't work anyway because once it got beyond 3.3 volts it would go beyond the limits of the analog to digital converter so this is really the technique I wanted to illustrate with this circuit so let's take a look at the hook up diagram right now and then I'll show you the sketch and then after that you'll see just how terrible I am at actually controlling a me arm so here's how we're going to hook up our simple robot arm controller we'll start with a 3.3 volt Arduino Pro Mini next we'll add some potentiometers I've used slide pots because I think they're easier to work with but you could also use rotary pots any value of 10k or higher linear taper will work we have one that we'll use for the claw control one for the right motor another one for the left motor and one for the base I also added two capacitors to keep the noise down on the power supply line an electrolytic capacitor I used a hundred microfarads but any value should suffice and a ceramic capacitor I used a hundred nano farad's but again the value here is not critical you'll need a six volt power supply you can use batteries if you wish and a connector to connect to the four servo motors will start by wiring the positive side of the power supply or a battery to the raw input on the pro mini we'll also take the six volt positive supply and wire it to the positive terminal for all of the servo motors next we'll take the negative from the power supply and connect it to the ground on the arduino pro mini and we will also connect this to the ground side on the servo motor connector now we'll connect our capacitors across the power supply line first the electrolytic capacitor makes certain that you observed the correct polarity after that will connect the ceramic capacitor it is not polarity sensitive next we'll take our ground side or negative side and connect it to one side of the potentiometers the other side of the potentiometers will be connected together and connected to the VCC terminal on the pro mini in this application VCC is actually an output that will provide 3.3 volts as a reference voltage for the Potts we then take the wiper of the base pot and connect it to analog pin a zero the wiper of the left pot goes to analog pin a1 we connect the wiper from the right pot to analog input a2 and the wiper from the claw potentiometer to analog input a3 then we take the i/o pin number 9 and connect it to the control pin on the base servo motor pin 6 goes to the control pin on the left servo pin 5 to the control pin on the right servo and finally pin 3 to the control pin on the claw servo motor and this completes our wiring now that we've hooked up our robot arm controller let's take a look at the sketch that we'll need to use to load onto the pro mini in order to make it work now remember to set your Arduino IDE up so that you are using a 3.3 volt Arduino Pro Mini go into tools and under board under processor make sure you selected 80 mega 328p 3.3 volt at 8 megahertz now let's look at the sketch we start off by including the servo library which is a built-in library so you don't need to add anything to your Arduino IDE then we'll create four different servo objects to represent the 4 servo motors and we're going to call them base left right and claw will also define some integers for the analog inputs that were using from the potentiometers we have base pin left pin right pin and claw pin and they're defined with their appropriate analog input pins then we'll define the valley that we're going to extract from these potentiometers base value left value right value and claw value and we initialize all of these with a value of zero in the set up all that we do is attach the servo objects to the output pins we've chosen so the base is attached to pin nine the left the pin six the right the pin five and the claws attach the pin three now to loop what we need to do is read the potentiometer values and convert them to a value that we can use for the servos which will be a value of zero to 180 remember the potentiometer values are going to come back as a value of 0 to 1023 because of the 10 bit panel log to digital converter in the arduino pro mini we can do this all with one map statement so we will map the value of an analog read of the base pin the analog read will give us a value of 0 to 1023 and we're using the map command to map that from 0 to 180 and we repeat this for the left right and claw pins as well and then we simply write these to the servo and so these are our servo objects so we write to the base servo objects the base value we just determined to the left the left value right the right value and the claw the claw value and then we add a short delay because we don't want to keep hammering our servos this is going to be very bad for them however the delay may also make the device a bit unresponsive so you can experiment with this value if you wish and that's really all there is to the sketch so now let's load it on to our pro mini and watch it in action and so here's our controller hooked up on a solderless breadboard you can see the arduino pro mini the 3.3 volt one over here you can see my power supply is actually a six volt lantern battery which of course is a bit of an overkill you could have used 4 double-a cells and that would have worked very well I could also have used my bench power supply of course here are the capacitors and the slide pots that I'll be using to control the me arm and I say that or rather loosely because as you're about to see I'm really bad at controlling my arms and naturally here is the me arm itself with the four servo motors on it there's one down at the base the left motor the right motor back over here and the claw motor which operates the claw so let's go and take a look at my terrible me arm control techniques and demonstrate our arduino pro mini robot arm controller okay we're controlling our me arm right now with the use of the base motor over here let's control the claw over here the left motor and the right motor and so it does work I'm not very good at controlling the arms as you can tell but we have built the controller for our me arm using the Arduino Pro Mini 3.3 volt alright that wraps up our look at the Arduino Pro Mini I hope you've enjoyed the video and that it's given you some ideas for using the Arduino Pro Mini in some of your own projects now if you'd like some more information about the pro mini or if you'd like the sketch that I used for the me arm controller you'll find that on the drôme bot work.com website in the associated article to this video and there's a link to that right below the video now while you're on the website please join up with the newsletter if you haven't already the newsletter is free it's not a spam letter by any means and certainly not old method of trying to sell you something it's my way of letting you know what happens in the workshop and also to solicit your opinions about what content you would like me to make in fact right now the only way that I'm taking suggestions for content are through the survey that you will find a link to in the newsletter it's at the bottom of every newsletter as well as in the welcoming letter you get when you sign up so if you'd like to suggest content please go ahead and fill out the survey and let me know what it is you would like me to create for you as well if you haven't subscribed to the YouTube channel please do that you'll find the subscribe button right below this video as well as a little robot symbol in the corner and you can click on him and he'll subscribe you so until next time we meet please take care of yourselves and I hope to see you very soon again here in the drone bot workshop goodbye for now [Music]
Info
Channel: DroneBot Workshop
Views: 158,217
Rating: undefined out of 5
Keywords: Arduino Pro Mini, Arduino, FTDI, Pro Mini, usb to serial, arduino (brand)
Id: tKCiNepc6_4
Channel Id: undefined
Length: 27min 40sec (1660 seconds)
Published: Sat Apr 13 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.