Fritzing Exercises

7
FRITZING EXCERCISES Robotics WS09 by Alex_Clau_Cosmos

description

Some exercises for robotics using Fritzing

Transcript of Fritzing Exercises

Page 1: Fritzing Exercises

FRITZING EXCERCISES

Robotics WS09 by Alex_Clau_Cosmos

Page 2: Fritzing Exercises

Blinking LED on pin 13Task: Connect the long leg (positive) to pin 13 and the short leg to GND.

BlinkThe boards are designed to make it easy to blink an LED using digital pin 13. Some (like the Diecimila and LilyPad) have the LED built-in to the board. On most others (like the Mini and BT), there is a 1 KB resistor on the pin, allowing you to connect an LED directly. (To con-nect an LED to another digital pin, you should use an external resis-tor.)

LEDs have polarity, which means they will only light up if you orient the legs properly. The long leg is typically positive, and should con-nect to pin 13. The short leg con-nects to GND; the bulb of the LED will also typically have a flat edge on this side. If the LED doesn’t light up, trying reversing the legs (you won’t hurt the LED if you plug it in backwards for a short period of time).

http://arduino.cc/en/Tutorial/Blink

Breadboard

PCB

Schematic

Materials> Quantity Part 1 Red LED - 5mm 1 Arduino Diecimila

Page 3: Fritzing Exercises

Two LED alternating blinker

Aim: Use one “blinking” LED to make two LED’s blink

Alternating two LED blinker. One LED is special blinking LED (red), the other one is a blue LED. The LED’s will be alternately ON and OFF , as the blue LED goes on when blinking LED is off. Instead of the blue LED, it is possible to use red/green/yellow LED with series diode.

http://fritzing.org/projects/two-led-alternating-blinker/

Breadboard

Schematic PCB

Breadboard

Materials> Quantity Part 1 220Ω Resistor 1 Battery 1 Blue LED - 5mm 1 Rectangular PCB - Resizable 1 Red LED - 5mm 1 Tiny Breadboard

Page 4: Fritzing Exercises

Materials> Quantity Part 3 220Ω Resistor 1 Arduino Diecimila 1 Pushbutton 1 Red LED - 5mm 1 Tiny Breadboard 1 yellow LED - 5mm

Debounce Interrupt

Aim: To switch the state of some-thing on and off using a button on an interrupt. The button is debounced to prevent noise from causing the switch state to flicker.

http://fritzing.org/projects/de-bounce-interrupt/

Breadboard Schematic

PCB

Page 5: Fritzing Exercises

Schematic Breadboard

Model

Materials> Quantity Part 1 1kΩ Resistor 1 Arduino Diecimila 1 DC Motor 1 Generic Bajillion Hole Breadboard 1 H-Bridge 1 Pushbutton

DC Motor Control

Aim: This project shows how to control a DC motor’s direction (running forwards and backwards) using an H-bridge. An H-bridge is an electronic circuit which enables a voltage to be applied across a load in either direction.

Description of the different H-Bridge pins:

■Pin 1 (1,2EN) enables and disables our mo-tor whether it is give HIGH or LOW ■Pin 2 (1A) is a logic pin for our motor (input is either HIGH or LOW) ■Pin 3 (1Y) is for one of the motor terminals ■Pin 4-5 are for ground ■Pin 6 (2Y) is for the other motor terminal ■Pin 7 (2A) is a logic pin for our motor (input is either HIGH or LOW) ■Pin 8 (VCC2) is the power supply for our motor, this should be given the rated voltage of your motor ■Pin 9-11 are unconnected as you are only using one motor in this lab ■Pin 12-13 are for ground ■Pin 14-15 are unconnected ■Pin 16 (VCC1) is connected to 5V

Page 6: Fritzing Exercises

LDRs or Light Dependent Resis-tors are very useful especially in light/dark sensor circuits. Nor-mally the resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when they are illuminated with light resis-tance drops dramatically.

Light dependent resistor

When the torch is turned on, the resistance of the LDR falls, allowing current to pass through it.

This is an example of a light sensor circuit :

When the light level is low the resistance of the LDR is high. This prevents current from flowing to the base of the transistors. Consequently the LED does not light.

However, when light shines onto the LDR its resistance falls and current flows into the base of the first transistor and then the second transistor. The LED lights.

The preset resistor can be turned up or down to increase or decrease resistance, in this way it can make the circuit more or less sensitive.

Page 7: Fritzing Exercises

Breadboard

Schematic

DC Motor Control controlled by a light sensor.

Materials> Quantity Part 1 1kΩ Resistor 1 Arduino Diecimila 1 DC Motor 1 Generic Bajillion Hole Breadboard 1 H-Bridge 1 Basic Photo-Resistor (Photocell)