Arduino vs Pico - Which is the Best Microcontroller For You?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my name is gary sims and this is gary explains now if you're looking to buy a microcontroller for any kind of project you might have in mind whether that's robotics sensors smart home whatever it may be you have quite a range of choices out there and probably the two most popular are the arduino and all the different boards and ecosystem that offers and the raspberry pi pico now they are very similar in many sensors they are microcontrollers you can do digital i o you can do analog i o but of course there are also some differences so if you want to find out more about the difference between the arduino and the pico and which one's best for you please let me explain [Music] now we're going to start with the arduino because it is the oldest of the two the arduino board has kind of been around about 2005. the first raspberry pi the raspberry pi 1 which was not a microcontroller appeared in 2012 and we didn't get a microcontroller from the raspberry pi foundation until 2021 so a big difference between 2005 and 2021 so obviously the arduino has quite a head start so let's start there now many of the classic arduinos use an 8-bit microcontroller from atmel it's called the 80 mega and so it's 8-bit which means it is a little slower it means it's off doesn't offer as many resources in terms of ram and flash storage however there are also a bunch of arduino boards that are based on cortex-m microcontrollers from arm that's 32-bit and therefore it tends to also offer more ram and more flash storage and i'll talk about some of the difference of those as we go along now there are three types of arduino board there are the classic arduino boards which really is taken from the heritage way back 2005 and onwards they have a certain type of header layout because there are these things called shields which are really plug-in modules that go on top and of course the pin layouts need to be the same now most of the classic boards which you can still buy today uh have the uh atmel eight bit microprocessor in it however there are one or two that also have uh cortex microprocessors now after that you have the nano range this is much much different these are much much smaller boards and you tend to solder them with the pins going downwards and you can put them into you know bread boards and connect them up to bigger circuits whereas the classic ones were really there and you would kind of connect things to it so either you connect to it or you connect it to something else so the nano much smaller you connect it to something and most of these use the cortex microcontroller calls although there are some atmel cores in there as well now talking of the cortex cores one of the nanoboards actually uses a cortex m0 plus core from uh arm in fact it uses two of those cores i'll just save that information and put it on the shelf because we're gonna need to know about that in a few minutes when we get further into the video and then the third family of arduino boards are the mkr boards and these are all based on the cortex m0 core but these are designed specifically for offering lots and lots of wireless configurations so you've got wi-fi you've got bluetooth you've got modules with 2g and 3g you've even got narrowband 4g communication so if you're looking for something that's going to do wireless communication across all the different types of you know wireless specifications that are out there then you would look at one of these mkr boards and just to round it off to for completeness arduino do also have a pro range which are a whole bunch of different kind of uh boards which are aimed for industrial stuff industrial automation industrial grade board and we're not going to cover those because they really are quite a different category we're talking about the hobbyist consumer and education boards that you can get from arduino now when you want to program an arduino you use the arduino ide it's available for the desktop for windows mac os and for linux and there's also an online version so you can actually use it through a web browser now the arduino ide provides a language which they call the arduino language which is based on the syntax of c and c plus plus and by syntax i mean you need the semicolon at the end where the equal sign goes the same as in c curly brackets and all that kind of thing what you do get is actually a whole bunch of function calls and libraries and runtime stuff that are specifically designed for doing macro controller stuff so you want to be able to have ways of turning uh digital pins on or off reading from them analog pins and so on in fact the arduino language is based on another language called wiring wiring is a language designed for doing microcontroller stuff and wiring itself was based on processing and processing was a language designed to teach coding in the context of visual arts now it's also worth mentioning that three or four boards from uh arduino can also be controlled using micro python can be programmed using micro python uh but they are not very very bored when you look at the whole context of everything out there so at the moment that's still much of a kind of a growing growth area for arduino if you say to most people arduino they can talk about the arduino ide and the c like programming language based on wiring now when it comes to price because that's obviously an important factor when you want to buy particularly more than one board you want a whole a bunch of them for whatever project you're doing an official arduino nano board can set you up around 11 euros is around 13 the arduino uno uh r3 classic board retails officially for around uh 20 euros and then as you go up through the various different balls you can be paying up to 60 or 70 euros depending on the particular thing so if you're doing narrowband iot it's got all that fancy stuff built into it then you're going to pay more than that for that than you would just a kind of a more vanilla flavored you know microcontroller now the good thing about arduino is that all of the stuff they produce is open source not only is the ide open source but also the boards themselves are open source so all the schematics everything you need to know is out there and as a result there are lots of clone boards that are arduino compatible they've basically taken the information from arduino and they've manufactured themselves these tend to come out of the big manufacturing uh factories you know kind of in asia in china and that kind of thing and if you buy a clone board then you can expect to pay around six or seven euros uh six or seven dollars maybe for one of those boards but it's not an arduino original it's a clone but in my experience i've bought a few of those over the years they work just as you'd expect now just throwing one caveat here when talking about the arduino and the pico and that is these prices i'm talking about are normal price i'm not talking about if there's been some kind of chip sorted i'm not doing if you're trying to find some scalpers who are trying to sell you you know a ball that should cost ten dollars they're trying to tell it to for fifty dollars i'm just talking about in the normal world that's the prices you should expect to pay and as a side side to that side i would say do beware of scalpel if that's raspberry pies or nvidia jetsons or whether it's you know arduinos don't uh buy from scalpers who are putting the price up wait until you can get them through the official distributors and then you won't have a problem won't pay over the odds i've never paid over the odds for a raspberry pi or for a jetson or for an arduino i always get them from the official channels and i get them at the good prices and when of course you're talking about market control one of the big things is what can it control it's a micro controller and so all of these boards pico and arduino come with a range of input and outputs that you can then program so you've got obviously digital inputs and outputs is something on or is it off you can switch it on or you can switch it off you've got analog inputs and outputs so you know reading a voltage which is of course good when you're trying to read something from a sensor that gives you back an analog number and then of course there are interrupts and interrupts are very important when it comes to microcontrollers because you can when something happens on a pin automatically a piece of code will run and that's very different if you're doing polling and when you do polling you have to go round and check to see is it there is the flag set is that thing set now can i do that thing it does it automatically and these are true of both the arduino and of the pico and because you've got these various digital and analog pins you can then use them to talk to peripherals over some specifically defined interfaces for example you've got spi the serial peripheral interface you've got i squared c you've got standard serial which might be using a uart and you've got things like power width modulation and all of these different ways of talking can all be handled by the arduino there are lots lots of other boards that you can get that are not arduino compatible in the sense that they're not even designed to be arduino compatible they are microcontrollers but people have written support libraries so that actually you can still program them using the arduino ide so for example i do have some videos here on this channel about the blue pill and the black pill these are the generic arm cortex boards very cheap to buy uh relatively easy to program and to use and some very good people clever people have made libraries for these so that you can actually program them from the inside of the arduino ide so really arduino not only does it kind of cover its own stuff and cover in a kind of clone stuff it also covers stuff that isn't really designed to be for arduino but people have made the right libraries and the like interfaces so you can actually even use those as an arduino so as a summary the arduino is mature it's been around a long time you've got a big community you've got a big ecosystem the boards are readily available both from arduino itself and from clone manufacturers there are lots and lots of different libraries out there lots of different ways of supporting things and really if you can't talk to an arduino then it can't talk to anything that's almost the kind of position you're in and there's lots of flexibility in the types of interfaces that you can talk to analog digital interrupts pwm you know i squish it as i said all those kind of things so really kind of the arduino is this generalistic great idea that covers so much in the hobbyist and educational market for doing things with microcontrollers but then in 2021 we had the advent of the raspberry pi pico now the raspberry pi pico was important for two reasons one is itself was a microcontroller board which we'll look at a bit in detail in a moment that came from the raspberry pi foundation and came with all the support and the backing that you get when you buy a raspberry pi kind of product but also they built it with their own designed microcontroller chip although it uses the cortex m0 plus cpu core from arm there's quite a few interesting things about that microcontroller that means that actually they decided to sell it to other people so you can actually just buy the chip if you are a hardware designer and then you can start building other products and we'll talk more about some of those products in a minute but that chip is called the rp 2040 rp for raspberry pi the first digit two is because it's a dual core so you've got two cortex m0 cores i do have some videos here on this channel about how to get that multi tasking working across two cores on a raspberry pi pico the zero is there because it is a quartus m0 core so if in the future there was a cortex m3 core it would be with a three in that place or a four or a seven depending whatever cortex core they end up using the four is an indication of how much ram it's got it's a 2 to the power of 4 times by 16k which is actually 256k this one's got 264k so it's kind of a rough indication on how much uh membership if you had half of that it'd be a two if you had double that it would be an eight and so on and the last zero is how much built-in flash is there on the chip itself now on the actual chip there is no built-in flash and one of the things the raspberry pi pico board does as well as adding power of course and the clocks and the support for usb is actually as on board uh flash so the pico board has got two megabytes of uh flash built into the board now the pico is programmed differently to the arduino uh setup although there is a caveat to that which i will mention in a minute so you use it in one of two ways the first way is to use micro python and this is dead dead simple so if you use an ide like sony that is a python ide literally it will say oh i see you've got a raspberry pi pico here should i save this python script onto that and then run it and you go yes please do that and it just runs and then you edited it a bit and when you save it goes i'm saving it back to the pico and then it starts running it so literally all you've got to do to program your pico is write some python code and there are lots of libraries built into micro python a kind of a variant of python specifically for microcontrollers for doing all the i o stuff just like there's the c stuff inside of the arduino for doing all the i o stuff so again you can access you know the serial port you can access the analog pins and the interrupts and you can access all these things including the second core and have the two cores communicating with each other timers all this kind of stuff all built in there to microprice and all you've got to do is write some python load it onto the board and it starts working now the second way is to use c and c plus plus and in this case it's a full c and c plus plus so it's actually a full c and c plus plus compiler gcc from the gnu foundation and basically you're able to compile things directly and do it very low level in fact you can program it from a raspberry pi over to the pico and you get full debugging you can step through even at assembly level language and if you've seen my two videos here on piccolo os that was the multitasking os that i wrote as a demonstration to show you what you can do on a raspberry pi pico if you're using c and kind of writing native code to run directly the binaries to run directly on top of the pico so if you can write a multitasking os in the c and c plus then you can basically do anything you can't do that with the arduino one because it's not that low level it's much more high level but you can with the raspberry pi pico and when it comes to price of course the driver by pico just sells for four dollars or four euros and that's the price i've paid i've bought several of them at different times from different places and that is the price again go back to what i said a moment ago about scalpers and ridiculous prices that you see sometimes so when you can get hold of them and where i am at the moment there's lots of them in stock if you go to one of the shops stores they've got thousands in stock you can get them so i just recently bought another two because i wanted to try some other kind of project and uh no problem getting them and that's what they cost and if we're just talking about the gpio pins again exactly the same as the arduino you've got analog and you've got digital and you've got interrupts you can use i squared c and spi and the serial port you can use pulse width modulation but there's one thing extra you can do on the raspberry pi pico and that is you can use pio programmed input output or programmable input output and that's basically it runs a little program so there's a little program you can run on just for the i o controller that can do things at certain times and in certain ways and that's very good for making sure that the signals are going in us over the simplistic point of view but they're going up and down up and down when they need to and that's fully programmable in fact you can actually then program serial and i squared c and spi just using that programmable i o block inside of the chip there so if you want to interface to something very tricky then and you want it to be consistent in hardware level then you can use pio on the raspberry pi pico actually if you do want some videos about pio and how it works and what you can do with that please do let me know in the comments below and i'll see if there's enough interest and maybe we'll put together video now if you remember i said remember put that on the shelf that there's a cortex m0 plus dual core version of the uh arduino world if you think about it that's because the dual core m0 plus version uh we've got in the pico is actually they've taken that rp 2040 chip and they've put it into an arduino and so because of that you can actually get an arduino with the same processor in it as the raspberry pi pico you program it through the arduino ide but actually it's the same dual core processor and then you can do everything in that so you can actually get the best of both worlds by using the arduino version of the picos processor because you still stay with the arduino ecosystem but using the power of that rp 2040 processor and then as a result of that you can find some libraries that allow you to actually just take a normal picot and integrate it into the arduino system again just like you can with the blue pill and other boards are not designed for that but actually the clever people have made a way to allow it to be integrated so there you go so you really you've got all the options that you could ever possibly want okay so what do we say in conclusion well first of all arduino is ubiquitous it's relatively well priced particularly if you look at the clone boards there are lots of sophisticated niche boards available with lots of interesting connectivity on them uh if as i said the the like the community the ecosystem is huge and mature so you can't go wrong as it were with choosing the arduino however the raspberry pi pico has this great thing is that it's coming from the raspberry pi foundation which of course has proven to be absolutely amazing in the educational market and the maker market with all the raspberry pi devices and i've got lots of videos here on the channel here about raspberry pi reviews projects and so on and now you've got this micro controller it's got a dual core cortex m0 plus uh processor in it plus two uh megabytes of flash and all this kind of stuff so and it's only four euros so kind of you like you say well should i buy an arduino should i buy a pico which way do you go well me i used to just say we get an arduino of course you get an arduino because everything works with an arduino but now when i recently had to pick some more microcontrollers i found myself saying i'm going to get the the pico because it works it works with macro python it works with a full cc plus plus compiler affiliate but it only costs four euros of the equivalent in the local currency and so i went with the pico so what does that mean does that mean the pico is going to knock down the arduino well they seem to be working together at the moment because you can still get as i said the arduino with the same processor on it i think that we're going to see the pico grow more and more in its popularity and particularly if the raspberry foundation bring out other variations of it and there are other variations coming out from third parties i say because you've got the arduino version there are other ones from adafruit and so on and they're starting to do things like add wi-fi modules to them and this kind of stuff so that you're getting more and more sophisticated boards and obviously you pay more for them because you've got more things on them but it's in that same ecosystem now i don't think they're going to kind of kill each other it's not rivalry in that sense but it does give you and me as consumers the choice and me personally the last time i made a choice which one do i want i went with the pico so that kind of surprised me which is why i'm actually making this video because i've discovered that the pico is sufficiently growing and it's sufficiently supported and sufficiently able that actually i find it the better choice so do tell me in the comments below which one would you prefer if you were starting a new project tomorrow which board would you go out and get to start uh doing that what experience do you have of both those systems i'm sure me and other readers of the comments will be interesting to hear what you have to say okay that's it my name is gary sims this is gary explains i really hope you enjoyed this video if you did please do give it a thumbs up if you like these kind of videos why not stick around by subscribing to the channel don't forget you can follow me on twitter at gary explains and i also have a monthly newsletter go over to gary explains.com type in my address you won't get any spam but you will get that newsletter okay that's it i'll see in the next one [Music] you
Info
Channel: Gary Explains
Views: 100,046
Rating: undefined out of 5
Keywords: Gary Explains, Tech, Explanation, Tutorial, Arduino, Raspberry Pi Pico, Pi Pico, Pico, RP2040, Raspberry Pi, Arduino Nano, Arduino UNO, Arduino Zero, Arduino Due, Atmel, ATMega, Atmel ATMega, AVR, Mega AVR, Arduino Uno Rev3, Arduino MKR ZERO, Arduino Nano RP2040 Connect, Arduino IDE, MicroPython, Microcontroller, Microcontroller Board, Best microcontroller, Arduino vs Pico
Id: dOa3570JM2M
Channel Id: undefined
Length: 20min 38sec (1238 seconds)
Published: Thu Apr 14 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.