Brought to you by the reinvented two thousand twelve camera. It's ready, are you? Didn't touch? With technology? With tech Stuff from how stuff flix dot com. Hello there, everyone, and welcome to tech Stuff. My name is Chris Poulette and I am an editor at how Stuff works dot com. Sitting across from me, as always, is senior writer Jonathan Strickland. Hey there, all right, today I wanted to take control of the podcast. This is different from any other week
how us. Yeah, we'll see now I'm singing Janet Jackson in my head. That's how it's different from every other week. Yeah, we were going through some other songs before we started the podcast. It was it was kind of a loopy morning. But today we wanted to talk about something that's not loopy, although you can have a loop in the programming for it.
It is a micro controller. We've actually touched on these in the past, well a segment of these, because we've talked about the Ardueno, which is a kind of micro controller. But Jonathan said, why don't we take a step back and look at them as a whole. Yeah, we actually had some people ask us about micro controllers. We even had one person to say, could you explain the difference between a micro controller and a microprocessor? And uh, and and really the distinction is not black and white. There
are sort of black and silver. I'm just kidding. It's also green in some places. Yeah, now there's um, there's a there's certain characteristics that micro controller has, and if it has enough of them, that's when we tend to call it a micro controller versus a microprocessor. Now, in general,
a microprocessor tends to be a general purpose component. UM. Basically, when most people talk about a microprocessor, they're speaking primarily of the chip that does a lot of the computing central process and unit is a very that's that's a type of microprocessor. That's what I think of when I think micropross UM. And there is a processor as part of a micro controller. But a micro controller is a
very very tiny computer. UM. What doesn't have to be very very tiny, but it is basically a computer on a board. UM. So it would have the board, which is the green I was referring to before, the circuit board, and it would have a processor sawdered into it. But it also might have other inputs and outputs on it, maybe an USB output that's wired in and uh, a
couple of LEDs for example. It could be it could be a lot of different things, but usually it's a general purpose or i'm sorry, a specific purpose that the micro controller is designed to do. And so you find them in all kinds of things ovens, toasters, cars, microwaves, um and you know, it is a computer, but it is it's not like the kind of computer that sits
in your desktop, right. It's a very specific use. So we know we've talked about these and things like we had our our podcast about microwavest about a little bit on that. But yeah, these are these are computers that have very specific uses and because they have these narrow parameters, they don't need to be general purpose, so they tend to have a fairly limited number of of uses that they can they can actually be UM employed for otherwise,
you know, it's outside the realm of their scope. So here are some general guidelines as to what makes a micro controller, and I'm pulling these from our article on how micro controllers work, which is an extensive article. It is it is one of our I mean, and it goes into detail if you want technical details about micro controllers. It's an excellent resource, and it was written by Marshall Brain, who was the founder of how Stuff Works dot com.
In fact, he uh he took a specific kind of micro controller and talks about programming and how that you how you would get into that and um, you know, it depends on the micro controller how you would program one. So we're not going to get into that much detail. We're really going to touch on, uh, the uses of micro controllers in general and and what goes into you know,
the makeup of them. Yeah, we might talk a little bit excellent, Yeah, we'll talk a little bit about programming, but we're going to take a very general approach because otherwise, you know, you have to do a specific podcast over each one and that would just be ridiculous. But but Marshall went into detail on that specific kind of micro controller and which is a programmed in basic Yes, which is kind of cool because I don't usually typically think
of that as a micro controller language. Right, So let's let's get down to the basic features of what a micro controller is. So as as Marshall pointed out, they are typically embedded in something else. So a micro controller is not its own thing, it is part of something else. So for an example, the microwave. The micro controller is what allows the commands you put into the microwave to
be transferred into action within the microwave itself. Then they are dedicated to a specific task or specific program, and that program tends to be stored and read only memory and does not change. So, in other words, it's something that you're going to do over and over again, you know it's it's it's dedicated to a task that is repeatable and is not changing after you've done it once.
So like a calculator and you you use a calculator to add five to five, that's never going to change unless the laws of the universe change, in which case or you know, some some sort of crazy, wacky parallel universe thing happens. Yeah, remind me to get a new calculator, right, so then you have. They also tend to be very efficient. They tend to not require a lot of power to operate.
So for example, you know, you might have a full computer that has its own onboard battery, but you tend to keep bit plugged in because it drains a lot of power. Right, Well, micro controllers do not require so much power, so they can be battery operated and last for a long time and they're only pulling power whenever they're in use. So that's why you could have a calculator that's battery operated and you don't have to change
the batteries out that frequently. And of course you have one that has also the little solar panels on it, you may not ever have to change the batteries, depending on you know, the the environment you are in when you are using it. UH. It has a dedicated input device and usually, but not always, has some sort of
display to show the output for the device. And UH normally you have this display there when you are first building or programming your micro controller, and it's in order for you to make sure that the program you have built is operating properly before you start to go into like a manufacturing phase and you start implementing it into
a product. So you would want to be able to test this extensively before you went into full production, otherwise you could end up producing a line of of things that are flawed because there was some line of code that you left out, or there was an extra character or something. And now when you add five to five you get cake. Like I said, I need a new
calculator cake. Now, the the use of microwave in this case is a good example because um, you know, in the in the chips baked into them, not baked into soldered into I'm just tripping all over stuff today, UM, soldered into the board inside the micro controller in the microwave. UM, it's got instructions on you know what each of those digits does. On the keypad, it's got UM instructions on on what to do when you press the coffee button versus the the popcorn button. UM. So many of these
microwaves have these dedicated buttons now UM. But it basically the instructions are, hey, if he presses the pizza button, that means put the microwave on high for seventy five seconds and that's it, you know, start. So it has those instructions in there, and it also has a display UM instructions, so it shows what is going on to the user, so that he or she has an idea of how long it's going to be cooked for and
what power. But you know, it doesn't have to do things like tuna radio or um uh try to find Facebook or something like that, or or do WiFi, because it's not a program to do that, so they can they can mass produce these boards with the ROMs already in them and assemble it as part of the microwave, and every microwave should work that comes off the line with that board, and it should work the same, right and UH, and it doesn't have to be a manual
input for a micro controller to produce an output. So, for example, the micro controllers you have in your car could be connected to various sensors in your car, and what happens is the sensor sends an input to the micro controller, which then UH creates the appropriate output for
whatever that might be. And it might be that it changes the settings of something else it's in your car, or it might be that sends a signal so that the little check engine light pops up on your on your dashboard, so that you then have to figure out what the heck has gone wrong. So for example, in my house, you figure out where you put the electrical tape so that you can tape over the check engine like, well,
problem solved. Well that anybody who's actually watched when they do the diagnostics on a car, And this would be good for the folks over car stuff to talk about but um in more detail. But you know, there is a board that they plug into so that the mechanic can plug in and it will read what the micro controllers inside the car, and there are several for different functions.
Um you know will say, hey, the check engine line is on because you know error code five seven five one two, and they look it up in a book and they go, oh, well, that means that the e g R valve needs replacing or yeah, or there's a belt that is not working properly. Yeah, and then it
turns out. Just in case you're wondering, there are apps out there for smartphones where you can get a proprietary cable that will hook up into a smartphone and you hook the other end of the cable to your your cars computer and it will actually tell you what the code is. Now, you may still have to go and look up what the code means, because not all of these apps have a complete database on what every single
code for every single model of vehicle translates to. But at least then you can have an idea of what's actually wrong. Which that's for that, you know, if I'm gonna do it yourself. Yeah, we're getting off topic of it, but the idea being that you will you'll be able
to diagnose what's wrong with your car. So that way, when you take it into a mechanic, you can be reasonably sure that whatever the mechanics telling you is either true or not true, because there's always that worry, you know, when cars get more and more sophisticated and becomes more and more difficult to understand what's going on with them. You never really know if what the mechanics telling you is actually what's wrong with your car, or maybe they're
adding onto it. Yeah. Well, of course not every mechanic is untrustworthy, but sometimes there there there's some good mechanics out there. But that's the thing is that because you don't know, you have to entirely on them exactly. I don't think you're so off topic, Jonathan, because, uh, you know that that really indicates how pervasive micro controllers really are. Um. You know, people talk about the computers in their cars
or you'll see. Uh. I have a toaster that I thought was kind of funny a few years ago because it said, you know that it it had a microprocessor inside, and I was thinking, really, is that a selling point for my toaster? Um. But yeah, I mean, these these devices are in just about anything that we plug in these days, and some things that we don't, like your cars, and um, you know. The the good the advantage to that is that, you know, it does make these devices
more sophisticated. It gives us more control in some cases, it gives us more um options as far as what we can do with all the I mean this gigantic range of devices. It also provides more points to break down because you know, typically the more complex a thing is, the more chances it has to bust. This is something we yes, well, systems have a tendency. The more the more organized and complex a system, the greater the tendency is for it to slowly break down into the simplest
form right right, And that's you know that. I think that is why it's interesting to look at micro controllers because, um, it gives you a sense of what's going on behind the scenes and what may or may not be at at play. Um. But it's good that micro controllers can help us track these things down to when it's not the micro controller itself that's the fault. Um. But yeah, typically these are not things that we program ourselves like you program a computer. You might learn Java or Ruby
or Python to go program a computer. Most of these things are behind the scenes that ROMs are soldered onto the boards. We never touched them. Yeah, now that doesn't mean you can't, but right, but they're they're specific types of micro controllers you would have to get in order to be able to to program on top of them. I'm going to overclock my toaster like cold toast way well, you know, never toasts anymore, reduced the resistance. Uh, it's
pretty amazing. Now the there are a couple of other little things I want to talk about, other features that could possibly uh mark something as a micro controller. They tend to be small, They tend to be fairly cheap, which is important. I mean, that's one of the reasons
why you want a micro controller. You want something that's focused and narrow because you don't have to worry about building in all these other features, and that helps red is the cost, which, of course you then turn around and you can you can competitively priced whatever your product is, whether it's a toaster or a car. And then they also often but not always, are made to be pretty tough to work in a variety of conditions because obviously, if you have a car, the operating conditions inside a
car tend to be pretty warm. Engines. Engines give off a lot of heat, um, and so you need to have electronics that can withstand that heat because, as we all know, heat plus electronics often equal sad faith. Yes. Well, and in the cases of things like uh, now that we have these these wireless handheld game controllers and things like that, um, you know, sometimes they tend to fly around the room when people get a little bit over zealous,
you know, things like that. You don't want it to uh the components to be exposed, because if you do, then they're gonna break. Yeah. Yeah, And then you might want to know generally how powerful these micro controllers are. Well, they don't need to be terribly powerful, and so a lot of them, yeah, a lot of them are have
have some incredibly bare bones specs. Now, one of the ones that Marshall wrote about was he said, like, if you were to take a low end micro controller chips, so this is not the state of the art biting means, it would have around it could have around a thousand bytes of read only memory and twenty bites of RAM on the chip and then eight input output pins. And so you know, if you're buying a whole bunch of these,
they'd be pretty cheap because they're they're not very sophisticated. Um, Whereas if you were to get a micro processor, then you would have to spend more money because you're going to be packing a lot more components, a lot more features onto the same size chip. You could certainly build
one of these yourself. Um. There are plenty of places where you can get the chips and boards and other components where um you could do you could essentially build a micro controller to take over any kind of project like this that you wanted to undertake. UM. And you'll see that these the processes that you can buy are you know, they're fairly inexpensive and they are not designed
to handle that kind of instruction set um. But what what's really cool about that is that you can customize a micro controller to do whatever it is that you want to do, provided that you have the programming expertise to do it. Right now, so you may remember, we did an episode about logic gates while back now. Logic gates are what allow you to control the flow of electrons in such a way, so that you can have
a meaningful output depending upon particular types of input. And uh, what these micro controllers do is they provide you the opportunity to build gates in a software environment as opposed to a hardware environment. So in other words, you could accomplish the same thing that a micro controller does by
hard wiring things together. But that would make the components enormous by comparison, right, because you would have all these different wires and all these different components that that were connected together, so that let's say you push a button and you want this one particular light to come on, but not any of these other lights to come on, because those lights should only come on if you push
another button. Well, all the wires you would need to put this entire system together might be pretty cumbersome, and it might be that, you know, you could not fit this in a very small package. And in fact, we see this if we look at the history of electronics, you'll see that the older the electronics are, in general, the larger the the particular version of whatever it is
you're looking at was. So, for example, the earliest computers took up sometimes an entire floor of a building, because you know, you had to accomplish with basic electronic parts what we can do with chips today. So a micro controller, what that allows you to do with this read only memory, that's where you can imprint on that a program that through software creates a virtual series of logic gates so that depending upon the inputs that the chip receives, it
will give out a specific type of output. So you don't have to hardwire stuff as much with a micro controller, although there is still hardwiring because you do have to you know, you do have to actually connect inputs to those those input pens, those input output pins, and you have to connect the output to whatever it is that
you are you know, using as an output. Often it tends to be a little l c D or LED screen when you're at least when you're first programming it, so that you can make sure that you're getting the response that you want. Uh, you know, there is still that, but the majority of the work comes from building out the logic within the program itself. Now as yeah, and and it it really is programming. It really is saying for this instance, when this happens, this is what needs
to happen as a result. That's the basic idea of a program, right and given this, given this instance, this output. Yeah, and I think it's it's fair to say. And I haven't. I'll be honest, I haven't. As much as I want to get into, uh some basic hacking, I haven't really worked with any microprocessors yet A sorry micro controller, I've worked with either one of them. Frankly, um, I'm going to trip over everything I say today. I'm just gonna
stop talking. But what I was gonna say is that, you know, from many things, many people think of programming as you know, egad, it's programming that's not for me, and you know, really programming is for anyone. But if you are concerned about that, you shouldn't be as far as micro controllers are concerned, because we're again talking about some very simple things. Um. You know, literally, if somebody pushes this button, then you want to do that, and
if they don't, don't do it. So you know, it's not we're not talking about lines and lines and lines of code. You're not writing a new operating system for a desktop computer. You're writing a very simple, uh set of commands to a very simple computer, right, especially since you know you've got to keep in mind, these micro controllers have very little memory on board. They can't hold lines and lines and lines of code. What were we
talking about again? Yeah? Uh. In fact, the one that that Marshall reads about in how micro controllers Work, the basic stamp. He explains that it can hold about seventy five lines of code. So you have to make sure that your program is very succinct, that it's compact, that you're not taking up lines and lines and lines to accomplish wherever the goal is. So uh, you know, by by necessity you are kept to a pretty small amount of coding, which if you are just getting into coding,
might be a great thing. It might be, you know, to teach yourself how to think in a sequential way, the way a machine processes information. I was about the way the machine thinks, but really thinking is well, it's not quite the right word thinking in quotes. We like to to say that the machine is thinking when you see the the hour glass or the spinning beach ball. But yeah, it's really just processing data. It's just it's going through whatever the data is that's coming into it
and saying, uh, what's the right response to this? I got it our glass? Yeah, Well, and and uh that's that's sort of what I was getting at. If this is, if um, you're interested in get into hacking. And I mean that in the the classical sense, not in the we're going to break into government computers and take over
the world sense. Um. You know, a micro controller. Working with a micro controller might be a good UM experiment because then it would give you something that you could physically that you could work with, UM maybe come up with your own experiment or your own UM component for doing something cool. And it doesn't require an extensive amount of programming to make it work. UM, so it might be it might be a fun project for somebody who's
just getting into programming. Yeah, so uh yeah, I would recommend anyone who is really interested in learning about programming micro controllers and what they can do go to the how micro controllers work article first of all, so that you can get a basic understanding of the way that you would design a micro controller, uh circuit really or
a component. And then you can their instructions on how to build a digital clock with a micro controller and also a digital thermometer, so that way you can actually learn different things that you can do with the same basic component um. And again, these are both very specific use cases. So your digital thermometer isn't suddenly going to be able to play pac Man, you know, it's it's again, it's a dedicated UH task that it's you know, designed for,
and that's it. So I I do recommend checking it out. It is a good way to sort of cut your teeth on on programming. Again, this one being in the Basic language, but there are of course other languages you can learn as well. That tends to be pretty easy to learn if you know anything about programming already, even if you've never used Basic before. Because it's Basic, I mean, it was the language itself was designed as a teaching tool. It wasn't necessarily intended to be a fully fledged programming
language to build out sophisticated UH software. It was meant to teach people how to think in that way so that then they could move on and graduate two more complex, more sophisticated programming languages. We did an episode about programming languages to where we kind of talked about that. Yeah. Yeah, and both Jonathan and I have fiddled around with Basic in the past, different versions of Basic. But yeah, yeah, I did Apple Basic. Yeah, I did Amiga basics. So
there you go. So that's you know that and that friends is where the split began. It was only compounded by Chris's refusal to watch the movie Jaws. He's never going to get over that. It's until I watched the movie. You just see those splits, and you know how the how the chasm widens further and further with every every episode. It's amazing we've gotten through four hundred without hitting each other.
I think we're gonna need a bigger podcast. I think we Hey, nice, nice, he's quoting something he's never seen before. It doesn't make me want to hit him at all. All right, So anyway, did you have anything else you want to say about micro controllers? Um? No, not really, but it's that's one of those unheralded things. I mean, people just don't talk about. When we talk about computers, we usually talk about those machines that we use every day.
But micro controllers are those machines that we use every day and just pick up them as being computers. They really are. Yeah, every just about every kind of electronic so you can imagine, has some form of micro controller, and it often multiple micro controllers. So yeah, very important piece of electronics, and if we did not have them and we were only relying upon microprocessors, everything would be
way more expensive or far more primitive. For example, your remote control might be the closest kid to the TV. That's what it was in my household until we got That's why I'm laughing. I remember that, turning the dial three spaces. Yeah, Paul Um never never really spoke quite like that. Yeah. Anyway, all right, so guys, if you have any suggestions for future topics that we can tackle here on this podcast, let us know. You can say us an email or address tech Stuff at Discovery dot com,
or let us know on Facebook or Twitter. Are handle there is tech stuff? H. S. W and Chris and I will talk to you again really soon for more on this and thousands of other topics because it has staff works dot com brought to you by the reinvented two thousand twelve camera. It's ready, are you
