Categories
Uncategorized

What is an Embedded System and what does Arduino have to do with it?

An Embedded Computer System is a small computer that is “embedded” inside something else. Unlike a laptop computer, or a desktop, or a server, its primary purpose isn’t processing data, but it is meant to control some aspect(s) of the “thing” it’s embedded into. You probably don’t think of your clothes washing machine as a computer, but if it was built in the last 10 years, it almost certainly has an embedded computer controlling it. Likewise, the car or bus that takes you to work has dozens of embedded computers doing tasks as complex as sequencing the operation of the engine, or as basic as raising and lowering the windows.

How big are they?

A typical mainstream CPU (Central Processing Unit: the heart of the computer) such as an AMD Ryzen runs at a clock speed of almost 4GHz, requires more than 65W of power and has over 900 pins for external connections.

By contrast, the majority of embedded systems are based on microcontrollers. A microcontroller is a single package that houses a CPU, perhaps a basic clock source, some RAM memory to hold data and Flash storage for the program that it will execute, and peripherals that can read inputs like switches and pushbuttons, measure temperatures and voltages, and control output devices.

A basic AVR Mega microcontroller that might be found controlling the functions in your washer will run on substantially less than 1W of power, has a nominal clock speed of 8Mhz (but can run much slower to save power) and might require fewer than 20 pins to control such things as water flow, agitator cycling or spinning at the end of cycle. The microcontroller in your toothbrush might only have 6 pins and could run for years on a single AAA cell if necessary.

At the other end of the spectrum, more modern 32-bit microcontrollers have 1M+ of Flash memory and 256kb of RAM. Some microcontrollers can access external memory , further expanding their usefulness.

Why use them?

The benefit that an embedded system has over using logic “chip” to do their operations as was more popular in the past is primarily that a single low-cost chip can replace potentially dozens of external chips, thereby saving space, power and, of course, money. Additionally, a manufacturer may base a number of their products on a single microcontroller type, thereby saving on inventory costs and training. Since microcontrollers are computers at their heart, they can be reprogrammed to perform functions specific to the product they are embedded into.

Where does Arduino come in?

The Arduino is a basic microcontroller platform that was initially intended to offer artists and hobbyists a simple way to get involved in embedded systems. It has expanded from its basic roots to become a huge Open Source ecosystem of programming tools, libraries that make it easy to program unique functionality and add-on hardware that offers motion control, temperature and humidity measurement, multicolor LED displays, sophisticated graphics and so on.

Arduino continues to be a great way to get your feet wet in programming embedded systems.




If you'd like to subscribe to this blog, please click here.

Categories
Arduino control

Make your prop move

You build this really cool prop. After days, weeks, months of work, it’s done. Just one more thing: it would be so cool if that little bit on top could rotate. But how do you do that? You know motors make things move but you don’t know the first thing about motors. That’s where I come in: I know a fair amount of motors (but I don’t know a whole lot about building great-looking props…).

OK, now what?

To make something move, we need a motor. Here’s a simple one to get started with.

OK, that’s actually two motors. They’re pretty cheap, so why just get one? I’m not going to post links since they’ll be outdated in seconds, but you can generally find these motors for under $5.00 each all over the web. Search “small gearmotor” and you’ll get tons of hits. These are DC gearmotors. “DC” refers to the fact that they run on Direct Current, such as what you get from a battery, as opposed to AC which is what comes from a wall outlet. A gearmotor is a type of motor that contains a gearbox. Normally, motors spin at pretty high speeds: thousands of rotations per minute(RPMs). With the embedded gearbox, we get a more useful rotation rate that’s generally between 15-100 RPM. Slower or faster speeds are available. The ones above has two output shafts that provide around 140 RPM.

OK. I’ll post one link: these guys will probably be selling them for a while

Now, any motor needs a power source. The sample ones above are small enough that they can be battery powered. Three AA’s will run them for quite a while.

An important feature of DC motors is that their speed depends on the voltage you give them. If you run these from four AA’s they will run faster than if you ran them from two. Normally, they take 4.5 Volts, which is what you would get from the three AA’s mentioned above. If you want them to run all the time, or just don’t want to be bothered replacing batteries, you can also run them from a 5V “wall wart” power supply.

Once we have the motor and a power source, it might be nice to have an easy way to control it. This is where a switch comes in. It completes or breaks the circuit between motor and power and so turns the motor on or off.

So let’s put this all together. You know what this needs? A drawing. Drawings that electrical engineers use to show connections are called schematic diagrams. Here’s what it looks like.

As you can see there are the three elements we talked about: the battery for power supply, a motor, and a switch to turn it on and off. Look at the symbol for a switch: it shows that the contacts (1&2) are not touching. This means that the circuit is incomplete and current will not flow. When the switch is closed by pushing the shiny arm on top, those contacts will touch and complete the circuit, causing current to flow through the motor and making it move.

Enough for now? Next time we’ll wire up actual components and see how that goes.




If you'd like to subscribe to this blog, please click here.