Application Case Study Christmas Lights Controller

Slides:



Advertisements
Similar presentations
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Advertisements

IR Control Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
555 Timer ©Paul Godin Updated February Oscillators ◊We have looked at simple oscillator designs using an inverter, and had a brief look at crystal.
Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
ELECTRICAL. Circuits Outline Power Hub Microcontroller Sensor Inputs Motor Driver.
Introduction of Holtek HT-46 series MCU
OutLine Overview about Project Wii Robot Escaper Robot Problems and Solutions Demo.
ZigBee Calvin Choy David Kim Jason Chong Devin Galutira.
Part A: Controlling Oscillation Frequency with Capacitors and Resistors Part B: Diodes and Light Experiment Timer.
Sensors And Micro-Controllers
Digital I/O Connecting to the Outside World
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Team Members: Ruichen Zhao Xhoua Lor Jen-Yuan Hsiao John Marion.
Clock Options and Sleep Modes. Clock Sources Flash Fuse bits can be programmed to choose one of the following Clock sources: 1. External RC Osc. f = 1/(3RC).
PWM Circuit Based on the 555 Timer. Introduction In applications LED Brightness Control we may want to vary voltage given to it. Most often we use a variable.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
Project: security lock system Idea: –Create a 4bit password using switches –Send data serially (one bit at a time) using an LED –Receive the code serially.
Closed Loop Temperature Control Circuit with LCD Display Mike Wooldridge ECE 4330 Embedded Systems.
A mini project presentation On REMOTE CONTROL HOME APPLIANCES Submitted By: N.JEEVAN KUMAR 07681A0425 R.RAJASHEKAR 07681A0469 D.RAKESH KUMAR 07681A0415.
 ACCELEROMETER  TRANSMITTER- BLOCK DIAGRAM  RECEIVER- BLOCK DIAGRAM  COMPONENTS DESCRIPTION- ENCODER TRANSMITTER RECEIVER OPTICAL SENSOR.
TV Remote As A Wireless Mouse For PC.
Module 8 Tutorial  An 8086 system is used for controlling the speed of a motor. The motor can operate at 5 different speeds (1- 5).  The speed.
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
SENSORS.
Embedded Systems Programming (What they do and when / how to use them)
SUBMITTED BY EDGEFX TEAM
Application Case Study Security Camera Controller
Demodulation PWM Signal
Timers and Event Counters
LED LAMP DIMMER CIRCUIT
Arduino Based Industrial appliances control system by decoding dual tone multi frequency signals on GSM / CDMA network. Submitted by:
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
Home automation using Arduino & ‘PIR sensor’
Environment Temperature Monitor
ABSTRACT The controller continuously polls the temperature with certain regular time intervals and displays over the 7_segment display The temperature.
REMOTE JAMMING DEVICE.
TV OPERATION JAMMING SYSTEM
Analog Comparator An analog comparator is available on pins PE2(AIN0), PE3(AIN1) The comparator operates like any other comparator. -when (+) exceeds (-)
For further information
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
(EVENING ON TO MORNING OFF)
BATTERY CHARGING BY THYRISTOR TRIGGERING CONTROL
555 Timer EEE DEPARTMENT KUMPAVAT HARPAL( )
SUBMITTED BY EDGEFX TEAM
HIGH POWER AC TO DC BY THYRISTOR FIRING ANGLE CONTROL
Project Title ARDUINO BASED WIRELESS ELECTRICAL APPARATUS CONTROL SYSTEM USING IR COMMUNICATION Under the Guidance of Submitted by.
ARDUINO LINE FOLLOWER ROBOT
IR OBSTACLE DETECTION TO
EXTERNAL GUIDE INTERNAL GUIDE
IR Control Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Pulse Width Modulation (PWM) Motor Feedback - Shaft Encoder
Communication Protocol
The Arduino Microcontroller: Atmel AVR Atmega 328
Arduino Analog I/O Analog input pins: 0 – 5
Introduction to Microprocessors and Microcontrollers
Internet-of-Things (IoT)
CSCI1600: Embedded and Real Time Software
Manual Robotics ..
UNIT 5 Analog signals.
Introduction to Arduino
CSCI1600: Embedded and Real Time Software
Remote Control System Contents: Basic remote control system
Presentation transcript:

Application Case Study Christmas Lights Controller Embedded Systems Programming Application Case Study Christmas Lights Controller (with RC5 Infrared remote control) Requirements analysis Selecting sensors, inputs and outputs I/O ports and interfacing Configuration of internal modules (H/W interrupt, Timers, Power management) 1

Richard Anthony December 2010

Case study - Requirements analysis Functional requirements of the Christmas lights control system: Turn on / off LED decorative lights by remote control (TV remote); Adjust brightness of lights by remote control; A signal LED should blink briefly to indicate the remote control command was recognised (the controller may not be compatible, the user may press the wrong button, the batteries may be flat, controller may not be pointed directly at the unit, etc.). Non-functional requirements: Use very low levels of power. 3 Richard Anthony December 2010

Case study - Selecting sensors, inputs and outputs Sensors, and I/O devices for the Christmas lights control system: An RC5 decoder (receiver) is needed to detect the Infrared signal transmitted by a TV remote control. This will need a single digital input pin. (In addition, if the Power-Down low power mode is to be used to conserve battery power, the input must also be able to generate a hardware interrupt to wake the microcontroller). A low-intensity LED is adequate for the signal LED. Requires a single digital output pin Several high-intensity LEDs will form the actual tree lights. Requires a single digital output pin (this will need to be switched via a power transistor because the microcontroller output pin cannot provide enough current. (In addition, to enable adjusting the brightness of the lights, the output pin will have to be one of the timer PWM outputs). 4 Richard Anthony December 2010

Case study - I/O ports and interfacing (1) Interfacing sensors and I/O devices to specific ports (for ATtiny45) Allocate devices that need specific ports or functionality first: 1. The RC5 decoder (receiver) must be able to generate a hardware interrupt to wake the microcontroller. There is only one external interrupt pin that can do this, so this pin must be used: INT0, Port B bit 2 2. The high-intensity LEDs must be connected to a PWM output so that their brightness can be changed. The ATtiny45 has two timers (0 and 1) and each has two independent PWM outputs. Timer 1 will be used to control the brightness so the PWM output OC1A will be used: OC1A, Port B bit 1 3. The signal LED can be connected to any digital output pin. Uses: Port B bit 0 5 Richard Anthony December 2010

Case study - I/O ports and interfacing – ATtiny45 version This is the actual microcontroller used in the built system. The ATtiny45 is an 8-pin device, has only one port (port B) with only 6 I/O pins: 6 digital input / outputs, 4 ADC inputs, 2-input analogue comparator, external interrupt pin, serial communications, 2 programmable timers (each can produce PWM outputs), and power-management. Port-pin assignment ATtiny45 RC5 IR receiver, INT0 port B bit 2 LED Lighting Timer1 PWM port B bit 1 Signal LED port B bit 0 6 Richard Anthony December 2010

Case study - I/O ports and interfacing - ATmega8535 Equivalent Signal LED RC5 decoder LED Lights (PWM) 7 Richard Anthony December 2010

Richard Anthony ATmega1281 ATmega1281 Port mapping

Case study - I/O ports and interfacing – ATmega1281 Equivalent Richard Anthony ATmega1281 Case study - I/O ports and interfacing – ATmega1281 Equivalent Signal LED RC5 decoder LED Lights (PWM)

ATmega2560 Port mapping ATmega2560 Richard Anthony

Case study - I/O ports and interfacing – ATmega2560 Equivalent Signal LED LED Lights (PWM) RC5 decoder Richard Anthony

RC5 IR Receiver (TSOP4838) – technical documentation from datasheet Picture of device showing pin connections Pin 1 is demodulated data output and can be connected directly to a microcontroller port pin. Pin 2 is Gnd Pin 3 is +Ve supply (rated +4.5 to +5.5 volts, tested working Ok down to 3.4V) 1 2 3 Block diagram showing main functional components: - Automatic gain controlled amplifier - Band pass filter to cut out noise - Demodulator to remover the 38KHz modulation carrier wave - Output driver transistor which enables direct driving of a microcontroller port pin (data rate of 4K b/S) Generic circuit diagram for connection to a microcontroller. Richard Anthony December 2010

The RC5 receiver photodiode Christmas lights control system: Full Circuit Diagram +4.5V 0V The RC5 receiver photodiode IR transmitter (e.g. TV remote control) PB2 INT0 Pin7 +Vcc Green SIGNAL LED 330 Ω PB0 Pin5 PB1 PWM Pin6 1.5KΩ lights + 2200µF Cap (because of combination of specific Colour-cycle LEDs and the use of PWM. Capacitor converts the pulse to a smoothed voltage) 22µF Cap (Smooths short-term voltage drops across ATMEL, e.g. when LEDs initially turned on full brightness) 1A fuse Richard Anthony December 2010

Flow chart – Christmas lights control system Main Timer0 ISR (RC5 bit clocking) Bit received Stop Start (bit-time expired) enables (detect Pulse) Start Timer 0 Configure H/W INT2 Process code bit Entire code received ? Yes Configure Timer1 (PWM) Next code bit ready No Apply RC5 command (on / off / change brightness, via PWM) updates Configure Timer0 Decode and interpret received RC5 code INT2 ISR (detect RC5 code pulses) 14 Richard Anthony

Case study - Timing diagram - Representing related timing aspects Timer0 Interrupt handler Data pattern (detected) Light Signal present Case study - Timing diagram - Representing related timing aspects Interrupt 2 detect signal Receive_RC5 function active Code repeats automatically while Tx button pressed Timer runs continuously Command code interpreted at application level (Turn lights on/off, or adjust Timer1PWM) Time Relationship Key: Cause Effect Not to Scale When all bits (14) received Richard Anthony

Case study - Configuration of internal modules (outline details) Hardware Interrupt – used to wake-up the microcontroller from sleep. Configured to detect low-level initially because clocks are disabled in the Power-Down sleep mode (need clock running to detect a rising or falling edge). After device has woken up, reconfigure the hardware interrupt to rising-edge sensitive to be able to recognise the start of an RC5 data code. Timers – one needed to clock-in the RC5 code, the other used for PWM. Timer 0 (8bit) used in the RC5 data receiver protocol (to determine the start and end of each data bit that makes up the RC5 code). Timer 1 (8bit on Attiny45) used to generate the Pulse-Width-Modulation signal which controls the brightness of the LED lights. Power Management – needed because the system is battery powered and may be ‘off’ for long periods of time. The system must use the least possible amount of power – Power-Down Mode. The system is woken by a hardware interrupt (INT0) Not-needed parts (ADC, Analogue comparator, USI – Universal Serial Interface) are turned off to further minimise power use. Richard Anthony December 2010

Case study – RC5 command map RC5 command Application Command mapping # Turn on PWM output to LEDs (initially 1% duty cycle ) 1 LED brightness = 1% duty cycle (lowest brightness) 2 LED brightness = 2% duty cycle 3 LED brightness = 4% duty cycle 4 LED brightness = 8% duty cycle 5 LED brightness = 15% duty cycle 6 LED brightness = 30% duty cycle 7 LED brightness = 50% duty cycle 8 LED brightness = 70% duty cycle 9 LED brightness = 90% duty cycle (highest brightness) CHAN_DOWN Turn off PWM output to LEDs (LEDS off, Unit enters power-down sleep mode) VOL_DOWN Turn off PWM output to LEDs Richard Anthony December 2010

Output to decorative lights Christmas lights control system: External view RC5 decoder Signal LED Output to decorative lights Richard Anthony December 2010

Christmas lights control system: Internal View Richard Anthony December 2010