F16: Autonomous Runaway Alarm Car

From Embedded Systems Learning Academy
Revision as of 22:26, 20 December 2016 by 146 user14 (talk | contribs) (Parts List & Cost)

Jump to: navigation, search

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Project Title

Abstract

The Autonomous Runaway Alarm Car is a mobile alarm clock designed to really get people out of bed in the morning. When the alarm goes off, the Runaway Alarm Car starts moving and starts playing an annoying sound or song, forcing the user to chase it around to stop it. This car is capable of detecting obstacles and avoiding them.

Objectives & Introduction

Show list of your objectives. This section includes the high level details of your project. You can write about the various sensors or peripherals you used to get your project completed.

The objective of this project is to create a car that has the functionalities of an alarm clock and be able to avoid obstacles.

  • Set a timer on the board
  • Display the timer
  • Produce a noise with the buzzer after the timer runs out of time
  • Have the car move forward and avoid obstacles using IR sensors when the timer reaches 0
  • Turn off the alarm car by pressing a button on the car

Team Members & Responsibilities

  • Jonathan Chen
    • Designed the structure of the car
    • Programmed the SJOne board to run the DC motors
    • Implemented the logic for obstacle avoidance
  • Andrew Javier
    • Implemented the timer task
    • Programmed the IR sensor task
    • Programmed the buttons to turn on the alarm car

Schedule

Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.

Week# Start Date End Date Task Status Completion Date Notes
1 11/07 11/13 Order the parts Complete 11/10
2 11/14 11/20 Determine design of the car, begin building Complete 11/19
3 11/21 11/27 Build the car Complete 11/23
4 11/28 12/04 Program the car (phase 1) Complete 12/02
5 12/05 12/11 Program the car (phase 2) Complete 12/11
6 12/12 12/20 Testing, write the report, make the video, demo Incomplete

Parts List & Cost

Qty Vendor Description Price
1 San Jose State University SJ-One Board $80.00
1 Amazon Emgreat 4-wheel Robot Smart Car Chassis Kit $23.99
1 Amazon Qunqi L298N Motor Drive Controller Board Module Dual H Bridge $6.99
16 Excess Solutions Wires $0.76
2 Amazon GP2Y0A21YK0F IR Sensor $17.99
1 Radio Shack AA Batteries (4 Pack) $4.99
1 Radio Shack 4 AA Battery Holder $2.99
1 Radio Shack Universal Breadboard $9.99
1 Fry's Electronics Male/Female Jumpers (10 Pack) $3.99
1 Fry's Electronics Female/Female Jumpers (10 Pack) $3.99
1 SJSU Bookstore Dual Sided Tape $3.28
1 Amazon LCD1602 Monitor $8.49
Total $167.45

Design & Implementation

The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.

Hardware Design

Discuss your hardware design here. Show detailed schematics, and the interface here.

Figure 1. Hardware Block Diagram: System Overview

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.

GPIO

Much of the functionality of this project involved the use of the GPIO functionalities of the SJ One Board. During the timer set portion of the project, the GPIO ports use the switch buttons to manipulate the time as well as set the alarm. In both the timer set and countdown portions of the project, the 7-segment display and on board LEDs are used to display the amount of time left before the alarm goes off. For the remaining tasks of the project, the GPIO pins are used to connect to the H Bridge to control the direction of the wheels.

GPIO: Pin Connectivity Table

Item Port.Pin Direction Peripheral Peripheral Port
1 P1.0 Output SJ One Board LED0
2 P1.1 Output SJ One Board LED1
3 P1.4 Output SJ One Board LED2
4 P1.8 Output SJ One Board LED3
5 P1.9 Input SJ One Board SW0
6 P1.10 Input SJ One Board SW1
7 P1.14 Input SJ One Board SW2
8 P1.15 Input SJ One Board SW3
9 P1.19 Output H Bridge IN1
10 P1.20 Output H Bridge IN2
11 P1.22 Output H Bridge IN3
12 P1.23 Output H Bridge IN4

ADC

The ADC pins were used to interface the IR sensors with the SJ One Board. These sensors send an analog signal to the board which is then converted to a numeric value with the on-board function of the SJ One Board. This value is used to determine how close an object is to the front of the car which is used to control whether the car goes straight, turns left, or turns right.

ADC: Pin Connectivity Table

Item Port.Pin Direction Peripheral Peripheral Port
1 P0.26 Output IR Sensor Vo
2 P1.31 Output IR Sensor Vo

PWM

The PWM pins serve two purposes in the project. Its main function is to control the speed of the wheels of the alarm car. The speed is manipulated by changing the amount of time within the PWM frequency stays at high. The more time the wave is set at high, the faster the car moves. It is also used to sound the buzzer of the alarm car since it requires some sort of frequency to make a sound.

PWM: Pin Connectivity Table

Item Port.Pin Direction Peripheral Peripheral Port
1 P2.2 Output H Bridge DC Motor 1
2 P2.4 Output H Bridge DC Motor 2
2 P2.5 Output Buzzer -

SJOne Board

Figure X. SJOne Board

L298N Dual H-Bridge

Figure X. L298N H-Bridge
Figure X. L298N H-Bridge

IR Sensor

Figure X. IR Sensor
  • Each IR sensor has three wires. The three wires consist of a ground, power, and Vo. The power is supplied from the 6.4V battery box. The ground wire is tied to the common ground of the battery box and the SJOne board. The Vo wire is connected to appropriate GPIO pins from the SJOne board.
Figure X. IR Sensor Block Diagram

Buzzer

Software Design

Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.


Figure X. Algorithmic State Machine Chart



Figure X. Task Chart

Implementation

This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.

  • ADC through the SJOne board

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

LCD Display

  • Problem

Initially, the project called for the implementation of the 1602A v2 LCD Display to be used to display the time. The first issue with the board was the lack of datasheets available for the display. The closest datasheet for this display module was for v1.2, although that datasheet was vague. To minimize the number of pins needed for the LCD display, we decided on using it in 4-bit mode. The datasheet for v1.2 of the display showed that 4-bit mode was possible, but said little about implementation of the mode.

  • Solution

As a workaround to this issue and to retain the alarm clock-like functionalities of the project, we decided to use the on board 7-segment display and LEDs to indicate the amount of time left before the alarm goes off. The 7-segment display represents the amount of minutes and the LEDs give an indication of the number of seconds before the alarm goes off. Within the final minute of the countdown before the alarm, the 7-segment display will show the time remaining before the alarm goes off and the car starts moving.

The workaround involves two tasks: one to set the timer and the other to count down to 0. In the timer set task, the user uses Switches 0 and 1 to set the time needed to elapse for the alarm to go off. Switch 0 increments the timer to 1 minute while Switch 1 resets the timer in case the user goes too far. When the user has the desired time set, Switch 2 is pressed which allows the RTOS to context switch to the countdown.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

This project could not have been completed without the guidance and assistance of the following people:

  • Dr. Haluk Ozemek
  • Preetpal Kang
  • Charles MacDonald
  • Praveen Prabhakaran

References Used

Datasheets

Links

Appendix

You can list the references you used.