Category Archives: Tools

Relays

How to Use Relays

About: Relays are on and off switches for electronics.

Why are they significant? Higher powered circuits can ruin lower powered components. For example, powering a large motor with an Arduino board will not end well for the Arduino. The relay allows higher powered components to interact with lower powered components without the risk of damage.

Prerequisites: Before following these instructions, you should know about open and closed circuits. You should also be able to understand a basic electrical schematic.

Introduction to the pins:

Input pins:

  • VCC – this pin should be connected to +5v at all times
  • GND – this pin should be connected to ground at all times
  • IN – this pin switches on and off in the relay.

– If it receives 0v, the relay is in its normal state.

– If it receives +5v, it is not in its normal state.

– IN is sometimes called “Digital Pin” or just “D.”

Output pins:

  • COM – this pin will always be used in a circuit; it is the pin that is measured from.

–     NC       – (Normally Closed) this pin closes circuit with COM when relay is in it’s normal state.

  • NO – (Normally Open) this pin forms an open circuit with COM when the relay.

 

Examples of use:

Let’s say you have a gigantic light bulb (or any electronic component that uses a lot of power) and you need to be able to switch it on and off with an Arduino. The big light bulb needs a big battery to power it, but that amount of power would burn the Arduino to a crisp. The solution is to use a relay.

As you can see, the +5v pin on the Arduino is attached to the VCC pin on the relay and the GND pin on the Arduino is connected to the GND pin on the relay. The IN pin on the relay is connected to the digital pin on the Arduino that will control the circuit.

Because Circuit 2 is connected to the NC pin, the circuit will be closed and the lightbulb will be on when the digital pin on the Arduino is off (the “normal” state). The lightbulb will be off when the digital pin on the Arduino is on. If it was connected to the NO pin, the opposite would happen.

Testing a relay:

To test your relay, use the blink sketch. Attach VCC to +5v, GND to ground, and IN to whichever pin is blinking (13, usually). If you hear the relay clicking on and off every second, you are good to go!

Advice:

  • If your relay stops working with your program, always go back to the blink sketch. If that sketch works then there must be something wrong with your program.
  • Instead of plugging VCC, GND, and IN pin using male wires, you can put all three of those pins into the three male wires on the arduino board usually located right next to the digital pins. Just make sure everything is lined up correctly.

External help:

Here’s just a list of resources which may help you with relays.

Ordering relays:

Here is the type of relay we used:

http://www.amazon.com/dp/B009T2M012/ref=sr_ph?ie=UTF8&qid=1433769066&sr=1&keywords=relays

If you don’t get that exact type, try to find something similar—nothing too fancy is necessary.

Also you can either get a single relay per unit or dual relay module (same thing except 2 relays are there per unit)

Happy relaying!

By, Jeremy Costin, Nathaniel Rosenbloom and Amber Zedeck

-Class of 2017

MIT App inventor and creator

I learned how to use MIT’s App Inventor this year in order to create an app for my product, On Track. The app inventor software is a free user-friendly interface that allows you to create an Android-accessible app with various functions including user interface, layout, media, drawing and animation, sensor, social and connectivity options (all to be found under the palette list on the left side of the website). For our specific project, we needed a way for users to see how many seats were available on a certain car on a train. app inventor allowed us to create an app that would let the user select the train stations they were departing from and arriving to, the time of the train they are riding on and then based on those selections, determine which car has what number of available seats.

I think the beauty of this interface is it is really easy to pick up, especially with the help of tutorials. I highly recommend watching the tutorials to familiarize yourself with the basic uses for app inventor. The first one I watched, (http://www.youtube.com/embed/Vdo8UdkgDD8?autoplay=1) was dealing with a Text-To-Speech component. All of the basic tutorials can be found here: http://appinventor.mit.edu/explore/ai2/beginner-videos.html. At first I found them quite tedious (the people who teach the tutorials are very annoying), and I felt like it was a waste of time to be checking out all of these random mechanisms, but once I got to building my own app, I found that the logic skills and the understanding of what the various components are good for that I learned from these videos to be incredibly vital. So, my biggest recommendation is to play around with a bunch of components, see what works and what doesn’t, and then morph the stuff that you figure out to fit your own personal app and meet your requirements. The app I ended up creating only really used buttons, lists and images (all of these options can be found under the user interface tab under palette), but, if I do say myself, it still looked very professional and met our functionality requirement, which leads me to my next piece of advice: keep it simple. If the logic behind a particular component gets confusing, use the very simple buttons and pictures to replicate what your fully functioning app would look like. In all fairness, our app wasn’t perfectly functional in that it didn’t connect to the train car that we built, but it was a mock app that got the intention of our app across to the VC, and with the simplicity of the mechanisms we used, it seemed to perfectly functional.

I hope this was helpful! Keep coding!

 

Maddie Burton

Class of 2017

Arduino Real Time Clock

This year, I spent much of my time programming and wiring the Arduino Real Time Clock (RTC) This Arduino is a microcontroller, a small computer that, depending on what you connect to the Arduino board and what code you upload to it, can blink a light, display something on a screen or even sense your location.The RTC allows the Arduino to keep accurate time, allowing it to display a timer, the current time, and it can keep time so the Arduino can do something at a specific time. Originally, I thought that we were just going to use the RTC to show the current time and that we were going to use a different method, the Arduino “CountUpDownTimer” library to display a stopwatch. Getting the RTC to show the current time only took a few weeks. Here’s a great Adafruit tutorial that I used. However, there are a few issues with the code it gives you. You must make every mention of “rtc” lowercase. I did not realize how case-sensitive coding was. The other important thing is to make sure to uncomment this line “RTC.adjust(DateTime(__DATE__, __TIME__));”.   That line is crucial, as it is what allows the Arduino to display the accurate current time. When I started using the RTC, I did not realize that it could be used as a timer as well as a clock. I wasted three months using the CountUpDownTimer library, and it never worked well. Here is the library for the RTC that I used. In order to write a code for the timer, I had to learn about reading a header file and how to understand the different types of commands that you can use in the code. I also learned that it causes horrible lags to have the RTC update seconds for three timers at once. When I tried doing that, all of the timers were running on a three second delay. Another lesson that I learned is that it is very difficult to use the RTC with the LCD_I2C because they require the same pins. It is easier to wire the LCD the long way, so you can decide what pins it will use. Perhaps the most important lesson I learned through this process is that you MUST NOT wire the Arduino while it is being powered. When I did this by accident, electrostatic discharge occurred and I ended up with a lovely red bump on my thumb for a few weeks after shocking myself by touching the RTC while wiring it.

–By Marc Szechter Class of 2018

Drilling (using both the Drill Press and the handheld drill)

Drilling is a simple yet incredibly important fabrication technique. Basically, it creates a hole where you need a hole. This is useful for attaching materials via screws, string/rope, zip ties, and other connections. In our fabrication-centric product, we need to affix many different components together. Drilling was crucial for our use of screws in the chassis, PVC frame, and wooden enclosure. We also drilled holes in the rubber belt to sew the two ends together.

Much of our learning of drilling was hands on or learning through experience. That being said, it is critical to take safety precautions before diving in. These include ALWAYS wearing safety glasses even though they aren’t always comfortable or may not go with your outfit and even if you are just watching you should also be wearing safety glasses as well. Drilling produces lots of scrap material, such as dust and shards, which would hurt quite a bit if they landed in your eyes. Also, tie back any long hair so as to avoid a painful makeover. Lastly, ask Dr. Aviv for the machine key, if you are using the drill press.

I always prefer to use the drill press when available, as it is steadier and easier to use. However, if the material does not fit onto the drill press’s table (platform with hole), you will have to use a handheld drill. The first step for both drills is figure out what size hole you need and find the corresponding drill bit. Attach the bit to the drill head by loosening then tightening the chuck (jaws). Make sure the bit is directly centered– if it isn’t, you won’t be able to drill a perfectly circular hole. Next, mark the area you want to drill with a pencil, marker, paint, etc.

If you are using the press, clamp the material to the table using a spring clamp or a vise, lining up the mark with the bit (this is really important because if it is not lined up then you will drill the hole in the wrong place). If the material cannot be clamped, have a friend carefully hold the ends, keeping their fingers clear of the bit. Turn on the drill and slowly lower the bit through the material. Once you have drilled through, keep the power on and raise the bit out of the hole slowly to help remove any debris. If you are using the handheld drill, clamp the material to a worktable in the same fashion, but make sure you won’t drill into the table itself. Turn on the drill and push the bit into the material, slowly but with firm pressure. Once you had drilled through, keep the drill bit spinning as you pull it out to clean the hole of debris. With both types of drills, keep a vacuum handy in order to deal with the any of the remaining debris (including dust) One of the most important things to remember is never try to drill something that isn’t clamped or held down to the table. Also, you must lower the bit into a material; it cannot start out inside of it. Here’s a fun anecdote about what happens if you don’t follow these simple guidelines: We had already drilled a hole in a piece of wood but wanted to make it cleaner. So I put the bit through the previously drilled hole, held the wood, and turned on the drill press. The piece of wood spun right out of my hands, cutting my fingers in the process of becoming a dangerous wooden saw of pain. Moral of the story is to always line up the bit and lower it through the material.

Here are a couple of helpful websites to use if you want to do more research on how to drill:

http://www.bobvila.com/articles/2123-operating-a-drill-press/#.V09eCpMrKmE

http://www.diynetwork.com/how-to/skills-and-know-how/tools/how-to-use-a-drill-press

http://www.planitdiy.com/how-to/garage-workshop/how-to-drill-holes/

 

Written by Benjy Robinov Class of 2017

Radio Frequency: Transmitter and Receiver

Radio Frequency: The Basics

Transmitter and Receiver: Two devices that are wired and programmed – a transmitter can be wired and programmed to send information to a receiver

Uses: communication between two devices – sending information from one device to another

Ex: Actual radios

How it applied to my project:

From the start of working on my project, I knew that I would need some way for two devices to communicate with each other, as my project was a device that enabled soldiers to both manually send alerts to local command centers with the push of a button and automatically send alerts, their location and their heart rate when their heart rate became dangerously high or low. Radio frequency seemed to be a good avenue through which to achieve this communication because not only did it appear to be a reliable way to send information from one device to another, but the range over which it could send this information was higher than alternative communication devices, and it was cheaper than other devices.

 

Successes Failures
Wired and programmed radio frequency to work with pushbutton to send an alert from the device with the transmitter to the serial monitor of the device with the receiver.

 

 

We were unable to get the radio frequency to work with a GPS to reliably send the location of the device with the transmitter to the device with the receiver.

At certain points, the radio frequency worked to send this information, but it was not consistent enough for our project.

Advice:

Though this is a cheap option when it comes to getting two devices to communicate with each other, it is not reliable. Look into other options before dedicating a significant amount of time to becoming familiar with this technology. Other good options include Wifi or X-bee, a similar form of communication (what I ultimately used for my project). If you do end up using radio frequency and you find that it is not working after some time, move on. The devices can be vey faulty, so do not waste too much time trying to get them to work.

 

How I learned how to use this:

When I first started using the radio frequency transmitter and receiver, I knew nothing about it. I did some online research to get a basic understanding of how they work. The CIJE Biomedical Engineering Textbook was a great resource/starting place to learn how to wire and program these devices. I relied on that as a foundation, and ultimately tweaked the wiring and code to fit my product’s need as I went along. Ms. Smith was also a great resource; she was very knowledgeable about how radio frequency works, and I learned a lot by working with her.

 

Helpful Links:

CIJE Biomedical Engineering Textbook

Radio Frequency Power Point

Information for Sparkfun Model

screen-shot-2016-11-22-at-8-37-13-am

 

written by Lulu Wein Class of 2017

Electret Microphone Amplifier – MAX4466 with Adjustable Gain

 

The adafruit Electret Microphone Amplifier is an amplifier attached to a sound sensor which can be used to record audio, change voices, and any sound reactive projects like mine. These small amplifiers were perfect because they do not take up much space in the project but they are able to do a lot. They can adjust the amount of sound input and output to a voltage that the Arduino can detect. I did a lot of research regarding these sensors and learned how to adjust the volume and use them for sound reactive devices. The first step is to solder the header pins that come with the sensor to the OUT, GND, and VCC breakout pins. If you need help soldering refer to the soldering How-to on the website : http://etoolbox.org/tools/soldering-2/ . ‎Edit When soldering, be very careful not to leave the soldering iron on the metal for too long because to avoid frying the board. Once it has cooled, use wires to connect the sensor to an Arduino board: GND to ground, VCC to the VCC pin (2.4-5V), and OUT to an analog pin. On the back of the board is a small trick pot (labeled below). Use a screwdriver to gently turn it to adjust the gain based on how loud the sounds you are inputing are. If you don’t adjust the gain, the sound wave could clip, altering your results. When I was doing this, I had to play around with the gain for a few classes before I finally found the perfect setting. If you are using multiple sensors, not all of them will work on the same setting, they will probably need to be turned different amounts. This is all of the hardware you need to set up before beginning your code.

 

screen-shot-2016-11-18-at-10-57-11-am

When writing your code, keep in mind that the sound is measured through the analog pins, so it is a sound wave. When a loud sound is sensed, the Arduino will read either a very high or very low value from 0-1023. If you are making an audio reactive project, you must write in the code that when a loud sound is sensed, some other component will complete an action. For example, if you wanted to turn an LED on when a sound is sensed:

if (sensorValue < 300 || sensorValue>700)         // If sound wave is at its extremes (loud sound)

{

digitalWrite (RedLED, HIGH); // Turn red LED on

}

 

The most important thing is to keep trying and never give up! Be fearless!!

GOOD LUCK!!!!!

Written by Tamar Kellner Class of 2018

Soldering

Soldering is a process in which two or more metal items are joined together by melting and then flowing a filler metal into the joint—the filler metal having a relatively low melting point.

Soldering is very helpful if you want to join two or more metal objects with a stronger bond than tape, for example, but not too strong, as applying some pressure can break a soldered bond. Soldering is very important because it creates a temporary bond that can then be placed in a product. In my project Visionary Inc.’s caneye we build a cane for blind people. In our project , we used soldering to connect all of the wiring (including to the ultrasonic sensors). It was vital in the creation of the caneye, as the sensor array would not function throughout the cane if we didn’t use soldering to extend the wires.

Here is a quick lesson on how to Solder:

– Make sure you have all the proper pieces

  • The solder
  • The iron
  • The Fan
  • Whatever two things you are desiring to solder
  • Then you turn on the iron and put it up to your desired temperature you want it (about 375 to 400 degrees)
  • Then you wait for the Iron to warm up
  • You then place some solder onto the iron just to prep it up for your soldering job.
  • Then you place the solder and the iron right near to the place that you need to connect together (like between two wires or between a wire and Arduino board to give two examples) also make sure to place both onto the location to put the solder on but do not have the iron and solder touching eachother – feel free to use clips provided at the soldering station in order to hold some of your pieces you want to solder in place
  • Then once the metal melts onto your desired location, make sure the solder is on there nicely
  • Then move on to the next place you need to solder

 

However, despite our eventual success, we originally struggled a bit with soldering, so here are some tips:

  • Make sure you are using the lead-free solder & the temperature of the iron is around 400
  • Try to stabilize the objects your soldering as much as possible, because if something moves while you are soldering, it is very likely you will make a mistake or be unsuccessful.
  • Make sure that the fan is on, as the fumes caused by soldering can be quite strong and can be dangerous. The fan will minimize the odor.
  • While soldering, be sure to keep your fingers/body as far away from the soldering as possible (make special note of where you’re holding the soldering iron), as touching either the iron or the hot metal can be very painful.
  • When soldering, first melt some solder onto the metal objects. Then, push the objects together, and use the soldering iron to melt the already placed solder together (if needed, add some more). This popular practice is known as tinning.
  • When finished, it can be very helpful to wrap a piece of electrical tape around the soldered objects, especially if you are planning on putting a lot wires close to each other.

 

We learned how to solder from two sources: Dr. Aviv provided us with advice as we went along, and the Internet. Here are some great YouTube videos that provide many important tips and tricks for soldering beginners:

 

Picture to get you familiar with soldering:

screen-shot-2016-11-16-at-3-29-27-pm

Written by Ben Glicksman Class of 2018

Weight Measurement (Load Cell and Force-Sensitive Resistor)

 

EarthWearth: Lulu Wein, Matthew Siegel, Ron Wolf, and Marci Brustman

eToolpage:

Weight Measurement – Load Cell, Force-Sensitive Resistor

 

About:

The load cell is a small metal bar that is designed to convert the forces placed on it into electrical signals, which can be measured by a computer like the Arduino. Basically, it measures weight. It does this, using variable resistors on both sides of the cell, which measure tension and compression. The signals from these resistors are sent through an operational amplifier (described below) and read by the Arduino.

Continue reading Weight Measurement (Load Cell and Force-Sensitive Resistor)

Transistors

Transistors:

 

About

A transistor is an electronic gate, which allows current to flow through it given the correct input. Transistors are needed to help power electronic components which need more than the 5 volts from the Arduino, by acting as a switch. (They can also be used to amplify voltage or current, but this article will talk about the switch function.) There are two types of transistors, NPN and PNP, which accomplish the same goal, but through different methods.

Continue reading Transistors