The Junferno channel is often compared to other non-Junferno channels here on the internet.
Undoubtedly due to my charismatic expressive internet personality. However flattering though,
I do hope that I'm retaining some originality, though as they say: if you can't beat 'em, give
up. And so why not just talk about what's popular? That's right: let's talk about microcontrollers.
A microcontroller is a controller that is micro, and they actually
are quite popular on the internet. They're up there with V-Tubers and bullying. And
that's probably because microcontrollers are everywhere: look at the device that you're
using to watch this video right now. That is not a microcontroller. But it is a computer. Of course,
the computer that you're using personally is not necessarily a personal computer or PC.
It could be a phone or a tablet or a television for some reason or any other device that can run
a YouTube client. What makes a computer a computer is that it computes and to do this
you'd conventionally at least need a processor, memory, as well as input and output. For example,
on the computer that you're using right now, if you use your mouse or touchscreen or television
remote to input a click on the "subscribe" button, then your processor will process
that request and perhaps store some variable in your memory representing a subscription
and in turn the screen connected to your computer will output a notification every three months
if I feel like it. Now, this example of a computer is an example of a general purpose
computer; you're not only using your PC or phone for watching videos - you'll probably also use
it for being productive and socializing with your many friends. It's not exactly a super computer,
but it needs enough computational power to run an operating system that does all these
things. But not everything that computes needs to be general purpose. Your microwave doesn't
need Windows 11 to heat up your silverware. And so, for relatively simple or specific
tasks, maybe we just need a computer that is smaller: a controller that is micro perhaps.
When it comes to machines with specific purposes, like microwaves, automobiles, tasers, taser...
roombas, it's all about efficiency. And also actually working. But efficiency matters as
well. The Arduino Uno is a fairly popular circuit board presenting to my desk. Arduino meaning the
company, and Uno meaning first: the Arduino Uno is like the 9th or 13th Arduino. As expected,
the Arduino Uno has a processor which is an 8-bit CPU that it can use to run programs. It
also has memory pools such as SRAM to read and write data while the programs are running as
well as EEPROM to read and write long term data. It's worth pointing out that there's actually a
third piece of memory called the flash memory which is where the actual program is stored
and loaded from so the processor can run it, and since it only needs to run one program,
this is sufficient. Note that in combination with a few pins of different types of input and output,
the Arduino has all the parts to be considered to be a small computer. And so with all of that,
if we just attach a few peripherals to our microcontroller we can make a very simple robot.
Except we can't, because it's hard and I'm not a hardware developer, but also because
the Arduino is not the microcontroller. Everything I've described up to this point
has actually been the ATmega328P which is indeed an 8-bit microcontroller with SRAM,
EEPROM, and flash memory, but a microcontroller isn't just any small computer. It is in fact
a small computer that exists on a single chip. This makes engineering a bit more
difficult with a lot of wiring going on: one of these difficulties being actually connecting
this standalone chip to your PC in order to burn programs into the flash. The ATmega328P
microcontroller is actually included as part of the Arduino Uno as well as several other Arduino
boards. It's right here next to the "Made in Italy" label or if you're looking at a Chinese
knockoff, next to the "Made in Italy" label. The Arduino is thus a development platform for the
microcontroller; your average electronic appliance would probably just use a microcontroller as it
doesn't need an entire Arduino. But for the amateur developer, the Arduino provides all
the boring setup stuff you would have had to do to do development already set up.
The Arduino board connects the microcontroller to a system of components. On the Uno, this includes
a voltage regulator, some rows of input/output pins, and a USB port. Through the USB port,
we can connect our Arduino to our PC to transfer over a program that can be burnt into the flash.
On the software side, or on the PC, this program is called a sketch. Wow this is just
like sketching. But it's really just a C++ file that uses Arduino's libraries. In the sketch,
we can read the input, write the output, and determine all the logic that we do with them,
and on the board we just have to wire on our input and output peripherals - allowing us to just do
these two things without having to worry about all the stuff that goes on between them. And hence,
hardware engineers can pretend like they know how software works and software engineers can pretend
like they know how anything works. Arduino is not the only development board though;
there are many others with their own microcontrollers and features,
though a large portion of them are based on or at least compatible with the Arduino,
such as Freedrino, Seeeduino, Bambino, Ardweeny. All very traditional Italian names. Thus,
with all these development boards and the popularity of Arduino's simplicity,
microcontroller prototyping became a common hobby. Regardless, even though boards such as the Arduino
remove the challenge of connecting the software to the hardware, engineering these two elements
on either end can still be challenging. Once the sketch is uploaded, the microcontroller knows
to just keep on looping whatever is in the loop function until it gets manually terminated. And
so, it makes sense to make something that has a sensor and keeps on checking that sensor and then
does something when that sensor senses something. But that's enough of the introduction, time to...
Up until now, the example used has been a motion sensor connected to a servo motor. However,
this example is purely demonstrative - both of the peripherals are rather weak and the whole
thing doesn't really do anything to begin with. The stepper motor is another type of motor that
rotates in steps. Now, generally speaking, stepper motors don't necessarily have higher torque than
servo motors - especially as you increase the speed of rotation. But this particular stepper
motor, which is meant for 3d printers, has a higher torque than this particular hobbyist
servo motor just on account of being a more expensive higher quality model. In physics,
torque is the product of radius and force and with a fixed radius it's just something that's directly
proportional to the force though all of these are just made up words that mean how strong something
is spinning and we can consider it to just be that - engineering after all is just simplified
physics. Now to connect this motor to our Arduino is more complicated but only slightly,
we have to connect it to a chip called the driver which helps us control the motor
as well as a higher voltage power source. If we don't use a higher voltage power source,
then the motor just vibrates without rotating but we can still do things like this.
[Tune of Bad Apple!! plays]
Now, even once we've gotten the motor to start spinning as we understand these concepts of
torque and force, we still have to apply these fundamentals into something that does
something - physics after all is just simplified engineering. Now, any respectable legitimate
mechanical engineer would probably use some sort of modeling software to model and then print out
some sort of mechanism that can be perfectly fitted to the motor and optimize motion. I
taped a flyswatter to it. And all that's left to do is to write the remaining parts of the program:
including the part in which we hurt ourselves in some comical way as well as actually process the
input. For simplicity, we can just use software as our input. Here is a program that just checks
whenever I click like on a Tweet on Twitter that just takes a few seconds to make. And we can send
that input to our microcontroller through our serial USB port. Welp, time to browse Twitter.
Well I guess I'll just stick to software. But hey, at least I can go back to being original.