Posted on

What is a microcontroller?

All of our MakeCrate electronics subscription kits use an Arduino microcontroller as well as a variety of digital and analog sensors and displays to create nightlights, calculators, room alarms, and more. Because the microcontroller is a fundamental part of every project, let’s take a  look at exactly what a microcontroller is and where they are used.

What is a microcontroller?

A microcontroller is a small, single-chip computer used to connect to and control another device.  A typical microcontroller consists of some or all of these parts:

  • Central processing unit (CPU): The CPU is the brains of the microcontroller.  Its job is to find the instructions in memory  and decode them to make them usable by the microcontroller.
  • Memory:  the microcontroller instructions as well as variables and their changing values get stored in memory and accessed by the CPU when needed.
  • Ports:  Microcontrollers generally have both input and output ports where devices like sensors, LEDs, and displays can be attached.
  • Timers and Counters: Most microcontrollers have built in timers that provide clock functionality and can control the timing of internal and external events, like the length of time an LED blinks.
  • Interrupt Controls:  microcontrollers have systems called interrupt controllers in place that allow the CPU to check which devices might need attention while another program is executing. 
  • Analog to digital converters: a microcontroller’s analog to digital converter allows it to take analog data, like temperatures or light readings, and convert them to digital values that the CPU can handle. (See https://learn.sparkfun.com/tutorials/analog-vs-digital for an explanation of analog vs digital.)
  • Digital  to analog converters:  Similarly, digital info from the microcontroller may need conversion to run an analog device like a DC motor, so microcontrollers have converters to perform this function.

 

Where are microcontrollers used?

Microcontrollers are used in many electronics devices today including devices that measure, store, calculate, or display information.  Some places you are likely to come across a microcontroller on a daily basis are:

  • In your kitchen, running the timer in your microwave or controlling the temperature in your oven or refrigerator.
  • In your living room, controlling your tv.
  • On your phone, to control the touchscreen.
  • In your car.  Most modern cars contain at least 25 different microcontrollers!
Posted on

How does an ultrasonic sensor work?

Learn the science and math behind an ultrasonic sensor.

Transcript: 

An ultrasonic sensor can be used to calculate how far away an object is. These sensors can be used to determine things like how far your car is from a wall, or whether or not your water bottle is in the correct place for a water fountain to fill it.

Let’s take a look at how they work.

The sensors are called “ultrasonic” because they emit a rapid series of clicks that are too high for humans to hear.

The noise bounces off an object in front of the sensor and echos back to the sensor.  This is very similar to how a bat navigates as it flies!

The  sensor can detect how quickly the sound returns to it, and that time can be used to calculate the distance. Let’s take a  look at the math.

Sound travels at about 344 meters per second.  

There are 100 centimeters in a meter.  

There are 1 million microseconds in a second.  

So 344 m/s *1s/1,000,000 ms *100cm/1m = 34400/1,000,000 cm/ms =344/10,000 cm/ms

Looking at a specific example, if the sound takes 2000 mcs to return (that’s 2/1000 of a second), then we know it took 1000 mcs to travel out and the same to travel back.  So 2000 mcs x ½ for the distance out but not back x 344 over 10,000 cm/ms equals 34.4 cm away.

More generally speaking, we get the formal time x ½ x .0344 = distance, where time is measured in microseconds and distance is measured in centimeters.

That is how you can use an ultrasonic sensor to calculate distance.  

Posted on

How does a photoresistor work?

Learn about the properties of semiconductors that allow photoresistors to work.
Transcript:
Let’s take a look at how a photoresistor works.

A resistor is an electronic component that reduces the amount of current flowing through a circuit.  A variable resistor is one whose resistance varies depending on some condition.  A photoresistor is a variable resistor that’s resistance changes depending on the amount of light it is exposed to. A photoresistor is made of a highly resistant semi-conductor material.  

As a reminder, materials can be categorized in three ways, depending on their ability to conduct electricity.  The electrons within an insulator cannot move freely within the structure, so electricity does not flow through them. In a conductor, electrons move freely allowing for free-flowing electricity. Semiconductors fall somewhere in between.  

Let’s dive in a little to what happens within a semiconductor material to regulate the flow of electricity.

Within a semiconductor, the electrons have varying energy levels, and they arrange themselves so that similar energy levels are near each other.  These levels are called energy bands.  

The valence band is the level with the lowest energy, where electrons move the least freely.  The conduction band has the highest energy and allows for the free movement of electricity. These bands are separated by an area called the energy gap. The resistance of the semiconductor depends on the amount of electrons available in the conduction band to carry electricity.  

When light hits the photoresistor, the photons from the light excite the electrons in the valence band, increasing their energy levels and allowing them to cross the energy gap to the conduction band.  Because more electrons are then available to conduct electricity the resistance of the photoresistor drops.  

The changes in resistance can be measured and used to drive other electronic components.  For instance, as a room grows darkers, a photoresistor can be used to turn a light on.

Posted on

How does a buzzer work?

 
Curious what is happening inside a buzzer? Check out this video.

Transcript:

Buzzers can be both fun and useful in electric circuits.We’ll use them a lot in MakeCrate projects, so let’s take a look at what is going on inside a buzzer to produce sound.

The buzzer consists of an outside case with two pins to attach it to power and ground.

Inside is a piezo element, which consists of a central ceramic disc surrounded by a metal (often bronze)vibration disc.

When current is applied to the buzzer it causes the ceramic disk to contract or expand. Changing the  This then causes the surrounding disc to vibrate.  That’s the sound that you hear.  By changing the frequency of the buzzer, the speed of the vibrations changes, which changes the pitch of the resulting sound.

Posted on

How does a breadboard work?

How does a breadboard work?

The breadboard is a key part of every MakeCrate project. Let’s take a look at why we use them, why they are called breadboards, and how they work.

Why use a breadboard?

The type of breadboards we use are called solderless breadboards. Soldering is a process that connects two pieces of metal by putting a filler metal – called solder- in the joint and melting it. It takes some skill to do, and it makes the items you’ve connected stay together permanently. Because we want to be able to experiment and reuse our components, and because good soldering takes some skill, we use a breadboard to build a prototype– a working circuit that we can easily change around or take apart.

Why is it called a breadboard?

Early radio circuits were made from bare copper wires tacked to wooden boards- sometimes the same boards that were used from slicing bread! While the technology has evolved, the name stuck.

How does it work?
By now you may have seen that if you don’t line things up exactly right on the breadboard, your circuits won’t work properly. Let’s take a look at what is going on inside the board to understand why that happens.

The central part of the breadboard consists of a lot of small rows of metal called terminal strips. These correspond to the numbered rows on the front of the breadboard.

Each terminal strip contains a small clip that holds any wires or component legs inserted into it.

Because the metal clip is conductive, the strips allow current to flow to any component contained in the clip. Because the plastic around the clip is an insulator, the electricity cannot flow to any component contained outside the clip (See our article on LEDs for a review of conductors and insulators.)

You can see that the breadboard has two long rows of metal running the length of the board. These are called the power rails of the board. These allow us to provide power to the entire board, since we may need to power a number of components in a number of different terminal strips. By connecting the power rails to power or ground, and then connecting the terminal strips to the power rails, we can power each row separately.

For a more in-depth look at breadboards, check out this article.

Posted on

How do I know what level of resistance my resistor has?

How do I know what level resistance my resistor has?

Through hole resistors like the ones in your projects have a series of bands on them that indicate how much resistance they provide. A resistor chart like the one below helps to decode the bands:1smu1d5req1savus.png

For example, let’s take a 4-band resistor that has red, red, brown and gold bands. bou9ud5m8rbn5ccu.png

Each red band corresponds to a value of 2, so we start with 22. The third band is the multiplier. In this case, brown means multiply by 10. Se we have 22 x 10, or 220 ohms.

The gold band is the tolerance. Gold means 5% tolerance. Since 5% of 220 is 11, we know the actual resistance of this resistor is between 209 and 231 ohms.

Now let’s try a 5 band resistor with brown, black, black, brown, and gold bands. gwm14osh4g3q1i2h.png

Here brown is 1 and black is 0, so we have 100. The fourth band is our multiplier, and brown means multiply by 10. So we have 100 x 10, or 1000 Ohms. This is typically written as 1K ohms, where K = 1000. Again we have 5% tolerance, so the actual resistance is between 950 and 1050 ohms.

We’ll discuss in a future post how to determine the level of resistance that is needed for a component in a circuit, but for now you can just follow your project instructions to find the right one.

Posted on

How does a resistor work?

How does a resistor work?

Many of your MakeCrate projects call for resistors of various strengths in the circuits, so you may be wondering what a resistor does, how they work, and what happens if you leave them out.

Our article “How does an LED Work?”  introduced the concept of a conductor– a material that easily carries electricity- and an insulator– one that prohibits the flow of electricity. Different materials can conduct electricity more easily than others. Sometimes we want to reduce the flow of electricity, and introducing materials that slow down the flow can help with this. This is where resistors come in.

Let’s start with some vocabulary:

Electricity is the flow of electrons, which are negatively charged particles.

Voltage is the difference in charge between two points in a circuit. Voltage is also theforce of an electrical current.

Current measures how fast the electrons are flowing.

A simple way to understand the difference between voltage and current is to think of a tank of water draining through a hose attached to a hole in the bottom. Here, the water is acting like the flow of electricity. The voltage is the amount of water pressure, and the current is how fast the water flows.

 

Resistance measures a materials ability to resist the flow of electrons through it.

If the width of the hose at the bottom remains the same, then by adding more water to the tank, the water through the hose flows faster. Similarly, adding more voltage to a circuit increases the current.

However, if the hose is replaced by a smaller hose, the same amount of water pressure produces a slower flow of water. The size of the hose provides resistance, and reduces the current. A resistor in a circuit plays the same role, reducing the current through the components they are used with.

How do resistors resist?

The resistors in MakeCrate projects are through-hole resistors, designed with two flexible ends for bending and inserting in a breadboard. The core of the resistor is made of a helix, or spiral, of conductive material wrapped around an insulating core. The material is very, very thin, which forces the current to slow down to pass through, providing resistance. To increase the amount of resistance, the number of loops in the spiral can be increased.

(image courtesy of http://electronics.stackexchange.com/questions/17826/whats-inside-a-resistor)

What happens if I don’t use a resistor?

If the current through a component is too much for the component to handle, it can overheat the component and possible damage it, or it could cause damage to your microcontroller (Arduino). LEDs will burn out quickly if not used with proper resistance.

If you want to safely see a the effect a resistor can have on a circuit, build a circuit like in your “Make Some Noise” project, but instead of connecting the buzzer to ground with a wire, use a resistor. You’ll see that the reduced current causes the buzzer to be much quieter.

To learn how to tell what resistance a particular resistor has, see the post here.

For more info about resistors, check out this article from the web.

Posted on

How does an LED work?

Light-emitting diodes – commonly called LEDs– are found in several your MakeCrate projects. They come in a range of colors, sizes, and intensities. Our directions and videos emphasize that the LEDs must always be connected in the correct direction, and if you reverse one in a circuit, you’ll see that it no longer works. Let’s look at what is going on inside and LED that makes it work like that.

First, we’ll start with some vocabulary.

A diode is an electrical device that allows for the current to move through it in one direction.

A semiconductor is a material that allows electricity to pass through it partly. This is different than a conductor, which allows electricity to flow freely, and aninsulator, which allows almost no electricity to pass through.

So, an LED is a diode that contains two types of semiconductor material inside. On one side, there is p-type material, which contains positively charged particles called “holes”. On the other side, there is n-type material, which contains extra electrons, which are negatively charged.

When an LED is inserted into a circuit, it must be done so that the side containing the n-type material is on the negative side of the circuit while the p-type material must be on the positive side.

When electric current flows through the circuit, the electrons from the n-type material and the holes from the p-type material can move towards the other side of the material.

Once the holes and electrons are in motion, they begin to interact, and this interaction causes the release of energy as photons, which we see as light.

The types of material in the semiconductor determine what color light the LED emits.

Got questions? Post them in the comments below.