Unit 2. Computer Control. PIC stands for PROGRAMMABLE INTERFACE CONTROLLER. A PIC chip takes in input signals and then controls output transducers

Similar documents
RKP08 Component List and Instructions

ELECTRONIC DICE CHIP FACTORY ELECTRONIC DICE PROJECT. What is a microcontroller? Example use of a microcontroller.

Laboratory of Sensors Engineering Sciences 9 CFU

Programmable Control. Name Class Teacher. Ellon Academy Technical Faculty

The GENIE Light Kit is ideal for introducing simple lighting projects, such as an electronic die, a wearable badge or a night-time warning system.

What are output transducers An output transducer will convert electrical signals passed to it by the process into another form of energy.

09/05/2014. Engaging electronics for the new D&T curriculum. Geoff Hampson Managing Director of Kitronik. Presentation overview

revolution GETTING STARTED Appendix H - Frequently Asked Questions (FAQ). Section 1 92

BalloonSat Sensor Array

solutions for teaching and learning

3. The circuit is composed of 1 set of Relay circuit.

Introduction 1. Liquid crystal display (16 characters by 2 rows) Contrast dial: turn the dial to adjust the contrast of the display (see page 5)

solutions for teaching and learning

The PICAXE VSM Tutorial is split into a number of chapters. Each chapter can be downloaded free of charge from the website.

Button Code Kit. Assembly Instructions and User Guide. Single Button Code Entry System

XYLOPHONE KIT ESSENTIAL INFORMATION. Version 2.0 CREATE YOUR OWN ELECTRONIC MUSICAL INTRUMENT WITH THIS

RECORD & PLAYBACK KIT

PIC DESIGN (version 1) 2/11/2009

DELUXE STEREO AMPLIFIER KIT

AXE033 SERIAL/I2C LCD & CLOCK

PICAXE EXPERIMENTER BOARD (AXE090)

Touch Control Switch + - R6 R4 R8 R7 CAT# Grading. Assembly Instructions by Earl D. Gates SUNY Oswego Fall Conference 2007.

Strobe Light. Student Lab Guide. Engineering Teaching Laboratory. Lab Partner(s) Page 1 of 10

QUASAR KIT No DIGITAL DOWN TIMER 99 MIN WITH PIC

12v Power Controller Project Board

SRI-02 Speech Recognition Interface

Example use of a microcontroller.

TKEY-1. CW touch key. (no electromechanical contacts) Assembly manual. Last update: June 20,

Schematic Diagram: R2,R3,R4,R7 are ¼ Watt; R5,R6 are 220 Ohm ½ Watt (or two 470 Ohm ¼ Watt in parallel)

AQA GCSE Design and Technology 8552

629/P32 (X10/P32) PIC CHIP. On - Off Operating Instructions (Revision 2)

LED Knight Rider. Yanbu College of Applied Technology. Project Description

AXE Stack 18. BASIC-Programmable Microcontroller Kit. An inexpensive introduction to microcontroller technology for all ability levels

Ca Bling! Pacificon 2011 Norcal Buildathon Project

Assembly Instructions (8/14/2014) Your kit should contain the following items. If you find a part missing, please contact NeoLoch for a replacement.

Introduction to microcontrollers

Guide To Making Schematic Components For ExpressSCH

Instruction Manual for BE-SP3 Circuit. 10/21/07

output devices. connected to the controller. data communications link. relay systems. user program. MECH1500Quiz1ReviewVersion2 Name: Class: Date:

Variable Power Supply Digital Control Circuit Diagram Using Lm317

solutions for teaching and learning

Electronic Lock CodeLock AVR 1 DIY electronic door lock

MIAC-01 Now you are in control

Engineering Diploma Resource Guide ST450 ETP Electronic Circuits (Engineering)

CORRIGENDUM ISSUED FOR NATIONAL COMPETITIVE BIDDING UNDER TEQIP PHASE-II

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

High Power (15W + 15W) Stereo Amplifier

Images Scientific OWI Robotic Arm Interface Kit (PC serial) Article

Specification. 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3.

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017

Build Your Own Home Security System

Locktronics PICmicro getting started guide

solutions for teaching and learning

Goal: We want to build an autonomous vehicle (robot)

Wireless Power Panel Meter (WPPM)

DMX512-4 Channel PWM Driver Board #805

ARRL ETP Solder Hour Clock Kit Construction Manual

PIC Dev 14 Through hole PCB Assembly and Test Lab 1

DLA. DMX512 Analyzer. DLA Users Manual SV2_00 B.lwp copyright ELM Video Technology, Inc.

INTRODUCTION TO THE PICAXE SYSTEM

revolution How does the ibutton work? Full kit including PCB, PICAXE-08M chip and ibutton key. Spare ibutton Key

Cheap Control Systems. Cheap Six Channel (C6C) Servo Controller Version 2.3 OVERVIEW

MP3 audio amplifier. Build Instructions. Issue 2.0

Microprocessors/Microcontrollers

Universal Keying Adapter 3+

DIY Line Tracking Smart Car with AT89C2051

Connecting LEDs to the ADB I/O

Pacific Antenna Two Tone Generator

Touch Sense Controller

Prototyping & Engineering Electronics Kits Basic Kit Guide

Supplement for module D041 incl. ATMega8 Prozessor

Onwards and Upwards, Your near space guide Overview of the NearSys Two Sensor Temperature Array Figure 1. A complete Two Sensor Temperature Array

Board Of Education USB (#28850)

REDACTION BASED ATM MONITORING SYSTEM USING MSP 430

Figure 1. A complete Temperature Sensor

MB68k-100 Assembly and Bench Check, A

Pacific Antenna Easy TR Switch Kit

Programmable timer PICAXE programming editor guide Page 1 of 13

Innovative Electronics for a Changing World INDEX

Bolt 18F2550 System Hardware Manual

OpenSprinkler v2.1u Build Instructions

OpenSprinkler v2.2u Build Instructions

3.The circuit board is composed of 4 sets which are 16x2 LCD Shield, 3 pieces of Switch, 2

3 pyro output datalogger altimeter with an ATmega 328 microcontroller Kit assembly instructions

Laboratory 10. Programming a PIC Microcontroller - Part II

Silicon Steroids for the Stamp Help Your Projects Heft Big Loads Using Switching Transistors

Design and Technology: Electronic Products

BASIC Stamp 1 Project Board (#27112) Development / Education Platform for the BASIC Stamp 1

Electronics Construction Manual

Ultimate LPF kit: Relay-switched LPF kit

Part 2: Building the Controller Board

PROGRAMMING AND CUSTOMIZING

Now you are in control

EVAL-ADT7516. SPI -/I 2 C -Compatible, Temperature Sensor, 4-Channel ADC and Quad Voltage Output DAC FEATURES APPLICATIONS

SNAP-MICRO Instruction manual Elenco Electronics Inc. Rev A

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

Keywords Digital IC tester, Microcontroller AT89S52

None. MICROCONTROLLERS III

Shack Clock kit PCB Revision: QCU Rev 1 or QCU Rev 3

solutions for teaching and learning

Transcription:

Unit 2 Computer Control PIC stands for PROGRAMMABLE INTERFACE CONTROLLER A PIC chip takes in input signals and then controls output transducers Name: Form:

2

ASIC or Application Specific Integrated Circuits Examples of ASICs are 741 OPERATIONAL AMPLIFIER like you saw in the electronics section or a 555 TIMER. Each of these examples has one specific application. An Op Amp amplifies; a 555 Timer produces time control. However they look exactly the same. The advantages of ASICs are that they are cheap around 35p depending on which ASIC you buy. They have one particular application and there are circuits available to download that use them. They are not versatile as they only have one function and they can not be upgraded or reprogrammed. They need to be soldered into a PCB and connected to other components to make them work. The 555 timer can sink and source up to 300mA which is very useful for directly controlling a relay. But both the 555 and the 741only have one output pin. The 741 has two input pins and these are used to compare voltages together. Both the 555 and the 741 come in 8 pin DIL (DUAL in LINE) packages. The 555 timer only has one input pin, but it can be used in two ways. 741 555 The PIC chip or Programmable Interface Controller comes in a variety of sizes. PICAXE is a brand of such controller we use in school. They are referred to as microcontrollers. Some advantages of the micro-controller are: increased reliability because of smaller part count, reduced stock levels as less parts are needed, simplified product assembly, greater flexibility and adaptability since the features are written into micro controller program not hardwired in to the electronic hardware and rapid product development as the changes can be written in the software not the electronic hardware. However, to programme them you will need expensive out lay for computer equipment. They have multiple input and output pins, it can be updated, but can sink or source only up to 20mA. Compared to ASICs they are very expensive. PICAXE 08 1.50 3

Which is better an ASIC or a PIC chip? ASIC PIC Advantages Disadvantages Advantages Disadvantages Your answer: 4

Where are microcontrollers used? An example of a micro-controller in use is your microwave. The microcontroller will monitor a range of inputs from the door switch, keypad and provide outputs to the light, LCD display unit, turntable motor and magnetron. One single micro-controller can replace a number of discrete (separate) parts in a circuit to simplify the operation of a product. How are Microcontrollers used? Applications that make use of micro-controllers include: Alarm systems Household appliances Medical equipment Vehicle sub-systems some cars have up to 30 micro-controllers controlling fuel mix to central locking. Electronic instrumentation Are microcontrollers available in school? In industrial applications the micro-controllers will be programmed using a language called C. However for our applications in a school setting that level of programming will not be necessary. The micro-controller system we will be using in school is called the PIC AXE system, and the PIC AXE system makes use of a far simpler BASIC programming language called BASIC. The beauty of using the PIC AXE system of programming means that you can download the software at home from: www.picaxe.co.uk Year 8 Programmable PIC PCB The PCB here is one which year 8 has used to programme and make all sorts of different products with. It can be programmed to perform a number of different functions. Count up down food timer Bike light Metronome KIT (knightrider) 5

Are there different types of PIC AXE Chips? PICAXE MICROCONTROLLERS PICAXE Type IC Size Memory (lines) I/O Pins Outputs Inputs ADC Data Memory Polled Interrupt COST PICAXE-08 8 40-110 5 1-4 1-4 1L 128-prog No 1.15 PICAXE-08M 8 80-220 5 1-4 1-4 3 256-prog Yes 1.50 PICAXE-14M 14 80-220 13 5 6 2 256-prog Yes 1.70 PICAXE-18M 18 80-220 13 8 5 3 256-prog Yes 2.00 PICAXE-18X 18 600-1800 14 9 5 3 256+i2c Yes 3.00 PICAXE-20M 20 80-220 18 8 8 4 256-prog Yes PICAXE-20X2 20 1000-3200 18 1-17 1-17 0-9 256+i2c Yes PICAXE-28X1 28 1000-3200 23 9-17 0-12 0-4 128+i2c Yes PICAXE-28X2 28 1000-3200 x4 23 0-20 0-20 0-9 256+i2c Yes 4.50 PICAXE-40X1 40 1000-3200 32 9-17 8-20 3-7 128+i2c Yes PICAXE-40X2 40 1000-3200 x4 32 0-26 0-26 0-11 256+i2c Yes PICAXE Type Suffix M IC size Memory (lines) I/O Outputs Inputs ADC Data Memory Polled Interrupt refers to the order code of the chip M means music refers to the number of legs refers to the maximum number lines of programming code you can use. refers to the number of INPUTs or OUTPUTs you can connect to the chip refers to the dedicated Output connections refers to the dedicated Input connections refers to the number of ANALOGUE to DIGITAL CONVERTERS there are on the chip. L means low resolution. refers to the READ in information that can be stored refers to whether or not you can parallel process instructions However the PIC chip on its own cannot operate a system. The PIC chip will need to be interfaced (connected) to the outside world by designing a circuit and then a Printed Circuit Board (PCB). 6

What does a PICAXE chip look like? The N Identifies pin 1 The input and output components can then be connected to the PIC chip via the copper tracks on the PCB and the program running on the PIC chip will operate the system in a predetermined sequence. What are the rules when using a PICAXE chip? + 3-5 Volts 1 8 0 Volts Serial In 2 7 Pin 0 OUTPUT and Serial Out Pin 4 In/Out 3 6 Pin 1 Input & Analogue In Pin 3 Input only 4 5 Pin 2 In/Out PIC AXE Rules 1 The maximum voltage used with a PICAXE CHIP is 5 Volts 2 PIN 0 is OUTPUT and Serial OUT 3 PIN 1 is INPUT/OUTPUT or Analogue IN 4 PIN 2 is INPUT or OUTPUT 5 PIN 3 is INPUT ONLY 6 PIN 4 is INPUT or OUTPUT 7

7 LEG 2 is 8 LEG 1 is 9 Leg 8 is 10 The analogue input is on PIN 8

How can I tell a PIC chip what I want it to do? PROGRAMMING Writing a programme is about sequencing what you want the system to do. What do you think sequencing means? At the start of a control system it is useful to write a control statement. If.. then.. For example: If it the room gets dark then switch on a light. From this statement a sequence of instructions can be written. 1. If it is dark then switch on light 2. Switch off the light 3. Go to instruction 1 However what is wrong with this sequence? (think logically) Write an improved set of instructions here 9

Is there another way to write a computer programme? You can write a programme to control a device by using a more visual method called FLOWCHARTING. Flowcharts use symbols. Start or Stop a flow chart N Y Word bank Label the boxes by using these descriptions: Define a SUB(routine) dotted lines GOSUB(routine) straight lines Decision (Yes and No) Action, Pause or Delay (rectangular) 10

A typical flow chart used to flash LEDs after a button has been pressed Computer Control Start N Is the switch pressed? Y Switch on LED 1 for 1s NOTE how many things are happening inside this one action box? Switch off LED 1 for 1s Switch on LED 2 for 1s Switch off LED 2 for 1s Switch on LED 3 for 1s Switch off LED 3 for 1s Switch on LED 4 for 1s Switch off LED 4 for 1s Switch on LED 5 for 1s Switch off LED 5 for 1s Switch on motor 1 for 1s Switch off motor 1 for 1s Switch on buzzer 1 for 1s What is the limitation of this flowchart? (hint how many times will the LEDS flash? Switch off buzzer 11

SAQ 1. Draw the flowchart symbol for a decision, include directional arrows. [3] 2. Name three advantages of using MICROCONTROLLERS [3] 3. What does PIC stand for? [3] 4. Name three uses for microcontrollers [3] 5. How can you identify pin number 1 on any chip? [1] 6. Draw an action box as used in a flow chart, include directional arrows. [2] A* = 13, A = 11, B = 9, C = 8, D = 6, E = 4, F = 3, G = 2 12

Task 1 Designing a PCB Using what you know about electronics design a circuit to light up 4 LEDS from PIC Chip when you press a push button. Draw your circuit here: Now you will earn how to convert your circuit into a PCB using Quickroute 4.0 Start Programmes Subjects Technology Quickroute 13

QUICKROUTE is a piece of software that will convert a SCHEMATIC diagram into a PCB layout. It is COMPUTER AIDED DESIGNING (CAD) using electronics. Step 1 Draw your schematic diagram Right mouse click on the symbols menu Next select the 8 pin DIL Step 2 Click where you want to drop the component and enter the details as shown opposite. NOTE In the OPTIONS SYMBOL menu you can toggle on/off DISPLAY IDENTS to show or not show the labels Step 3 Next select symbols and the menu for passive res/cap/ind and look for the symbol No. 74 RES STD 0.25W (resistor standard 0.25 Watts) 14

Place the resistors where they are in your circuit diagram and give them the correct values. Step 4 Rotate and place resistors for the input potential divider circuit. Step 5 Add the GENERIC LED from the SEMI DIODE, TRANSISTOR menu. 15

Step 6 Add a voltage source from the SIMULATOR SPICE menu symbol NUMBER 16. Step 7 Connect up your circuit. Left click the line icon. Left click where you want it to start. Left click where you want it to connect. Right mouse click to end the line. To delete Left click the select tool to select a line and press delete. Step 8 Check your circuit looks similar to this one 16

Step 9 In this image the DISPLAY IDENTS are toggled ON. The schematic is now finished save it to a folder called TECHNOLOGY and call it PICDR1.BUT you can only use 7 letters with no spaces. Print off your SCHEMATIC DIAGRAM and stick it into your sketch book. The next stages are: NET COMPILE and then SCHEMATIC CAPTURE Read on only when you have saved your file 17

Changing the schematic into a PCB layout. Step 1 Click the net compile icon. Step 2 look for faults where joints have not been made and fix them e.g. this line is not joined delete the line and do it again. Step 3 click SCHEMATIC CAPTURE and the SCHEMATIC drawing will be converted into a rats nest PCB format. The symbols have been changed into their component layouts ready for soldering. CLICK YES to drawing will be lost. Save this file as PCBPIC1 The RATS NEST is an untidy rubber banded drawing too big to make and needs proper routing. 18

Step 4 Open up QUICKROUTE again, so you have 2 copies open and open up the PICDR.SCH. Now you have one copy of your SCHEMATIC and one copy of your PCB Step 5 Rearrange your components to make the board as small as possible. Rotate the components so they look like your schematic drawing. SAVE YOUR FILE as PCBPIC1 Step 5 Double click the components and using your schematic diagram label the components correctly. Start at R1 and work through. Step 6 Rearrange to make the PCB as small as possible and change the LED symbol for one found in the symbols menu. The rubber bands remain behind. 19

Step 7 Add copper tracks from the NET LINE menu No. 5 0.03 (0.03 inches) Step 7 From the VIEW menu click CURRENT LAYER and only the orange layer will be shown. No add ROUND PAD no. 72 to MOST of the pads use No. 88 for the LEDs Step 8 Using the T tool label the PCB Note LEDS moved so they will fit next to each other Step 9 Delete the symbols and flip so it can be used as the underneath acetate. 20

Step 10 Add the stereo socket for programming. Downloading the Program The serial download circuit is identical for all PIC AXE chips. The circuit consists of 3 wires from the PIC AXE chip to the serial port of the computer. One wire sends data to the serial input of the PIC AXE, one wire transmits data from the serial output of the PIC AXE to the computer, and the third wire is the common ground line between PIC AXE and computer. 3 2 1 Download stereo socket Above View 22K Serial Out Serial In 0V 10K PICAXE How can I get a 5 volt supply from a 6Volt battery? 4 x 1.5 Volts = 6 0.7 Volt drop now 5.3 Volts to PIC chip circuit 100µF 21

Step 10 should look like this. The stereo socket has been added A thin outline added Copper sections filled in to assist in the speed of etching the board Your name on the PCB Must be added 22

Writing Programmes Programming your chip Checklist Is the battery connected? Have you got a programming jumper? Is the lead connected into the serial port? Have you checked the quality of your soldered joints? Are you using a PICAXE 08? Is the download circuit correct on your PCB? Is the software set up for the PICAXE 08? Serial output of PC 6V battery 23

Program 1: Control statement: If the button is pressed light up the LEDS. If is is pressed again turn them off. PIC AXE 08 MODE. If this is wrong click view options and select 08. 24

Programme 2 Control Statement: If button is pressed all lights flash on and off quickly. When pressed again lights go off 25

Programme 3 Exercise Timer control statement: If the button is pressed light up 3 leds. Turn one off every 5 seconds until a minute is up then flash one 5 times. Notice this one has a count feature Adding 1 to a variable b0 and then testing its value 26

Programme 4 Egg Timer: If the button is on and extinguish LEDS in sequence for 3 and half minutes 27

Programme 5 Programmed Nightlight: If the button is pressed then switch on all LEDS and switch them off one at a time after every 5 minutes. BUT THERE IS A FAULT IN THIS PROGRAMME. FIND IT AND FIX IT Think about how to test it without waiting for 5 minutes at a time. 28

For more information about the PICAXE READ the booklet from the website www.picaxe.co.uk 29

Advanced programming Turning your PCB into a hot cold thermometer using a PICAXE 08 M chip 1. Remove the LED on PIN1 2. Connect a thermistor to PIN 1 (ADC) 3. Use the debug 0 and readadc1, b0 command 4. Read off the values of temperature on the screen 5. Use these values along with the VAR command to make a 3 LED thermometer Control statement: Turn on 2 LEDS at room temperature; 3 LEDS if it is hotter than room temperature and only 1 if it is colder than room temperature. 30