DEV Community

Cover image for What is a Microcontroller?
Anja
Anja

Posted on

What is a Microcontroller?

Hello!

What is a microcontroller? Its like a mini personal PC, controlling features of a larger component, without an Operating System. It contains a CPU,memory and input/output devices where it can send and receive signals.

Microcontrollers also have ADCs and DACs, an ADC being a Analog to Digital Converter. It converts an analog signal, which consists of sine waves into a digital signal, denoted by square waves. The digital signal represents information as a series of binary digits (1 or 0).

If you have a 1 or 0 depends of the voltage grade and which ranges you decide to assign to which number. Most of the time 0 represents a lower voltage range than 1. If you want to play around with microcontrollers, they are quite cheap, like eg. 10 Euro. Here is some example code taken from the Arduino IDE which makes the led of the Microcontroller blink:
Alt Text

Did you work with microcontrollers yet and what did you do with them? Have a nice day. ๐Ÿ™‚

Top comments (8)

Collapse
 
gregorgonzalez profile image
Gregor Gonzalez

ohh nostalgia. I remember using it on a project in college. I still remember the pic f16877a. Just to learn we did tests with LEDs, a project with a traffic light and finally a calculator.

It was difficult because we didn't know anything and whenever we worked with hardware we broke something, even through inexperience we burned the pics, we had a cemetery of pics.

We also programmed them in C and used the Proteus emulator.

It was fun and frustrating because we started from scratch and the teacher gave us 0 information. He only dedicated himself to selling us the pieces. Then never worked with it. I stayed with web programming

Collapse
 
anja profile image
Anja

Hi Gregor! Oh that's an interesting story! ๐Ÿ˜„ I actually bought a voltmeter to make sure I don't destroy anything and then felt like the doc from back to the future. ๐Ÿ˜„ Great that you had fun anyway. ๐Ÿ˜Š

Collapse
 
gregorgonzalez profile image
Gregor Gonzalez

We only use a 5v phone charger, but when we removed the pic to program it, we made a mistake and put it either the other way around or wrong. At the first test we realized that it was not working and it was too late, this happened many times ๐Ÿคฃ

is it still in fashion? was not replaced by Arduino? ๐Ÿค”

Thread Thread
 
anja profile image
Anja

Hehe you learn with each mistake. :) I think arduino is a popular Microcontroller at least that's the one I found when looking e.g. For tutorials. I used the Elegoo though cause it was available with a set for a good price. ๐Ÿ˜Š

Collapse
 
jwschultz profile image
John Schultz • Edited

Yes! My housemate and I started a spur-of-the-moment project, using what I think was a PIC 16F84, to create a portable device that we could use as a powerup respawn timer for "Halo."

We used DIP switches to select the map, and four LEDs to correspond to the four major powerups/specialty weapons. Each LED would start blinking slowly 10 seconds before its respective powerup respawned, and switch to blinking rapidly for the last 5 seconds.

We went from idea to working prototype in 17 straight hours, and I consider it the day my college/life path switched from "humanities student taking a programming class or two" to computer science/programming, because it was the first time I was able to use programming to create something novel and useful, and it was such a rush!

Collapse
 
anja profile image
Anja

Hi John, that's such a great story! ๐Ÿคฉ And yes it's always an awesome feeling to create something useful especially when you have to put in quite some time and succeed after all the hurdles. ๐ŸŽ‰ I'm glad you have found your passion with it! ๐Ÿ˜Š

Collapse
 
sjarva profile image
Senja Jarva

Yes, I've worked with micro controllers before when building e-textiles (electronic textiles)! They're fun and surprisingly small for such powerful devices! :)

Collapse
 
anja profile image
Anja

Hey, that's great! ๐Ÿ˜Š What is your favorite e textile capable of? ๐Ÿ‘•