Difference between revisions of "F12: Android Door Lock"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Software Design)
(Acknowledgement)
Line 270: Line 270:
 
=== Acknowledgement ===
 
=== Acknowledgement ===
 
Any acknowledgement that you may wish to provide can be included here.
 
Any acknowledgement that you may wish to provide can be included here.
 +
 +
Chris Cheng for helping us with UART1 that was much needed for the communication between the LPC2148 and Hercules.
  
 
=== References Used ===
 
=== References Used ===

Revision as of 03:20, 10 December 2012

Android Door Lock

Abstract

Using a Wifi connection, our door lock can be locked and unlocked remotely with an Android device.

Introduction & Features

  • UART communication between RN-XV WiFly Module and LPC2148 Microcontroller.
  • Andriod application that enables wireless door access.
  • WiFly module for wireless communication between Android and LPC2148 Microcontroller.
  • TCP communication running on LPC2148 handling requests from the Android application.
  • Web server to handle user permission, to set door codes, and to view time stamps of when the door was accessed.
  • MP3 player that allows customizable tunes to play when the door is unlocked.
  • Filing system that stores all the log times that the door has been accessed.
  • Electronic door strike that unlocks when door code is recognized.

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.

Team Members & Responsibilities

  • Rosemary Chen
    • Created the UART1 driver that enables communication between the wireless module and the micro controller.
    • Created the Real Time Clock driver used for logging the time that users access the door.
    • Created the user interface for setting and configuring the wifly module as well as automating the default settings for network connection.
    • Created a task for
      • Correct password detection
      • Enabling the lock when password is detected
      • Logging the time when the door is accessed
      • Playing a tune when the door is unlocked.
  • Cindy Li
    • Created the web server that allows the host to track door users, enable or disable users, and sets the door code.
    • Created the door lock driver circuit that supplies the required 8v
  • Hai Wang
    • Create a TCP client Android application that allows connectivity between the wireless module (server) and the Android application (client). The application is responsible for sending the correct door code to the server in order for the door to unlock.

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.

Cost of shipping and handling excluded

Week Number Scheduled Items Actual

November 2, 2012

  • Set up environment (Android)
  • Confirm/order parts
  • Update Wiki

Done

November 9, 2012

  • UART 1 Driver
  • Wifly driver
  • Android app UI
  • Update Wiki

Done

November 16, 2012

  • Android to LPC2148 communication
  • Automate default WiFly network connection
  • Start Web server
  • Update Wiki

Done

November 23, 2012

  • Construct door lock mechanism circuit
  • Write driver for GPIO to enable and disable lock
  • Continue with Web Server
  • Update Wiki

Done

November 30, 2012

  • Enable MP3 to play when door is opened.
  • Continue with Web Server
  • Update Wiki

Done

December 7, 2012

  • Write Real Time Clock Driver
  • Create a task for time stamp logging
  • Construct box to contain messy wires and modules
  • Write task for count down door unlock
  • Update Wiki

In progress

December 14, 2012

  • Testing
  • Fix bugs
  • Update Wiki

In progress

Parts List & Cost

Give a simple list of the cost of your project broken down by components. Do not write long stories here.

Parts Cost

Nexus 7 Android Tablet

$249.00

RN-XV WiFly Module x3

$34.95 x3

Electric Door Strike

$12.00

LPC2148 Microcontroller

$60.00

**Cost excludes shipping and handling

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.

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.


SPI BUS

The LPC2148 Micro-controller communicates with the SD Card and the MP3 Decoder through the SPI bus. For both the SD Card and the MP3 Decoder, the chip select is transmitted through the SPI bus. For the decoder, data request and reset is also transmitted through SPI. The SD Card transmits MP3 data into the MP3 decoder. Once the decoder is done processing this data, it is then outputted into the I2C bus to the DAC.


I2C BUS

The LPC2148 Micro-controller communicates with the DAC and the MP3 Decoder using the I2C bus. The MP3 decoded data is outputted into the DAC so that it can convert digital signals into analog signals. The analog signals will be the sound produced out of our head phones which is connected to the audio jack. The micro controller can also send signals via I2C to the DAC to control volume, bass, treble, etc.


UART BUS

The uart bus allows communication between the LPC2148 micro-controller and the laptop as well as the WiFly module with the LPC2148. For the LPC2148, there are only two UART pins. In this case, UART0 is the connection between the computer and the micro-controller and UART1 is the connection between the micro-controller and the WiFly module. For the programmer to communicate with the WiFly module, the programmer would first have to send data to the LPC2148 micro-contoller through UART0, then redirect the data to the Wifly module using UART1. Once the WiFLy has received the data which may contain commands, the WiFly will respond by transmitting the requested data back to the LPC2148 via UART1 and from the LPC2148 back to the computer via UART0 so that the programmer can view the data that the Wifly transmitted.


GPIO PORT

The GPIO port is used to enable or disable the door lock. When the LPC2148 micro-controller recognizes a key code that is sent from the Android, it will send 5v through the GPIO which is connected to the door lock circuit.


Door Lock Circuit

The 5v supplied by the LPC2148 from the GPIO port is not sufficient to power the door lock so a small circuit was made to supply 8v to the door lock.

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.

User Interface Task

User input

WiFly Task

Password

MP3 Task

Mp3

Real Time Clock Task

RTC

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.

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:

Wifi Connection Issues

Many wifi connection issues were encountered. To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.

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

Send me your zipped source code and I will upload this to SourceForge and link it for you.

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

Chris Cheng for helping us with UART1 that was much needed for the communication between the LPC2148 and Hercules.

References Used

Appendix

You can list the references you used.