1
Software Programmed in C 1. lightCycle: Function that cycles the lights when the CapSense is activated, cycles lights from Red to Green. 2. If, else: Determines whether or not to operate the lightCycle. If CapSense is active, the program runs lightCycle. Otherwise, cycles from green yellow to red. Cypress PSoC Designer & Programmer 1.Can add modules & code 2.Transfer program to chip 3.Use ImageCraft Compiler Abstract The history of traffic signaling has dated back to 1868 as a simple contraption featuring red and green gas lamps and has evolved into synchronized intersections with LED lights. Synchronization has made intersections more efficient as it allows for optimal utilization by sensing if a vehicle is waiting at the intersection instead of just relying on timers and a preset schedule for the intersection. In our program, two Cypress CY3214 boards are wired using 12C. The three Light Emitting Diodes (LEDs) per board are illuminated when the sensor is activated on the respective board. The activated board cycles from red to green in approximately three seconds after the opposite board cycles from green to yellow and finally red. The CapSense is set to capture when the vehicle approaches, and relays that information to the CPU. With this simulation, we are able to see a working intersection. While there are some limitations on the realism of the simulation, this project displays a standard perpendicular intersection with no protected left turn lanes. Purpose To synchronize two boards simulating a traffic intersection. This will help model more efficient traffic lights, which can in the future save time, money, and lives. It will also help to reduce traffic congestion on our roads. Project Goals and Guidelines Goals to designing the project include using all of the tools we have learned in this class such as: C, CapSense, Breadboard, Wiring, and Logic. The goals of the outcome of this project is to simulate a traffic intersection with a two sets of three LEDs and to learn about synchronization through either I2C, Port Forwarding, or Bit Manipulation. We hope to achieve a system which represents a real traffic Hardware Cypress CY3214 PSoC: The programmable system that hosts all the software & hardware. CapSense: Senses touch and uses that info to determine location of the “vehicle”. LEDs: 3 Light Emitting Diodes. They represent the traffic lights. Resistors: Reduce the voltage fo the LEDS. Procedure 1. Create a chip-level project in PSOC designer for the CY3214. 2. Add user modules for LCD and place it on Port 4. 3. Add user modules for 6 LEDs and place it on Port 3_2, Port 3_3, and Port 3_4, Port 2_2, Port 2_3, and Port_2_4. 4. Rename the respective LEDs 5. Add CapSense and follow the published instructions for “COSMOS 2008 Cluster 1, LAB 5” to set up CapSense to work with the PSoC Board. 6. Write main.c 7. Build the program using the ImageCraft compiler. 8. Plug the MiniProg into the board and program using the PSoC Programmer 9. Wire the board to the respective LEDs as well as grounding the boards for power. Synchronized Traffic Signals By: Govil Gupta, Eric Harmatz, Avneesh Kohli UCSD COSMOS 2008 Cluster 1: Adventures in Embedded Computer Systems Source Code Acknowledgements Dr. Rajesh Gupta Dr. Choon Kim Ms. Shirley Miranda Mr. Arash Arfaee Ms. Bridget Benson

Software Programmed in C 1. lightCycle: Function that cycles the lights when the CapSense is activated, cycles lights from Red to Green. 2. If, else: Determines

Embed Size (px)

Citation preview

Page 1: Software Programmed in C 1. lightCycle: Function that cycles the lights when the CapSense is activated, cycles lights from Red to Green. 2. If, else: Determines

SoftwareProgrammed in C

1. lightCycle: Function that cycles the lights when the CapSense is activated, cycles lights from Red to Green.

2. If, else: Determines whether or not to operate the lightCycle. If CapSense is active, the program runs lightCycle. Otherwise, cycles from green yellow to red.

Cypress PSoC Designer & Programmer

1.Can add modules & code2.Transfer program to chip3.Use ImageCraft Compiler

AbstractThe history of traffic signaling has dated back to 1868 as a simple

contraption featuring red and green gas lamps and has evolved into synchronized intersections with LED lights. Synchronization has made intersections more efficient as it allows for optimal utilization by sensing if a vehicle is waiting at the intersection instead of just relying on timers and a preset schedule for the intersection.

In our program, two Cypress CY3214 boards are wired using 12C. The three Light Emitting Diodes (LEDs) per board are illuminated when the sensor is activated on the respective board. The activated board cycles from red to green in approximately three seconds after the opposite board cycles from green to yellow and finally red. The CapSense is set to capture when the vehicle approaches, and relays that information to the CPU.

With this simulation, we are able to see a working intersection. While there are some limitations on the realism of the simulation, this project displays a standard perpendicular intersection with no protected left turn lanes.

PurposeTo synchronize two boards simulating a traffic intersection. This will help model more

efficient traffic lights, which can in the future save time, money, and lives. It will also help to reduce traffic congestion on our roads.

Project Goals and GuidelinesGoals to designing the project include using all of the tools we have learned in

this class such as: C, CapSense, Breadboard, Wiring, and Logic.

The goals of the outcome of this project is to simulate a traffic intersection with a two sets of three LEDs and to learn about synchronization through either I2C, Port Forwarding, or Bit

Manipulation.

We hope to achieve a system which represents a real traffic signal. You will be able to slide your finger simulating a car, and efficiently pass through the

intersection. This can help save time, money, and lives.

HardwareCypress CY3214 PSoC: The programmable system that hosts all the software & hardware.

CapSense: Senses touch and uses that info to determine location of the “vehicle”.

LEDs: 3 Light Emitting Diodes. They represent the traffic lights.

Resistors: Reduce the voltage for the LEDS.

Procedure1. Create a chip-level project in PSOC designer for the CY3214.

2. Add user modules for LCD and place it on Port 4.

3. Add user modules for 6 LEDs and place it on Port 3_2, Port 3_3, and Port 3_4, Port 2_2, Port 2_3, and Port_2_4.

4. Rename the respective LEDs

5. Add CapSense and follow the published instructions for “COSMOS 2008 Cluster 1, LAB 5” to set up CapSense to work with the PSoC Board.

6. Write main.c

7. Build the program using the ImageCraft compiler.

8. Plug the MiniProg into the board and program using the PSoC Programmer

9. Wire the board to the respective LEDs as well as grounding the boards for power.

10. TEST! Slide finger across CapSense to Port 5_4. Stop your finger at traffic light. Watch as the signals synchronize, and go on green.

Synchronized Traffic Signals

By: Govil Gupta, Eric Harmatz, Avneesh KohliUCSD COSMOS 2008

Cluster 1: Adventures in Embedded Computer Systems

Source Code

Acknowledgements

Dr. Rajesh GuptaDr. Choon Kim

Ms. Shirley MirandaMr. Arash Arfaee

Ms. Bridget Benson