Did your MakeCrate just arrive in the mail? Looking for all the resources you’ll need to build your circuit and write code to get it running? Check out our project introduction pages for a list of the resources you’ll need for each project.
MakeCrate subscribers should login to have full access to all content.
- Starter Crate
- Nightlight Crate
- Soil Moisture Monitoring Crate
- Calculator Crate
- Digital Ruler Crate
- Musical Instrument Crate
- Heart Rate Monitor Crate
- Digital Clock Crate
- Memory Game Crate
- Remote Alarm Crate
- Stopwatch Crate
- IR Remote Stepper Motor Crate
Looking for a non-subscription kit? Login with the email you used to purchase the kit, and find your resources at the following links.
Drive a circuit with a button to light up LEDs and turn on a buzzer. Learn to code it with the AE machines drag and drop editor and this tutorial:
Add two LEDs and a buzzer to your Arduino and code it using the AE Machines drag and drop interface. Watch the tutorial here:
Use the AE Machines drag and drop interface to learn to make an LED blink. Watch the tutorial here:
Now you can code your MakeCrate projects using the drag and drop interface from AE Machines. The interface is easy and fun to use, and allows you to make changes to your projects and quickly see the results.
Watch this tutorial to see how to get started using the interface.
Need to install the pt.h file to make things work? Get the file here (pt) and follow these steps to install in the web editor:
- Open the web editor and click the “Libraries” link on the left hand side/
- Click the “import” icon to the right of the “Library Manager” link.
- Find and select the pt.zip file you just downloaded from the link above.
- Wait while the file imports! You should now be able to include the pt.h file.
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!
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.