ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Arduino Lab 1 - The Voltage Divider


Enviado por   •  3 de Junio de 2015  •  Práctica o problema  •  1.677 Palabras (7 Páginas)  •  152 Visitas

Página 1 de 7

Arduino Lab 1 - The Voltage Divider

1. Introduction

In this lab, we will endanger a cute animal, create a portal to another dimension, and

invent a new genre of music. Along the way, we will learn about breadboarding, voltage

dividers, photoresistors, and using the TOMYUM SynthScope with MATLAB.

2. Some Basic Circuit Theory

Circuits are generally designed to accomplish some sort of fixed task, such as blinking a

light or amplifying a sound signal. Often, however, you will want to add user input to

your circuit, so that you can change its behavior on the fly (for example, setting the blink

rate or adjusting volume). A common way of doing this is to use a potentiometer. A

potentiometer looks like this:

A potentiometer is a three‐terminal device. The resistance between the two outermost

terminals, R

1‐3, is constant (this constant value is in fact written on the side of the

potentiometer), but the center terminal (2) acts as a “wiper” that slides back and forth

along the resistor as you rotate the potentiometer. Therefore, R

1‐2 and R2‐3 change, but

their sum R

1‐2 + R2‐3 = R1‐3 is constant. Note that the potentiometer is symmetrical.

In this case, we will be using the potentiometer as an input to a MATLAB program, with

the TOMYUM SynthScope as an intermediary. However, the SynthScope— like many

devices— measures voltages, not resistance, so we must find a way to convert a

change in resistance into a change in voltage.

Enter the voltage divider.

 

ESE 205  Arduino Lab 1 – The Voltage Divider  Fall 2009 

Here is a circuit schematic showing a potentiometer used as a voltage divider:

Through simple circuit analysis, it can be shown that:

Now, since R

1‐3 is constant, and R2‐3 will range from 0 Ω to R1‐3 Ω, we can see that

V

out will vary linearly from 0 V to Vin V, proportional to R2‐3. In essence, we have created

a simple way for the user to control the voltage Vout (by turning the potentiometer).

3. Introduction to the Arduino Platform

In front of you is a highly capable micro-controller – the Arduino Duemilanove:

Yours will look like the one on the right, as it has the protoshield attached. This is an

extension board that extends the pin headers on the main board while also providing a

breadboard prototyping surface. You’ll find that the board has plenty of connections. In

this lab, we will be connecting the board with the USB connection (no external power

supply is required) and then using the Analog Inputs and power connections on the

board.

 

ESE 205  Arduino Lab 1 – The Voltage Divider  Fall 2009 

PLEASE FOLLOW ALL DIRECTIONS!

If your computer already has ArduinoUploader please skip to “Flashing the Arduino”

The first step in this lab is to download the software required. The necessary files can

be found on the ESE 205 website under the Arduino link. You will need the compiled

firmware file (main.hex), the Arduino Uploader folder (ArduinoUploader), and the folder

containing the MATLAB functions (synthscope-lab).

1. Save both the firmware file and the Arduino Uploader folder to the C drive (C:\users).

a. NOTE: RCA computers only need main.hex if not present in C:\users.

2. Cut or copy main.hex and place it in the ArduinoUploader folder.

a. NOTE: Not required on RCA computers

3. Save the MATLAB functions to your S drive (remember this location).

a. NOTE: MATLAB Functions are found on 205 website, not BlackBoard.

-Flashing the Arduino- (Windows XP/Vista)

1. Connecting Arduino to computer

a. Right-click on “My Computer” on the desktop

b. Click “Properties”

c. Change the tab to “Hardware”

d. Click “Device Manager”

e. Click “OK” when error message opens

f. Open up “Ports (COM & LPT)” by clicking the “+” sign

g. Knowing which ports are currently displayed, plug USB cable into Arduino

and then a free USB socket on computer

h. The new COM port number is the Arduino board

i. If this new COM number is greater than 9 (ie, contains 2 digits)

Example, COM10, COM 24, etc

i. Right-click on the port

ii. Select “Properties”

iii. Click the “Port Settings” tab

iv. Click “Advanced”

v. Change “COM Port Number” to a lower, single digit port that is

open (not present In the list)

Example: if COM12, change to COM5

vi. Click “OK”

vii. Click “OK”

viii. After this, even though the port number did not change in the list

the Arduino will be assigned this new number

 

ESE 205  Arduino Lab 1 – The Voltage Divider  Fall 2009 

j. Make a note of this number

2. Opening command prompt

a. Click “Start” button

b. Click “Run”

c. Type “cmd” for the command prompt

d. Type in (if not already in C:\users) :

chdir C:\users\

i. If installed on home computer, use directory where Arduino

Uploader is located

e. In the command prompt, type the following with a single space in between:

avrdude (the program to flash the board)

-c stk500v1 (the programmer used)

-P comX

(the COM port – replace X)

-p m328p (the microcontroller model)

-b 57600 (the controller baud rate)

-U flash:w: main.hex

(flash the board by writing the file to the chip)

This should look like the following:

(Remember: replace X with your COM port –if Arduino is on COM port 8, use “com8”)

 

ESE 205 

...

Descargar como (para miembros actualizados) txt (11 Kb)
Leer 6 páginas más »
Disponible sólo en Clubensayos.com