Intellecta Technologies Pty Ltd

for PICAXE education, Roland CAM, Techsoft CAD, Intellecta control, Atmel, Arm and Microchip education

Introduction

The Salisbury High School project is part of the C2C initiative.

The function of this system is to design a small security system that responds to a change in light level or a switch contact.

This page details the electronics part of the project.

Graphic1

Power Supply.

The system requires a loud speaker output and the amplifiers perform best at about 9V. This voltage is too high for the microcontroller so a simple regulator circuit was designed. The LM2940 supplies about 100mA at 5V and is adequate to operate the microcontroller. The 9V battery connects through a screw terminal block and reverse damage to any components is prevented with a diode.

Power supply02

Microcontroller

A PICAXE 08M device was chosen because it is easy to program with a flowchart system that reinforces the planning process.

External screw connectors were used for the switch input on J3, Led output of J4 and J5.

main cpu02

Amplifier

An LM386 audio amplifier was chosen to generate about 200mW output power.

The microcontroller output labelled OUT2 drives the amplifier.

amplifier02

 

main pcb02

Summary of HARDWARE connections

Switch on J3 - use the if PIN3 command

Led on J4 - use the High 4 command

Led on J5 - use the High 0 command

Sound is on OUTPUT 2

Light sensor is  read with the READADC , 1 command

TASK 1 : Use the Flowchart.

1. Open the Programming Editor and set up a flowchart.

flowchart 1

2. Set up the correct part names.

This makes it easier to refer to specific parts on the boards. You can give your own names that make sense. Select the Flowchart symbol table.

flowchart 2

3. Enter appropriate names

flowchart 3

4. Flash the lights for a test

Use the output commands to make lines 0 and 4 high and low. This will make your leds flash on and off.

flowchart 4

5. Set up the following flowchart.

You will see that the default value if zero, you can select the appropriate symbol name.

flowchart 5

6. Run the simulation

Click on simulate window to test your program.

flowchart 6

You will the lights flash as you step through the program.

flowchart 7

 

7. Download to your controller.

Make sure that the LEDS are connected to the connectors with the anode and cathode in the appropriate side of the socket.

Select the CONVERT TO BASIC option. You will see your program in text mode.

flowchart 802

Select the download option on the tool bar. You should see a progress bar and the leds will flash when the download is complete.

 

Task 2. Reading a switch

You have a switch input on the board that is part of the security system. Your program must test if this switch is ON or OFF. The usual electronics lingo for this is HIGH or LOW. You need to use the IF icon in the flowchart.

Return to your original flow chart and remove the icons. Start with a clean sheet.

NOTE: MAKE SURE YOU CHANGE THE SWITCH WORD IN THE SYMBOL TABLE BECAUSE THAT GENERATES AN ERROR.

Set up the following icons. You can run the simulation and click on input 3 to see the program change directions.

flowchart 9

Convert to BASIC

Select the conversion option. You should see the following program.

flowchart 10

 

Download the program and you should see the light stay off until you press the switch.

You can play a tune at this point with the sound or tune command.

 

[Home] [About] [News] [Events] [Products] [CAD] [CAM] [Control] [Mechatronics] [Science] [Materials] [Support] [Map] [Contact]

PICMicro & Microchip, Picaxe logo are registered trademarks of Microchip Technology Inc. AZ. Atmel AVR & Atmel logo are registered trademarks of Atmel Corporation. CA. Philips Logo is a registered trademark of Philips Semiconductor Inc & Philips SA, Netherlands. Picaxe is a registered Trade mark of Microchip. Intellecta is a registered trademark of Intellecta Technologies. All other logos and trademarks are the property of their respective owners. Revision Date June2006

© 1997- 2006 Intellecta Technologies - All rights reserved - email: supportatintellectadotnet