ELECTRONICS PULSE-WIDTH MODULATION

Size: px
Start display at page:

Download "ELECTRONICS PULSE-WIDTH MODULATION"

Transcription

1 ELECTRONICS PULSE-WIDTH MODULATION GHI Electronics, LLC - Where Hardware Meets Software

2 Contents Introduction... 2 Overview... 2 Guidelines... 2 Energy Levels... 3 DC Motor Speed Control... 7 Exercise... 8 Sounds... 9 Melodies Exercise Servo Motors Exercise Page 1 of 16

3 Introduction The BrainPad circuit board is designed as a powerful educational tool that can be used to teach everyone from kids, to college students and professionals. Kids will start to learn programming using Visual Studio, one of the most widely used professional tools. College students and professionals that already know programming can use the BrainPad circuit board to learn about digital electronics and the connection between computing and the physical world. Overview Students will learn how PWM (Pulse-Width Modulation) is a powerful feature found in every microcontroller. This includes how to control power levels, servo motors and sounds. Guidelines Prerequisites: EL102 Ages 12 and up PC setup with Visual Studio,.NET Micro Framework and GHI Electronics software. Supplies: BrainPad Page 2 of 16

4 Energy Levels A light that runs off 12 V will probably be half as lit if we only supplied it with 6 V. This is true but how do we get the 6 V if the system is powered with 12 V? We could use a resistor where half the voltage drops in the resistor and the other half goes to the light, but the resistor will be burning as much energy as the light. Energy on resistors is converted to heat. This is not practical as the resistor will be too hot and we need a resistor of a very high wattage to handle the high heat. What happens if we turn the light on and off for a short period of time? Half on and half off is half the energy. Our eyes will not see the light blinking. Instead, they will see the average amount of light. This isn t ideal when using LEDs as they run off a specific voltage and they will not dim with lower voltages well. Oscillating the LED between on and off will make the LED look dimmed. Let s dig into the code. Start a new NETMF (.NET Micro Framework) C# Console Application and add these References: Microsoft.SPOT.Hardware Microsoft.SPOT.Hardware.PWM GHI.Pins using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using GHI.Pins; public class Program public static void Main() PWM dimmer = new PWM((Cpu.PWMChannel)4, 1000, 0.5, false); dimmer.start(); Example 1 This code constructs a PWM object on PWM channel 4. The first argument in constructing the PWM object is the PWM channel on the processor. Looking at the schematic we see that the red LED is connected to pin PA1 (Figure 1), which is also PWM4. In the Example 1 above, we use (Cpu.PWMChannel)4 which translates to PWM channel 4 or PWM4. Page 3 of 16

5 Figure 1 Here we see PA1 is connected to the red LED. To make things easier, we ve provided two classes within the BrainPad object. The BrainPad.Expansion and BrainPad.Peripherals objects. To add get access to these objects, in the Solution Explorer Window right-click BrainPad_Project, select Add > Existing Item and locate the BrainPad.cs file and click Add. The BrainPad.Expansion object can be used to easily access the labeled pins (E1 through E16) on the expansion headers. The BrainPad.Peripherals object also makes identifying pins related to such things as the traffic light faster. These both help reduce the need to look at the schematic. For example, we could access the traffic light s red LED pin based on the schematic using G30.PwmOutput.PA1 or we could use BrainPad.Peripherals.TrafficLight.Red which is more descriptive and easier to remember. Going forward all examples will use the BrainPad.Expansion and BrainPad.Peripherals objects when referring to pins. Page 4 of 16

6 The second argument is the frequency. It s how many times per second the signal will turn on and off. Setting this low will cause the LED to flicker because our eyes will start seeing it. We ll go with 1,000 Hz (hertz), so the LED will turn on and off 1,000 times per second. The third argument is the duty cycle; the ratio of on to off. Using 0.5 will result in the signal being on 50% the time. Different values and their effects are shown in Figure 2. Figure 2 Here we see an LED s duty cycle set at 0.1 (10%), 0.5 (50%) and 1 (100%). Page 5 of 16

7 The fourth argument in the constructor is to invert the PWM signal. This is rarely used so we will always set it to false. using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; public class Program public static void Main() PWM dimmer = new PWM(BrainPad.Peripherals.TrafficLight.Red, 1000, 0.5, false); dimmer.start(); double duty = 0.0; double dutystep = 0.05; while (true) dimmer.dutycycle = duty; duty += dutystep; if (duty < 0.05 duty > 0.95) dutystep *= -1; Thread.Sleep(50); Example 2 This code makes the red traffic light LED fade in and out. Example 4 uses a trick to make an up and down counter. It increments the duty by a duty step but then the step is inverted to a negative number to make the counter count back down. The end result is an LED that repeatedly fades in and out. Page 6 of 16

8 DC Motor Speed Control BrainPad Electronics Pulse-Width Modulation DC Motor speed can be controlled the same way LEDs and lights are controlled. The only difference is that the motor will be sensitive to the frequency used. A value around 10,000 Hz should work for most small hobby DC motors. The second problem is that motors require more current than a pin on the microcontroller can provide. This is solved by using a transistor. Motors also generate noise and reverse voltage spikes so adding a diode and a capacitor is required as shown in Figure 3. Figure 3 Adding a diode and a capacitor in parallel helps eliminate noise and reverse feedback. Reverse feedback occurs when the motor turns generating a current that flows in the opposite direction that can damage components. At a minimum, a diode should be used. Page 7 of 16

9 The BrainPad includes the required circuitry to connect a small 5 V DC motor. The header labeled DC motor can be used. This connection can also be used to wire in light bulbs that require higher currents as well. A good example of controlling a motor is to have it run at a low speed for a few seconds and then at a high speed for a few seconds as shown in Example 5. using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; public class Program public static void Main() PWM dcmotor = new PWM(BrainPad.Peripherals.DcMotor, 1000, 0.5, false); dcmotor.start(); while (true) dcmotor.dutycycle = 0.10; Thread.Sleep(5000); dcmotor.dutycycle = 1.0; Thread.Sleep(5000); Example 3 This code loops through having a DC motor spin from slow (10% duty cycle) to fast (100% duty cycle). Exercise Fade two LEDs in and out but keep them in reverse order. When one is completely on, the other will very dim. Page 8 of 16

10 Sounds Sounds are simply vibrations moving through air. A speaker is a device that uses an electronic signal to generate sounds. There is small speaker on the BrainPad (Figure 4), which is named buzzer. Figure 4 Here we see the buzzer on the BrainPad schematic. Page 9 of 16

11 The buzzer is connected to PB8 (PWM13) through a transistor. The commonly stated range of human hearing is 20 Hz to 20 khz (kilohertz). A good frequency to use is 3 khz as shown in Example 6. using System.Threading; using Microsoft.SPOT.Hardware; public class Program public static void Main() PWM dimmer = new PWM(BrainPad.Peripherals.Buzzer, 3000, 0.5, false); dimmer.start(); Thread.Sleep(3000); dimmer.stop(); Example 4 This code plays the buzzer at 3 khz for three seconds. Note: The duty cycle should be set to 0.5 when generating sounds. Page 10 of 16

12 Melodies Simple melodies can be played by programming frequencies as shown in Example 7. using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; public class Program const int NoteC = 261; const int NoteD = 294; const int NoteE = 330; const int NoteF = 349; const int NoteG = 392; const int Whole = 1000; const int Half = Whole / 2; const int QuarterDot = Whole / 3; const int Quarter = Whole / 4; const int Eighth = Whole / 8; public static void Main() int[] note = NoteE, NoteE, NoteF, NoteG, NoteG, NoteF, NoteE, NoteD, NoteC, NoteC, NoteD, NoteE, NoteE, NoteD, NoteD, NoteE, NoteE, NoteF, NoteG, NoteG, NoteF, NoteE, NoteD, NoteC, NoteC, NoteD, NoteE, NoteD, NoteC, NoteC ; int[] duration = Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, QuarterDot, Eighth, Half, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, Quarter, QuarterDot, Eighth, Whole ; PWM buzzer = new PWM(BrainPad.Peripherals.Buzzer, 261, 0.5, false); while (true) for (int i = 0; i < note.length; i++) buzzer.stop(); buzzer.frequency = note[i]; buzzer.start(); Thread.Sleep(duration[i]); Thread.Sleep(100); Example 5 This code plays a melody by generating frequencies for specified durations. Page 11 of 16

13 Example 7 uses two arrays, one that holds the note and the other the duration. This is can be improved greatly by using a structure or a class that holds both in one object. Exercise Create a loop that increases the frequency 100 Hz each iteration. When the frequency goes over 8,000 Hz, have it go back to 50 Hz. Page 12 of 16

14 Servo Motors Servo motors are used to move a mechanical arm to a specific degree between 0 to 180. These can be used to angle a distance sensor to check the distance in different directions. They can be used to turn the steering on a small robotic vehicles. There are also full rotation servos but those are not the common use of servos. Servo motors are controlled by a pulse that comes in 50 times a second or every 20 ms (milliseconds). The pulse width can be anywhere from 1.25 ms to 1.75 ms (Figure 5). Sending a 1.25 ms pulse will move the servo to the 0 position. Sending a 1.75 ms pulse will move the servo to move to the 180 position. Sending a 1.50 ms pulse will put the servo in the middle, at 90 position. Figure 5 Here we see the different pulses that move servos to a specified angle. Page 13 of 16

15 PWM gives us the option of providing the exact timing. While this is possible, it s not accurate as shown in Example 8. using Microsoft.SPOT.Hardware; using GHI.Pins; public class Program public static void Main() PWM servo = new PWM(BrainPad.Peripherals.ServoMotor, 20000, 1500, PWM.ScaleFactor.Microseconds, false); servo.start(); Example 6 Here we set the period to 20,000 and the duration (pulse) to 1,500. This 1.50 ms pulse every 20 ms will set the servo in the 90 position. Let s have the servo move back and forth in Example 9. using System.Threading; using Microsoft.SPOT.Hardware; using GHI.Pins; public class Program public static void Main() PWM servo = new PWM(BrainPad.Peripherals.ServoMotor, 20000, 1500, PWM.ScaleFactor.Microseconds, false); servo.start(); Thread.Sleep(5000); while (true) servo.duration = 1250; servo.period = 20000; servo.start(); Thread.Sleep(1000); servo.duration = 1750; servo.period = 20000; servo.start(); Thread.Sleep(1000); Example 7 Let s set the servo to 90 and wait for 5 seconds. After that we ll move the servo from 0 to 180 and back again with a one second delay in between while looping. Page 14 of 16

16 Exercise Servo motors are not very accurate. Set the servo with 1.25, 1.50 and 1.75 pulses and measure the servo position in degrees. Page 15 of 16

17 GHIElectronics.com/support/brainpad Page 16 of 16

Experiment #3: Micro-controlled Movement

Experiment #3: Micro-controlled Movement Experiment #3: Micro-controlled Movement So we re already on Experiment #3 and all we ve done is blinked a few LED s on and off. Hang in there, something is about to move! As you know, an LED is an output

More information

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators Ahmed Okasha, Assistant Lecturer okasha1st@gmail.com Objective Have a

More information

Motors and Servos Part 2: DC Motors

Motors and Servos Part 2: DC Motors Motors and Servos Part 2: DC Motors Back to Motors After a brief excursion into serial communication last week, we are returning to DC motors this week. As you recall, we have already worked with servos

More information

EE 314 Spring 2003 Microprocessor Systems

EE 314 Spring 2003 Microprocessor Systems EE 314 Spring 2003 Microprocessor Systems Laboratory Project #9 Closed Loop Control Overview and Introduction This project will bring together several pieces of software and draw on knowledge gained in

More information

CSCI1600 Lab 4: Sound

CSCI1600 Lab 4: Sound CSCI1600 Lab 4: Sound November 1, 2017 1 Objectives By the end of this lab, you will: Connect a speaker and play a tone Use the speaker to play a simple melody Materials: We will be providing the parts

More information

Assembly Language. Topic 14 Motion Control. Stepper and Servo Motors

Assembly Language. Topic 14 Motion Control. Stepper and Servo Motors Assembly Language Topic 14 Motion Control Stepper and Servo Motors Objectives To gain an understanding of the operation of a stepper motor To develop a means to control a stepper motor To gain an understanding

More information

Arduino An Introduction

Arduino An Introduction Arduino An Introduction Hardware and Programming Presented by Madu Suthanan, P. Eng., FEC. Volunteer, Former Chair (2013-14) PEO Scarborough Chapter 2 Arduino for Mechatronics 2017 This note is for those

More information

1. Introduction to Analog I/O

1. Introduction to Analog I/O EduCake Analog I/O Intro 1. Introduction to Analog I/O In previous chapter, we introduced the 86Duino EduCake, talked about EduCake s I/O features and specification, the development IDE and multiple examples

More information

PWM CONTROL USING ARDUINO. Learn to Control DC Motor Speed and LED Brightness

PWM CONTROL USING ARDUINO. Learn to Control DC Motor Speed and LED Brightness PWM CONTROL USING ARDUINO Learn to Control DC Motor Speed and LED Brightness In this article we explain how to do PWM (Pulse Width Modulation) control using arduino. If you are new to electronics, we have

More information

100UF CAPACITOR POTENTIOMETER SERVO MOTOR MOTOR ARM. MALE HEADER PIN (3 pins) INGREDIENTS

100UF CAPACITOR POTENTIOMETER SERVO MOTOR MOTOR ARM. MALE HEADER PIN (3 pins) INGREDIENTS 05 POTENTIOMETER SERVO MOTOR MOTOR ARM 100UF CAPACITOR MALE HEADER PIN (3 pins) INGREDIENTS 63 MOOD CUE USE A SERVO MOTOR TO MAKE A MECHANICAL GAUGE TO POINT OUT WHAT SORT OF MOOD YOU RE IN THAT DAY Discover:

More information

DC motor control using arduino

DC motor control using arduino DC motor control using arduino 1) Introduction: First we need to differentiate between DC motor and DC generator and where we can use it in this experiment. What is the main different between the DC-motor,

More information

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment. Physics 222 Name: Exercise 6: Mr. Blinky This exercise is designed to help you wire a simple circuit based on the Arduino microprocessor, which is a particular brand of microprocessor that also includes

More information

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs 10-11 Introduction to Arduino In this lab we will introduce the idea of using a microcontroller as a tool for controlling

More information

Experiment 9 : Pulse Width Modulation

Experiment 9 : Pulse Width Modulation Name/NetID: Experiment 9 : Pulse Width Modulation Laboratory Outline In experiment 5 we learned how to control the speed of a DC motor using a variable resistor. This week, we will learn an alternative

More information

Sensors and Sensing Motors, Encoders and Motor Control

Sensors and Sensing Motors, Encoders and Motor Control Sensors and Sensing Motors, Encoders and Motor Control Todor Stoyanov Mobile Robotics and Olfaction Lab Center for Applied Autonomous Sensor Systems Örebro University, Sweden todor.stoyanov@oru.se 13.11.2014

More information

1. Controlling the DC Motors

1. Controlling the DC Motors E11: Autonomous Vehicles Lab 5: Motors and Sensors By this point, you should have an assembled robot and Mudduino to power it. Let s get things moving! In this lab, you will write code to test your motors

More information

Arduino Control of Tetrix Prizm Robotics. Motors and Servos Introduction to Robotics and Engineering Marist School

Arduino Control of Tetrix Prizm Robotics. Motors and Servos Introduction to Robotics and Engineering Marist School Arduino Control of Tetrix Prizm Robotics Motors and Servos Introduction to Robotics and Engineering Marist School Motor or Servo? Motor Faster revolution but less Power Tetrix 12 Volt DC motors have a

More information

Programmable Control Introduction

Programmable Control Introduction Programmable Control Introduction By the end of this unit you should be able to: Give examples of where microcontrollers are used Recognise the symbols for different processes in a flowchart Construct

More information

FABO ACADEMY X ELECTRONIC DESIGN

FABO ACADEMY X ELECTRONIC DESIGN ELECTRONIC DESIGN MAKE A DEVICE WITH INPUT & OUTPUT The Shanghaino can be programmed to use many input and output devices (a motor, a light sensor, etc) uploading an instruction code (a program) to it

More information

Assignments from last week

Assignments from last week Assignments from last week Review LED flasher kits Review protoshields Need more soldering practice (see below)? http://www.allelectronics.com/make-a-store/category/305/kits/1.html http://www.mpja.com/departments.asp?dept=61

More information

Programming PIC Microchips

Programming PIC Microchips Programming PIC Microchips Fís Foghlaim Forbairt Programming the PIC microcontroller using Genie Programming Editor Workshop provided & facilitated by the PDST www.t4.ie Page 1 DC motor control: DC motors

More information

Tarocco Closed Loop Motor Controller

Tarocco Closed Loop Motor Controller Contents Safety Information... 3 Overview... 4 Features... 4 SoC for Closed Loop Control... 4 Gate Driver... 5 MOSFETs in H Bridge Configuration... 5 Device Characteristics... 6 Installation... 7 Motor

More information

LED + Servo 2 devices, 1 Arduino

LED + Servo 2 devices, 1 Arduino LED + Servo 2 devices, 1 Arduino Learn to connect and write code to control both a Servo and an LED at the same time. Many students who come through the lab ask if they can use both an LED and a Servo

More information

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

Programming a Servo. Servo. Red Wire. Black Wire. White Wire Programming a Servo Learn to connect wires and write code to program a Servo motor. If you have gone through the LED Circuit and LED Blink exercises, you are ready to move on to programming a Servo. A

More information

Direct Current Waveforms

Direct Current Waveforms Cornerstone Electronics Technology and Robotics I Week 20 DC and AC Administration: o Prayer o Turn in quiz Direct Current (dc): o Direct current moves in only one direction in a circuit. o Though dc must

More information

Introduction to Arduino HW Labs

Introduction to Arduino HW Labs Introduction to Arduino HW Labs In the next six lab sessions, you ll attach sensors and actuators to your Arduino processor This session provides an overview for the devices LED indicators Text/Sound Output

More information

Electronics. RC Filter, DC Supply, and 555

Electronics. RC Filter, DC Supply, and 555 Electronics RC Filter, DC Supply, and 555 0.1 Lab Ticket Each individual will write up his or her own Lab Report for this two-week experiment. You must also submit Lab Tickets individually. You are expected

More information

o What happens if S1 and S2 or S3 and S4 are closed simultaneously? o Perform Motor Control, H-Bridges LAB 2 H-Bridges with SPST Switches

o What happens if S1 and S2 or S3 and S4 are closed simultaneously? o Perform Motor Control, H-Bridges LAB 2 H-Bridges with SPST Switches Cornerstone Electronics Technology and Robotics II H-Bridges and Electronic Motor Control 4 Hour Class Administration: o Prayer o Debriefing Botball competition Four States of a DC Motor with Terminals

More information

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech Computational Crafting with Arduino Christopher Michaud Marist School ECEP Programs, Georgia Tech Introduction What do you want to learn and do today? Goals with Arduino / Computational Crafting Purpose

More information

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads: Project 4: Arduino Servos Part 1 Description: A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads: a. Red: Current b. Black:

More information

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

Attribution Thank you to Arduino and SparkFun for open source access to reference materials. Attribution Thank you to Arduino and SparkFun for open source access to reference materials. Contents Parts Reference... 1 Installing Arduino... 7 Unit 1: LEDs, Resistors, & Buttons... 7 1.1 Blink (Hello

More information

Lab 5: Inverted Pendulum PID Control

Lab 5: Inverted Pendulum PID Control Lab 5: Inverted Pendulum PID Control In this lab we will be learning about PID (Proportional Integral Derivative) control and using it to keep an inverted pendulum system upright. We chose an inverted

More information

Lesson 3: Arduino. Goals

Lesson 3: Arduino. Goals Introduction: This project introduces you to the wonderful world of Arduino and how to program physical devices. In this lesson you will learn how to write code and make an LED flash. Goals 1 - Get to

More information

Automobile Prototype Servo Control

Automobile Prototype Servo Control IJIRST International Journal for Innovative Research in Science & Technology Volume 2 Issue 10 March 2016 ISSN (online): 2349-6010 Automobile Prototype Servo Control Mr. Linford William Fernandes Don Bosco

More information

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O) PH-315 Portland State University MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O) ABSTRACT A microcontroller is an integrated circuit containing a processor and programmable read-only memory, 1 which is

More information

Name & SID 1 : Name & SID 2:

Name & SID 1 : Name & SID 2: EE40 Final Project-1 Smart Car Name & SID 1 : Name & SID 2: Introduction The final project is to create an intelligent vehicle, better known as a robot. You will be provided with a chassis(motorized base),

More information

The Motor sketch. One Direction ON-OFF DC Motor

The Motor sketch. One Direction ON-OFF DC Motor One Direction ON-OFF DC Motor The DC motor in your Arduino kit is the most basic of electric motors and is used in all types of hobby electronics. When current is passed through, it spins continuously

More information

In this activity, you will program the BASIC Stamp to control the rotation of each of the Parallax pre-modified servos on the Boe-Bot.

In this activity, you will program the BASIC Stamp to control the rotation of each of the Parallax pre-modified servos on the Boe-Bot. Week 3 - How servos work Testing the Servos Individually In this activity, you will program the BASIC Stamp to control the rotation of each of the Parallax pre-modified servos on the Boe-Bot. How Servos

More information

Industrial Automation Training Academy. Arduino, LabVIEW & PLC Training Programs Duration: 6 Months (180 ~ 240 Hours)

Industrial Automation Training Academy. Arduino, LabVIEW & PLC Training Programs Duration: 6 Months (180 ~ 240 Hours) nfi Industrial Automation Training Academy Presents Arduino, LabVIEW & PLC Training Programs Duration: 6 Months (180 ~ 240 Hours) For: Electronics & Communication Engineering Electrical Engineering Instrumentation

More information

Chapter 14. using data wires

Chapter 14. using data wires Chapter 14. using data wires In this fifth part of the book, you ll learn how to use data wires (this chapter), Data Operations blocks (Chapter 15), and variables (Chapter 16) to create more advanced programs

More information

Built-in soft-start feature. Up-Slope and Down-Slope. Power-Up safe start feature. Motor will only start if pulse of 1.5ms is detected.

Built-in soft-start feature. Up-Slope and Down-Slope. Power-Up safe start feature. Motor will only start if pulse of 1.5ms is detected. Thank You for purchasing our TRI-Mode programmable DC Motor Controller. Our DC Motor Controller is the most flexible controller you will find. It is user-programmable and covers most applications. This

More information

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair Overview For this assignment, you will be controlling the light emitted from and received by an LED/phototransistor pair. There are many

More information

of PWM is explained here. Consider a simple circuit as shown in figure below. DC Motor Speed Control using 555 Timer IC. The DC MOTOR SPEED.

of PWM is explained here. Consider a simple circuit as shown in figure below. DC Motor Speed Control using 555 Timer IC. The DC MOTOR SPEED. How To Make A Dc Motor Speed Controller Circuit Using Two 555 Ics DC Motor PWM Speed Control Using 555 IC. The 555 is ubiquitous and can be used as simple PWM speed control. Circuit diagram: DC Motor PWM

More information

Experiment#6: Speaker Control

Experiment#6: Speaker Control Experiment#6: Speaker Control I. Objectives 1. Describe the operation of the driving circuit for SP1 speaker. II. Circuit Description The circuit of speaker and driver is shown in figure# 1 below. The

More information

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin 2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control October 5, 2009 Dr. Harrison H. Chin Formal Labs 1. Microcontrollers Introduction to microcontrollers Arduino microcontroller

More information

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter EE283 Electrical Measurement Laboratory Laboratory Exercise #7: al Counter Objectives: 1. To familiarize students with sequential digital circuits. 2. To show how digital devices can be used for measurement

More information

PS2-SMC-06 Servo Motor Controller Interface

PS2-SMC-06 Servo Motor Controller Interface PS2-SMC-06 Servo Motor Controller Interface PS2-SMC-06 Full Board Version PS2 (Playstation 2 Controller/ Dual Shock 2) Servo Motor Controller handles 6 servos. Connect 1 to 6 Servos to Servo Ports and

More information

Understanding the Arduino to LabVIEW Interface

Understanding the Arduino to LabVIEW Interface E-122 Design II Understanding the Arduino to LabVIEW Interface Overview The Arduino microcontroller introduced in Design I will be used as a LabVIEW data acquisition (DAQ) device/controller for Experiments

More information

HB-25 Motor Controller (#29144)

HB-25 Motor Controller (#29144) Web Site: www.parallax.com Forums: forums.parallax.com Sales: sales@parallax.com Technical: support@parallax.com Office: (916) 624-8333 Fax: (916) 624-8003 Sales: (888) 512-1024 Tech Support: (888) 997-8267

More information

Laboratory Exercise 1 Microcontroller Board with Driver Board

Laboratory Exercise 1 Microcontroller Board with Driver Board Laboratory Exercise 1 Microcontroller Board with Driver Board The purpose of this lab exercises is to demonstrate how the Microcontroller Board can be used to control motors connected to the Driver Board

More information

Single Channel StudioPro LED Dimmer Part No. PRO-DIM A

Single Channel StudioPro LED Dimmer Part No. PRO-DIM A Single Channel StudioPro LED Dimmer Part No. PRO-DIM-5000-20A 11235 West Bernardo Court, Suite 102 San Diego, CA 92127 888-880-1880 Fax: 707-281-0567 EnvironmentalLights.com The Single Channel StudioPro

More information

Ocean Controls KT-5198 Dual Bidirectional DC Motor Speed Controller

Ocean Controls KT-5198 Dual Bidirectional DC Motor Speed Controller Ocean Controls KT-5198 Dual Bidirectional DC Motor Speed Controller Microcontroller Based Controls 2 DC Motors 0-5V Analog, 1-2mS pulse or Serial Inputs for Motor Speed 10KHz, 1.25KHz or 156Hz selectable

More information

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009 University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009 Lab 1 Power Amplifier Circuits Issued August 25, 2009 Due: September 11, 2009

More information

Temperature Monitoring and Fan Control with Platform Manager 2

Temperature Monitoring and Fan Control with Platform Manager 2 August 2013 Introduction Technical Note TN1278 The Platform Manager 2 is a fast-reacting, programmable logic based hardware management controller. Platform Manager 2 is an integrated solution combining

More information

Haptic Feedback Technology

Haptic Feedback Technology Haptic Feedback Technology ECE480: Design Team 4 Application Note Michael Greene Abstract: With the daily interactions between humans and their surrounding technology growing exponentially, the development

More information

Pulse-Width-Modulation Motor Speed Control with a PIC (modified from lab text by Alciatore)

Pulse-Width-Modulation Motor Speed Control with a PIC (modified from lab text by Alciatore) Laboratory 14 Pulse-Width-Modulation Motor Speed Control with a PIC (modified from lab text by Alciatore) Required Components: 1x PIC 16F88 18P-DIP microcontroller 3x 0.1 F capacitors 1x 12-button numeric

More information

Lab 2: Blinkie Lab. Objectives. Materials. Theory

Lab 2: Blinkie Lab. Objectives. Materials. Theory Lab 2: Blinkie Lab Objectives This lab introduces the Arduino Uno as students will need to use the Arduino to control their final robot. Students will build a basic circuit on their prototyping board and

More information

Lock Cracker S. Lust, E. Skjel, R. LeBlanc, C. Kim

Lock Cracker S. Lust, E. Skjel, R. LeBlanc, C. Kim Lock Cracker S. Lust, E. Skjel, R. LeBlanc, C. Kim Abstract - This project utilized Eleven Engineering s XInC2 development board to control several peripheral devices to open a standard 40 digit combination

More information

Pololu Dual G2 High-Power Motor Driver for Raspberry Pi

Pololu Dual G2 High-Power Motor Driver for Raspberry Pi Pololu Dual G2 High-Power Motor Driver for Raspberry Pi 24v14 /POLOLU 3752 18v18 /POLOLU 3750 18v22 /POLOLU 3754 This add-on board makes it easy to control two highpower DC motors with a Raspberry Pi.

More information

Sensors and Sensing Motors, Encoders and Motor Control

Sensors and Sensing Motors, Encoders and Motor Control Sensors and Sensing Motors, Encoders and Motor Control Todor Stoyanov Mobile Robotics and Olfaction Lab Center for Applied Autonomous Sensor Systems Örebro University, Sweden todor.stoyanov@oru.se 05.11.2015

More information

L E C T U R E R, E L E C T R I C A L A N D M I C R O E L E C T R O N I C E N G I N E E R I N G

L E C T U R E R, E L E C T R I C A L A N D M I C R O E L E C T R O N I C E N G I N E E R I N G P R O F. S L A C K L E C T U R E R, E L E C T R I C A L A N D M I C R O E L E C T R O N I C E N G I N E E R I N G G B S E E E @ R I T. E D U B L D I N G 9, O F F I C E 0 9-3 1 8 9 ( 5 8 5 ) 4 7 5-5 1 0

More information

DC Motor and Servo motor Control with ARM and Arduino. Created by:

DC Motor and Servo motor Control with ARM and Arduino. Created by: DC Motor and Servo motor Control with ARM and Arduino Created by: Andrew Kaler (39345) Tucker Boyd (46434) Mohammed Chowdhury (860822) Tazwar Muttaqi (901700) Mark Murdock (98071) May 4th, 2017 Objective

More information

The NMIH-0050 H-Bridge

The NMIH-0050 H-Bridge The NMIH-0050 H-Bridge Features: 5 A continuous, 6 A peak current Supply voltages from 5.3V up to 40V Terminal block for power / motor Onboard LEDs for motor operation/direction Onboard LED for motor supply

More information

Feed-back loop. open-loop. closed-loop

Feed-back loop. open-loop. closed-loop Servos AJLONTECH Overview Servo motors are used for angular positioning, such as in radio control airplanes. They typically have a movement range of 180 deg but can go up to 210 deg. The output shaft of

More information

recognise that electronic systems are assembled from sensing, processing and out put sub-systems, including:

recognise that electronic systems are assembled from sensing, processing and out put sub-systems, including: Electronic Systems Learners should be able to: (a) recognise that electronic systems are assembled from sensing, processing and out put sub-systems, including: sensing units: light, temperature, magnetic

More information

Semiconductor 9/21/2015

Semiconductor 9/21/2015 Semiconductor Electronics 9/21/2015 Starting simple the diode. The diode is one of the simplest semiconductor devices. It is comprised of two layers of semiconductor. One is impregnated with an electron

More information

ABCs of Arduino. Kurt Turchan -

ABCs of Arduino. Kurt Turchan - ABCs of Arduino Kurt Turchan - kurt@trailpeak.com Bio: Kurt is a web designer (java/php/ui-jquery), project manager, instructor (PHP/HTML/...), and arduino enthusiast, Kurt is founder of www.trailpeak.com

More information

Marine Debris Cleaner Phase 1 Navigation

Marine Debris Cleaner Phase 1 Navigation Southeastern Louisiana University Marine Debris Cleaner Phase 1 Navigation Submitted as partial fulfillment for the senior design project By Ryan Fabre & Brock Dickinson ET 494 Advisor: Dr. Ahmad Fayed

More information

BASIC-Tiger Application Note No. 059 Rev Motor control with H bridges. Gunther Zielosko. 1. Introduction

BASIC-Tiger Application Note No. 059 Rev Motor control with H bridges. Gunther Zielosko. 1. Introduction Motor control with H bridges Gunther Zielosko 1. Introduction Controlling rather small DC motors using micro controllers as e.g. BASIC-Tiger are one of the more common applications of those useful helpers.

More information

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones 1 Announcements HW8: Due Sunday 10/29 (midnight) Exam 2: In class Thursday 11/9 This object detection lab

More information

Electronics, Sensors, and Actuators

Electronics, Sensors, and Actuators Electronics, Sensors, and Actuators 4/14/15 David Flicker BE107 Overview Basic electronics and components Sensors Actuators Electronics 101 Voltage, V, is fundamentally how much energy is gained or lost

More information

Programming 2 Servos. Learn to connect and write code to control two servos.

Programming 2 Servos. Learn to connect and write code to control two servos. Programming 2 Servos Learn to connect and write code to control two servos. Many students who visit the lab and learn how to use a Servo want to use 2 Servos in their project rather than just 1. This lesson

More information

MINI ELECTRONIC SIGNALS

MINI ELECTRONIC SIGNALS MINI ELECTRONIC SIGNALS MINI ELECTRONIC SIGNALS Purpose of Electronic Signals 2002-07 GENINFO Electronics - Overview - MINI Electronic signals move information much like cars move passengers down the highway.

More information

Control System for Lamp Luminosity. Ian Johnson, Tyler McCracken, Scott Freund EE 554 November 29, 2010

Control System for Lamp Luminosity. Ian Johnson, Tyler McCracken, Scott Freund EE 554 November 29, 2010 Control System for Lamp Luminosity Ian Johnson, Tyler McCracken, Scott Freund EE 554 November 29, 2010 Table of Contents Abstract...ii Introduction...1 Procedure...1 Results/Discussion...3 Conclusion...4

More information

Using the Z8 Encore! XP Timer

Using the Z8 Encore! XP Timer Application Note Using the Z8 Encore! XP Timer AN013104-1207 Abstract Zilog s Z8 Encore! XP microcontroller consists of four 16-bit reloadable timers that can be used for timing, event counting or for

More information

Mechatronics Project Report

Mechatronics Project Report Mechatronics Project Report Introduction Robotic fish are utilized in the Dynamic Systems Laboratory in order to study and model schooling in fish populations, with the goal of being able to manage aquatic

More information

Figure 1. DMC 60 components.

Figure 1. DMC 60 components. 1300 Henley Court Pullman, WA 99163 509.334.6306 www.digilentinc.com DMC 60 Reference Manual Revised November 15, 2016 This manual applies to the DMC 60 rev. A Overview The DMC 60 is an electronic speed

More information

Pulse Width Modulation and

Pulse Width Modulation and Pulse Width Modulation and analogwrite ( ); 28 Materials needed to wire one LED. Odyssey Board 1 dowel Socket block Wire clip (optional) 1 Female to Female (F/F) wire 1 F/F resistor wire LED Note: The

More information

Breadboard Traffic Light System

Breadboard Traffic Light System 1 Breadboard Traffic Light System Alex Sawicki & Geoff Yeung TEJ4M Mr. Bawa June20, 2013 2 Table of Contents Materials 3 Background Research 4 Experimental Procedure 7 Method One 8 Method Two 9 Conclusions

More information

Electronic Speed Controls and RC Motors

Electronic Speed Controls and RC Motors Electronic Speed Controls and RC Motors ESC Power Control Modern electronic speed controls regulate the electric power applied to an electric motor by rapidly switching the power on and off using power

More information

Lab Exercise 9: Stepper and Servo Motors

Lab Exercise 9: Stepper and Servo Motors ME 3200 Mechatronics Laboratory Lab Exercise 9: Stepper and Servo Motors Introduction In this laboratory exercise, you will explore some of the properties of stepper and servomotors. These actuators are

More information

Microcontrollers and Interfacing

Microcontrollers and Interfacing Microcontrollers and Interfacing Week 07 digital input, debouncing, interrupts and concurrency College of Information Science and Engineering Ritsumeikan University 1 this week digital input push-button

More information

Servo Sweep. Learn to make a regular Servo move in a sweeping motion.

Servo Sweep. Learn to make a regular Servo move in a sweeping motion. Servo Sweep Learn to make a regular Servo move in a sweeping motion. We have seen how to control a Servo and also how to make an LED Fade on and off. This activity will teach you how to make a regular

More information

Autonomous Robot Control Circuit

Autonomous Robot Control Circuit Autonomous Robot Control Circuit - Theory of Operation - Written by: Colin Mantay Revision 1.07-06-04 Copyright 2004 by Colin Mantay No part of this document may be copied, reproduced, stored electronically,

More information

Teaching Children Proportional Control using ROBOLAB 2.9. By Dr C S Soh

Teaching Children Proportional Control using ROBOLAB 2.9. By Dr C S Soh Teaching Children Proportional Control using ROBOLAB 2.9 By Dr C S Soh robodoc@fifth-r.com Objective Using ROBOLAB 2.9, children can experiment with proportional control the same way as undergraduates

More information

Project Name: SpyBot

Project Name: SpyBot EEL 4924 Electrical Engineering Design (Senior Design) Final Report April 23, 2013 Project Name: SpyBot Team Members: Name: Josh Kurland Name: Parker Karaus Email: joshkrlnd@gmail.com Email: pbkaraus@ufl.edu

More information

B RoboClaw 2 Channel 30A Motor Controller Data Sheet

B RoboClaw 2 Channel 30A Motor Controller Data Sheet B0098 - RoboClaw 2 Channel 30A Motor Controller (c) 2010 BasicMicro. All Rights Reserved. Feature Overview: 2 Channel at 30Amp, Peak 60Amp Battery Elimination Circuit (BEC) Switching Mode BEC Hobby RC

More information

Lab 5 Timer Module PWM ReadMeFirst

Lab 5 Timer Module PWM ReadMeFirst Lab 5 Timer Module PWM ReadMeFirst Lab Folder Content 1) ReadMeFirst 2) Interrupt Vector Table 3) Pin out Summary 4) DriverLib API 5) SineTable Overview In this lab, we are going to use the output hardware

More information

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O) PH-315 Portland State University MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O) ABSTRACT A microcontroller is an integrated circuit containing a processor and programmable read-only memory, 1 which is

More information

Power. EE 109 Unit 17 -Pulse Width Modulation. Duty Cycle. Output Devices

Power. EE 109 Unit 17 -Pulse Width Modulation. Duty Cycle. Output Devices 17.1 Power 17.2 EE 109 Unit 17 -Pulse Width Modulation Recall (or learn) that Power is a measure of: In an electronic circuit, P = Power = Current & Voltage (each may be w/ time) A circuit that draws a

More information

Project Proposal. Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen

Project Proposal. Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen Project Proposal Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen Advisor Dr. Gary Dempsey Bradley University Department of Electrical Engineering December

More information

Inductive Loop Detector

Inductive Loop Detector Naztec Operations Manual For Inductive Loop Detector Model 722TXC TS1/TS2 April 2003 Published by: Naztec, Inc. 820 Park Two Drive Sugar Land, Texas 77478 Phone: (281) 240-7233 Fax: (281) 240-7238 Copyright

More information

ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK

ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK Team Members: Andrew Blanford Matthew Drummond Krishnaveni Das Dheeraj Reddy 1 Abstract: The goal of the project was to build an interactive and mobile

More information

Robotic Navigation Distance Control Platform

Robotic Navigation Distance Control Platform Robotic Navigation Distance Control Platform System Block Diagram Student: Scott Sendra Project Advisors: Dr. Schertz Dr. Malinowski Date: November 18, 2003 Objective The objective of the Robotic Navigation

More information

Rochester Institute of Technology Real Time and Embedded Systems: Project 2a

Rochester Institute of Technology Real Time and Embedded Systems: Project 2a Rochester Institute of Technology Real Time and Embedded Systems: Project 2a Overview: Design and implement a STM32 Discovery board program exhibiting multitasking characteristics in simultaneously controlling

More information

Studuino Icon Programming Environment Guide

Studuino Icon Programming Environment Guide Studuino Icon Programming Environment Guide Ver 0.9.6 4/17/2014 This manual introduces the Studuino Software environment. As the Studuino programming environment develops, these instructions may be edited

More information

Touchless Control: Hand Motion Triggered Light Timer

Touchless Control: Hand Motion Triggered Light Timer Touchless Control: Hand Motion Triggered Light Timer 6.101 Final Project Report Justin Graves Spring 2018 1 Introduction Often times when you enter a new room you are troubled with finding the light switch

More information

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by A MORON'S GUIDE TO TIMER/COUNTERS v2.2 by RetroDan@GMail.com TABLE OF CONTENTS: 1. THE PAUSE ROUTINE 2. WAIT-FOR-TIMER "NORMAL" MODE 3. WAIT-FOR-TIMER "NORMAL" MODE (Modified) 4. THE TIMER-COMPARE METHOD

More information

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink By the end of this session: You will know how to use an Arduino

More information

Lesson 13. The Big Idea: Lesson 13: Infrared Transmitters

Lesson 13. The Big Idea: Lesson 13: Infrared Transmitters Lesson Lesson : Infrared Transmitters The Big Idea: In Lesson 12 the ability to detect infrared radiation modulated at 38,000 Hertz was added to the Arduino. This lesson brings the ability to generate

More information