Difference between revisions of "Arduino"

From Idea Shop Wiki
Line 37: Line 37:
 
This challenge is simple, use an Arduino Uno to blink an LED on and off.  An LED is an electronic component that emits light when it’s fed power.  However, this component can only be connected to a circuit one way, in other words it only allows current to flow in one direction, which makes it a diode.  This is how we derived the name LED, or Light Emitting Diode.   
 
This challenge is simple, use an Arduino Uno to blink an LED on and off.  An LED is an electronic component that emits light when it’s fed power.  However, this component can only be connected to a circuit one way, in other words it only allows current to flow in one direction, which makes it a diode.  This is how we derived the name LED, or Light Emitting Diode.   
  
Before we try to make the LED blink, let’s test our circuit on a breadboard.  A breadboard is a device that allows us to test our circuits easily by inserting/removing wire connections and components easily.
+
Before we try to make the LED blink, let’s test our circuit on a breadboard.  A breadboard is a device that allows us to test our circuits easily by inserting/removing wire connections and components easily.<br>
 +
[[File:Arduino Fig 1-1.png]]<br>
 +
Breadboards have connections between horizontal holes on either side of the middle divider (see above).  We use this to connect components and create circuits.  The two columns on either side are connected to each other, and we usually use them to distribute power and ground,
 +
 
 +
To test your LED you’ll neNow, we will get into our first bit of Arduino programming.  Make sure you have the Arduino IDE downloaded on a computer before we start.  Open it up and go to File<Examples<Basics<Blink.  Upload the Sketch to the Arduino by clicking the right-facing arrow in the top left corner.  When it’s finished uploading your LED should begin to blink. 
 +
 
 +
Feel free to mess around with the program so you can get a feel for how it works before we move on to the next step. 
 +
 
 +
Check out these links if you want to learn more about the ‘Arduino’ structure of coding:
 +
ed to make a circuit running from the Ground to 5v on the Arduino.  First place the LED on the board, and make sure the feet are in two different rows.  Next, attach a wire from the 5V pin on the arduino to the anode end of the LED (the longer wire).  Then add the 220 ohm resistor in series with the LED, and connect the ground on the Arduino to that.  Your circuit should look like the picture below.<br>
 +
[[File:Arduino Fig 1-2.png]]<br>
 +
Okay, now to apply power to the circuit, plug the Arduino into a usb socket with a USB-A cord.  The LED should light up.
 +
 
 +
Congratulations! You’ve just taken the first step towards mastering Arduino.  Next, we will use the digital pins on the Arduino to control the flow of power to the LED.
 +
 
 +
The digital pins on the Arduino can be configured as either inputs or outputs, for this purpose we will use them as outputs.  For this step, let’s reuse the circuit we just created.  Simply move the 5V wire from 5V to pin 13 on the Arduino, like below.  The digital pins actually operate at 3.3V so the resistor is not required, but we will leave it in for safety.<br>
 +
[[File:Arduino Fig 1-3.png]]<br>
 +
Now, we will get into our first bit of Arduino programming.  Make sure you have the Arduino IDE downloaded on a computer before we start.  Open it up and go to File<Examples<Basics<Blink.  Upload the Sketch to the Arduino by clicking the right-facing arrow in the top left corner.  When it’s finished uploading your LED should begin to blink. 
 +
 
 +
Feel free to mess around with the program so you can get a feel for how it works before we move on to the next step. 
 +
 
 +
Check out these links if you want to learn more about the ‘Arduino’ structure of coding:
 +
[https://www.arduino.cc/reference/en/#structure arduino.cc]
 +
[https://startingelectronics.org/software/arduino/learn-to-program-course/01-program-structure-flow/ startingelectronics.org]

Revision as of 15:14, 22 April 2020

About


Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing. Source

The company manufactures single board micro-controllers and micro-controller kits for building digital devices and interactive objects that can sense and control objects in the physical world.

Here is a Video Tutorial for an Introduction to Arduino

Hardware components

Software components

Uses of Arduino


Here is a Lab Manual intended to provide a basic introduction to Arduino and the concepts we use here at the Idea Shop. This lab manual was created for people with basic programming knowledge, but no Arduino experience. The topics covered are; digital input and output, operating servos, and Serial communication.

This lab manual may not answer all the questions you have about a topic, but many of the challenges include reference links. Don’t forget; you can always ask the lab mentors for help.

Challenge 1: Blink an LED

If you’ve done this before feel free to continue to the next challenge.

Hardware Required

 -Arduino Uno
 -LED
 -220 Ohm Resistor (Red-Red-Brown-Gold color bands)
 -USB-A Cord
 -Computer with Arduino program installed

Instructions

This challenge is simple, use an Arduino Uno to blink an LED on and off. An LED is an electronic component that emits light when it’s fed power. However, this component can only be connected to a circuit one way, in other words it only allows current to flow in one direction, which makes it a diode. This is how we derived the name LED, or Light Emitting Diode.

Before we try to make the LED blink, let’s test our circuit on a breadboard. A breadboard is a device that allows us to test our circuits easily by inserting/removing wire connections and components easily.
Arduino Fig 1-1.png
Breadboards have connections between horizontal holes on either side of the middle divider (see above). We use this to connect components and create circuits. The two columns on either side are connected to each other, and we usually use them to distribute power and ground,

To test your LED you’ll neNow, we will get into our first bit of Arduino programming. Make sure you have the Arduino IDE downloaded on a computer before we start. Open it up and go to File<Examples<Basics<Blink. Upload the Sketch to the Arduino by clicking the right-facing arrow in the top left corner. When it’s finished uploading your LED should begin to blink.

Feel free to mess around with the program so you can get a feel for how it works before we move on to the next step.

Check out these links if you want to learn more about the ‘Arduino’ structure of coding: ed to make a circuit running from the Ground to 5v on the Arduino. First place the LED on the board, and make sure the feet are in two different rows. Next, attach a wire from the 5V pin on the arduino to the anode end of the LED (the longer wire). Then add the 220 ohm resistor in series with the LED, and connect the ground on the Arduino to that. Your circuit should look like the picture below.
Arduino Fig 1-2.png
Okay, now to apply power to the circuit, plug the Arduino into a usb socket with a USB-A cord. The LED should light up.

Congratulations! You’ve just taken the first step towards mastering Arduino. Next, we will use the digital pins on the Arduino to control the flow of power to the LED.

The digital pins on the Arduino can be configured as either inputs or outputs, for this purpose we will use them as outputs. For this step, let’s reuse the circuit we just created. Simply move the 5V wire from 5V to pin 13 on the Arduino, like below. The digital pins actually operate at 3.3V so the resistor is not required, but we will leave it in for safety.
Arduino Fig 1-3.png
Now, we will get into our first bit of Arduino programming. Make sure you have the Arduino IDE downloaded on a computer before we start. Open it up and go to File<Examples<Basics<Blink. Upload the Sketch to the Arduino by clicking the right-facing arrow in the top left corner. When it’s finished uploading your LED should begin to blink.

Feel free to mess around with the program so you can get a feel for how it works before we move on to the next step.

Check out these links if you want to learn more about the ‘Arduino’ structure of coding: arduino.cc startingelectronics.org