Library Chair

From ESE205 Wiki
Revision as of 21:53, 10 December 2017 by J.zucker (talk | contribs)
Jump to navigation Jump to search

Overview

It's a Wednesday night. You're sitting in your room watching Netflix, putting off studying for your exam next week. You're cozy in bed, and it's cold and dark outside, plus your suite-mate just said he's ordering Domino's and there might be a slice or two left over for you. Every fiber of your being is willing you to stay home, eat, and watch TV, but that nagging voice in the back of your head tells you that you're a Wash U student damnit, and you'd better take this exam seriously! So you muster up some energy and get the kid on your floor who is in the class with you to walk to the library and study for a bit. When you guys get there, though, you see that every seat in the library is taken! ARGH!!

Few things are more annoying than when you decide to actually go study but then can't because there isn't an open spot for you in the library. Enter the Library Chair. In simple terms the Library Chair system consists of an interactive chair and a web interface. The chair can detect when someone is sitting in it, and this information is then relayed (via a few arduinos and a raspberry pi) to a website which displays a map of all the chairs in the library and which ones are occupied. You can check this website from the safety and comfort of your own room; no more cold walks to the library that end up being futile!

For more specific information on how the system operates, please look at the "Design and Solutions" section of this wiki.


Library Chair Log

Team Members

Nick Blenko
Tom Howe
Josh Zucker
Our wonderful TA, Mo Wu
And our adviser, Professor Morley

Objectives

Our group's main objective is to create an interface that library goers can use to see which seats in the library are available, and which are occupied. This interface is dependent on voltage data obtained from a circuit hooked up to an arduino and affixed to the bottom of a library chair. When a human body moves close to the circuit, i.e when someone sits down in the chair, the output voltage changes and chair occupancy can thus be determined. This circuit will then communicate occupancy and location data to another arduino connected to a raspberry pi. The raspberry pi will in turn communicate this data to a web server. We are aiming for the circuit/arduino device to be accurate, low energy, and completely powered by solar panels.

As individuals we are simultaneously working on a few different smaller goals. These include: finalizing the circuit that will detect when someone is sitting in the chair, figuring out how to communicate effectively between the arduinos and how to generate the wave function necessary for the circuit to operate from an arduino, integrating a solar power source into the circuit, communicating data from the raspberry pi to a web server, and designing and implementing an aesthetically pleasing web interface.

Challenges

  • Learning how to use the TI microcontrollers. This proved to be too difficult, so we adapted and used arduinos instead.
  • Rebuilding the circuit after someone burned it in the lab
  • Getting accurate current and voltage readings from solar panels/batteries
  • Needing to find a new ADC solution after realizing the built in arduino ADC was not powerful enough

Gantt Chart

An outline for the breakdown of duties and the timeline of the library chair project.

Budget

  • Chair: Cost Varies - (donated by Professor Morley)
  • Raspberry Pi: $35.00

https://express.google.com/product/385505035318354406_8630599681660487108_6136318?mall=WashingtonDC&directCheckout=1&utm_source=google_shopping&utm_medium=product_ads&utm_campaign=gsx&dclid=CJ31z4iVq9cCFYIpaQodZkUNkg

  • Solar cells: $8.69

https://www.amazon.com/gp/product/B073Y67Z5L/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1

  • Resistors/Capacitors/Diodes: (provided by school)
  • Wire: (provided by school)
  • Web Server: $12/Year

https://domains.google/?gclid=Cj0KCQiArYDQBRDoARIsAMR8s_ScLqI_DH4AD7z6oBy_tVey4H-jz4VXtbH8GBIPOwqxhcrwV_F713gaAuZXEALw_wcB&dclid=CJiflsmVq9cCFRYxaQodTZYPtA#/

  • Bluehost Account $3.99/Month

https://www.bluehost.com

  • RF Link Receiver (433 MHz) $4.95

https://www.sparkfun.com/products/10532

  • RF Link Transmitter (433 MHz) $3.95

https://www.sparkfun.com/products/10534

  • 2x Arduino Uno - one provided by school, one bought at link below for $27.95

https://www.amazon.com/gp/product/B008GRTSV6/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1

  • External 16 bit ADC converter 14.95

https://www.adafruit.com/product/1085

  • Rechargeable Batteries $19.98

https://www.amazon.com/gp/product/B00HZV9TGS/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1

Total: $139.44 (Total assumes 1 year subscription to web server and 3 month subscription to bluehost account)

Group Presentation

Link to the presentation

Design and Solutions

Module #1: Detect whether someone is in the chair

1.1 Construct RC circuit that outputs variable voltage depending on total capacitance

Figure 1.1 - The circuit used to detect occupancy based on peak voltage in the circuit.

1.2 Manage voltage flow going into circuit

1.3 Measure voltage flow exiting circuit, and analyze to determine occupancy

Figure 1.2 - The ADC used to increase the sensitivity of the circuit detection.

Module #2: Relay occupancy data to attractive web interface via raspberry pi

2.1 use RF communication to send data from one Arduino to another

Figure 2.1 - The RF Transmitter used to send data from the Arduino that detects occupancy to the Arduino connected to the Raspberry Pi.

2.2 communicate from the Arduino to the raspberry pi

2.3 use data input into the raspberry pi to create a handsome web interface displaying which seats are occupied and which are not

Communicating Chair to Processor

IMG 6343.jpeg Integrated Circuit and Arduino

Solar Power

The system of batteries and Solar Panels used to power the Arduino.

Server

    • insert screenshots of code and pi connections**

There were a few steps in setting up our Raspberry Pi server that would relay information from the Arduino to the website interface.

  • Downloading basic Raspberry Pi code (NOOBS) onto a microchip
  • Launching the Raspberry Pi using USB inputs of a keyboard and a monitor
  • Operating a VNC viewer to develop code for the Pi and HTML code for the interface side by side
  • Creating code on the Pi such that it automatically launches on a computer (in VNC Viewer) if connected only by Micro USB Power Source
  • Building code on the Pi server that would be able to automatically rewrite HTML code based on input
  • Writing code in the server that would allow for communication with the Arduino

Initial Launch of the Pi

Necessary Materials

  • Raspberry Pi 3
  • Micro USB (power source)
  • Micro SD card
  • Monitor
  • Mouse
  • HDMI Cable

To initially launch the server, we must first download the necessary preliminary coding found on the official Raspberry Pi website. We do so by using our Micro SD card and plugging it into a USB port on a computer with internet access. We then make sure the Micro SD is clear of all information (if reusing a Micro SD card, be sure to clear using formatting protocol explained on website **insert instructions/reference**). We then download the code off of the website, move the downloaded files to USB input, and wait for the information to copy. We then safely eject the Micro SD card and remove it from the USB. NOOBS is now loaded onto the Micro SD Card.

We then connect the Raspberry Pi to its power source by connecting the Micro USB to the Pi and a Computer (any power source would suffice). We connect a keyboard and a mouse to the Raspberry Pi through USB, and connect the Pi to a monitor using an HDMI cord so we can operate the pi. Now that NOOBS is downloaded and the Pi is fully plugged in, we may code on the Pi as if it were a computer.

VNC Viewer and Automatic Launch of the Pi

Steps:

  • Downloading VNC Viewer
  • Identifying Raspberry Pi IP address
  • Enabling VNC viewer on the Pi
  • Editing the Pi start code to include connecting to the VNC Viewer

Building Pi Code to Automatically Rewrite HTML Code

  • Connecting the Pi to Wifi
  • Using Beautiful Soup function
  • Plugging in location of output in corresponding Pi and HTML code

Communicating with Arduino

Steps:

  • Setting up wired connection between Arduino and Pi
  • Writing program in Pi **attach code** that allows for Arduino connection

Interface

To create the interface, we first bought the domain www.librarychair205.com. We then got a third party account at BlueHost, where we could manage our domain. In order to upload code to the domain, it involves creating an FTP account, using Filezilla to upload to that FTP account, using Atom to write code in html so it is compatible with the FTP account, and being able to grab the data from the RaspberryPi server.

Our steps:

  • Generate functional HTML code in Atom
  • Save the HTML code in index form to be compatible with Firezilla
  • Set up the connection between the Firezilla account and the online server's account and IP address
  • Upload the FTP file to Bluehost