Sick Gaming
[Tut] Getting To Know Your Basic UCTRONICS Raspberry Pi Pico Kit - Printable Version

+- Sick Gaming (https://www.sickgaming.net)
+-- Forum: Programming (https://www.sickgaming.net/forum-76.html)
+--- Forum: Python (https://www.sickgaming.net/forum-83.html)
+--- Thread: [Tut] Getting To Know Your Basic UCTRONICS Raspberry Pi Pico Kit (/thread-100242.html)



[Tut] Getting To Know Your Basic UCTRONICS Raspberry Pi Pico Kit - xSicKxBot - 11-16-2022

Getting To Know Your Basic UCTRONICS Raspberry Pi Pico Kit

<div>
<div class="kk-star-ratings kksr-auto kksr-align-left kksr-valign-top" data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;892909&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;top&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;1&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;5\/5 - (1 vote)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;{score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>
<div class="kksr-stars">
<div class="kksr-stars-inactive">
<div class="kksr-star" data-star="1" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="2" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="3" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="4" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" data-star="5" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
</p></div>
<div class="kksr-stars-active" style="width: 142.5px;">
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
<div class="kksr-star" style="padding-right: 5px">
<div class="kksr-icon" style="width: 24px; height: 24px;"></div>
</p></div>
</p></div>
</div>
<div class="kksr-legend" style="font-size: 19.2px;"> 5/5 – (1 vote) </div>
</div>
<p>Now that we’ve covered <a href="https://blog.finxter.com/getting-started-with-thonny-the-optimal-ide-for-the-raspberry-pi-pico/" data-type="post" data-id="802754" target="_blank" rel="noreferrer noopener">Thonny</a> and <a href="https://blog.finxter.com/learn-the-basics-of-micropython-for-absolute-python-beginners/" data-type="post" data-id="852391" target="_blank" rel="noreferrer noopener">MicroPython</a>, it’s time to get to know the components in your basic <strong>Raspberry Pi Pico kit</strong>. </p>
<p class="has-base-background-color has-background"><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f916.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>Note</strong>: There is more than one kit out there, but it is this author’s opinion that the best value for beginners is the one from UCTRONICS. Most of them have similar components, but this one just happens to be my go-to and is the subject of this installment.</p>
<p><em>*If you have not yet read our previous installments on <a href="https://blog.finxter.com/learn-the-basics-of-micropython-for-absolute-python-beginners/" data-type="URL" data-id="https://blog.finxter.com/learn-the-basics-of-micropython-for-absolute-python-beginners/" target="_blank" rel="noreferrer noopener">learning MicroPython</a> for the Raspberry Pi Pico or <a href="https://blog.finxter.com/getting-started-with-thonny-the-optimal-ide-for-the-raspberry-pi-pico/" data-type="post" data-id="802754" target="_blank" rel="noreferrer noopener">Thonny</a>, be sure you review those before moving beyond this short tutorial.</em></p>
<p>Alright, let’s jump in! Here’s what the kit looks like:</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="769" height="739" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-139.png" alt="" class="wp-image-892918" srcset="https://blog.finxter.com/wp-content/uploads/2022/11/image-139.png 769w, https://blog.finxter.com/wp-content/uploads/2022/11/image-139-300x288.png 300w" sizes="(max-width: 769px) 100vw, 769px" /></figure>
</div>
<p>First things first, though. We’re going to start with the Pico itself. The main thing you’ll need to know about it (at least for the purposes of doing experiments) is its pins.</p>
<h2>Your Pico and Its Pins</h2>
<p>Your Pico talks to hardware through a series of pins along both its edges. Most of these pins work as a general-purpose input/output (GPIO) pin, meaning they can be programmed to act as either an input or an output and have no fixed purpose of their own. </p>
<ul>
<li>Some pins have extra features and alternative modes for communicating with more complicated hardware; </li>
<li>Others have a fixed purpose, providing connections for things like power.</li>
</ul>
<p>Raspberry Pi Pico’s 40 pins are labeled on the underside of the board, with three also labeled with their numbers on the top of the board: Pin 1, Pin 2, and Pin 39. </p>
<p>These top labels help you remember how the numbering works: Pin 1 is at the top left as you look at the board from above with the micro USB port to the upper side, Pin 20 is the bottom left, Pin 21 the bottom right, and Pin 39 one below the top right with the unlabeled Pin 40 above it.</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="549" height="561" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-140.png" alt="" class="wp-image-892922" srcset="https://blog.finxter.com/wp-content/uploads/2022/11/image-140.png 549w, https://blog.finxter.com/wp-content/uploads/2022/11/image-140-294x300.png 294w" sizes="(max-width: 549px) 100vw, 549px" /></figure>
</div>
<p>While you will generally use actual pin numbers when writing your code, we may reference some of them by their functions, as well.</p>
<p>As you can see, there are several different kinds of pins with different functions. Here’s a quick reference guide to help you remember:</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="523" height="686" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-141.png" alt="" class="wp-image-892923" srcset="https://blog.finxter.com/wp-content/uploads/2022/11/image-141.png 523w, https://blog.finxter.com/wp-content/uploads/2022/11/image-141-229x300.png 229w" sizes="(max-width: 523px) 100vw, 523px" /></figure>
</div>
<p>You’ll learn more about these functions in later tutorials as we get into projects. For now, all you need to focus on is the basics. This is not meant to be an exhaustive electronics course. <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h2>Other Electronic Components</h2>
<p>Obviously, your Pico isn’t the only thing you’re going to need if you’re going to be conducting any experiments. </p>
<p>The other things are the components that your Pico’s pins will be controlling. There are tons of components out there, but the cool thing about this kit is that these are useful regardless of how complicated your projects ultimately get – and if you have fun with these, I guarantee you’ll start coming up with your own.</p>
<h3>Breadboard</h3>
<p>Anyway, let’s start with the second most important component (well, besides the micro USB cord that connects the Pico to your computer) – your <em>breadboard</em>.&nbsp;</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="471" height="224" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-142.png" alt="" class="wp-image-892926" srcset="https://blog.finxter.com/wp-content/uploads/2022/11/image-142.png 471w, https://blog.finxter.com/wp-content/uploads/2022/11/image-142-300x143.png 300w" sizes="(max-width: 471px) 100vw, 471px" /></figure>
</div>
<p>This little beauty makes life a WHOLE lot easier. This unit eliminates the need for a circuit board and soldering. Instead, you can just shove – ok, maybe not <em>shove,</em> but insert – wires and pins into the right spots and remove them as needed to do new projects. Hard to beat that!</p>
<h3>Jumper Wires</h3>
<p>Next are your <em>jumper wires</em>, which connect components to circuits on your breadboard and take the place of those little “wire trails” you see on circuit boards. </p>
<p>That way, they aren’t permanent and can be moved as you see fit. They can also be used to lengthen wires or pins as needed. </p>
<p>To accomplish this, they come in 3 types – male-to-male (M2M), male-to-female (M2F), and of course F2F (can you guess?).</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="314" height="302" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-143.png" alt="" class="wp-image-892928" srcset="https://blog.finxter.com/wp-content/uploads/2022/11/image-143.png 314w, https://blog.finxter.com/wp-content/uploads/2022/11/image-143-300x289.png 300w" sizes="(max-width: 314px) 100vw, 314px" /></figure>
</div>
<h3>Momentary Switch</h3>
<p>Next up, we have a <em>push-button switch</em>, or <em>momentary switch</em>. This doodad is exactly what it looks like – a button. </p>
<p>However, in this case, it’s not the same as a <em>latching switch</em>, which stays depressed once you click it. This one only has to be held down to make it keep working.</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="273" height="207" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-144.png" alt="" class="wp-image-892929"/></figure>
</div>
<p>Now this one’s going to shock you. It’s called… a <em>light-emitting diode, or LED</em>! I know, I know, you’ve never heard of it, right? <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f602.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="374" height="105" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-145.png" alt="" class="wp-image-892930" srcset="https://blog.finxter.com/wp-content/uploads/2022/11/image-145.png 374w, https://blog.finxter.com/wp-content/uploads/2022/11/image-145-300x84.png 300w" sizes="(max-width: 374px) 100vw, 374px" /></figure>
</div>
<p>I don’t think I have to say much of anything about these, but I will make two points. </p>
<ul>
<li>First, not all LEDs are going to work with your Pico. 5V and 12V aren’t good, so if you decide to buy more, make sure you keep that in mind. </li>
<li>Second, the two legs are different lengths. The long one is positive, and the short is negative.</li>
</ul>
<p>When we’re running a current through stuff, we can sometimes run the risk of blowing them out, especially the LEDs. So how do we prevent that from happening? </p>
<h3>Resistor</h3>
<p>With <em>resistors</em>, of course! Now, there are a lot of resistors out there with different stripes on them to tell you the level of resistance they provide in a unit called <em>ohms(?)</em>. I’m not going to get into that kind of detail here because it isn’t necessary for Pico jobs. </p>
<p>Suffice it to say that if you run out of resistors and want more, you’ll be using little 330? guys.</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="427" height="91" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-146.png" alt="" class="wp-image-892934" srcset="https://blog.finxter.com/wp-content/uploads/2022/11/image-146.png 427w, https://blog.finxter.com/wp-content/uploads/2022/11/image-146-300x64.png 300w" sizes="(max-width: 427px) 100vw, 427px" /></figure>
</div>
<p>Just one little note – yours might not be the same color, but the stripes will be. The ones I got in my kit are blue, but that doesn’t matter; 330? is 330?.</p>
<h3>Piezoelectric Buzzer</h3>
<p>Everyone’s favorite component to play with – well, as long as you have people in your place to annoy – is the <em>piezoelectric buzzer</em>. Oh, boy, this one’s fun! It does exactly what its name indicates, and it does it by vibrating two metal plates together when a current is run through it. Heh, heh.</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="290" height="172" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-147.png" alt="" class="wp-image-892937"/></figure>
</div>
<p>I’m an avid guitar player, and I LOVE the electric guitar the most. I’m the heaviest of metal heads! Ok, maybe not that heavy. I only clock in at 5’7” and 140lb. Sorry – if you’re not an American reader, that ain’t big. Martial arts has done me a lot of good in life. <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f923.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Aaaaaaaanyway, there are at least two knobs on an electric guitar – one for volume, and one for tone. </p>
<h3>Potentiometer</h3>
<p>These both use <em>potentiometers</em> that can be used either as a <em>variable resistor</em> (with two legs connected) or a <em>voltage divider</em> (with all three wired up). In other words, one hookup controls ohms and the other controls volts. I’ll let you guess which version controls which function on the guitar.</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="162" height="264" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-148.png" alt="" class="wp-image-892939"/></figure>
</div>
<h3>Motion Detector</h3>
<p>Ever tried to break into somebody’s house, but they had one of those pesky motion detectors that lit up the whole property and nearly got you busted? No? I guess that’s just… a friend… <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f633.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Well, you get one of those pesky… I mean… <em>cool </em>motion detectors, too. It’s actually called a <em>passive infrared sensor (PIR)</em>, and it makes things happen when you wave your hand in front of it. Better than a button? You be the judge.</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="286" height="236" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-149.png" alt="" class="wp-image-892941"/></figure>
</div>
<h3>Screen and Display</h3>
<p>Last but not least (I love overused, trite cliches, don’t you?), we have a screen. It’s actually called an <em>inter-integrated circuit</em> or <em>I2C display</em>. It can show all kinds of nifty stuff from text to pictures. There are some fun things to do with this baby!</p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="298" height="156" src="https://blog.finxter.com/wp-content/uploads/2022/11/image-150.png" alt="" class="wp-image-892943"/></figure>
</div>
<p>Obviously, there are other components you can get like motors, current sensors, reverse-LEDs, and a whole host of things. Some of them require special drivers and such, though, so they wouldn’t be considered basic. For the purposes of this series, we will be focusing on more basic components and projects before graduating to higher-level (and more expensive) experiments.</p>
<h2>Keep Learning! <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f447.png" alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /></h2>
<p>Next time, we’ll get into our first project. It’s pretty easy, but it’s fun and totally worth it. I can’t wait to get started, so I’ll talk to you soon. Until then, try some more of the MicroPython I taught you <a href="https://blog.finxter.com/learn-the-basics-of-micropython-part-2/" data-type="post" data-id="867926" target="_blank" rel="noreferrer noopener">before</a>. Happy coding!</p>
</div>


https://www.sickgaming.net/blog/2022/11/14/getting-to-know-your-basic-uctronics-raspberry-pi-pico-kit/