Wednesday, May 25, 2016

Inspiration Behind My Project

As an eager Computer Science student, I am ready to create and invent. As all college students know,  it can be very hard to keep up with everything going on in your life, i.e., homework, social life, and work. Then, when you add bad memory to your life, it doesn't make it any better. Luckily, I am in a class that requires me to work on a project using the Raspberry Pi, that will be presented to our department at the end of the semester. Immediately, I wanted to make something that could help me with my memory and increase my productivity. For my project, I decided to do a wall mounted calendar/notification center. For functionality, I wanted to make sure I could add events throughout the day and view them when I get home. This would make sure I stay on track and complete tasks daily!

Friday, April 22, 2016

Python Script For Buttons


Coding Button In Python

Uinput Module
GPIO Module




Python Code:

import RPi.GPIO as GPIO
import time
import uinput
import os

GPIO.setmode(GPIO.BCM)

GPIO.setup(19, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)

time.sleep(1)
device = uinput.Device([uinput.KEY_F5])

view = 'm'

while True:
    input_state_back = GPIO.input(19)  
    input_state_forward = GPIO.input(20)
   
    if input_state_back == False:
        print('Button F5 Pressed')
        device.emit_click(uinput.KEY_F5)
        time.sleep(0.5)
    if input_state_forward == False:
        print('Button Reboot Pressed')
        os.system('sudo reboot')
        time.sleep(0.5)

Buttons On The Pi

Now that my Raspberry Pi loads the webpage on startup, I want to be able to refresh the page and also restart the Raspberry Pi. The Pi has components built onto its motherboard that will allow me to add this functionality. The main parts I will be utilizing to do this is GPIO pins, T-Cobbler, Breadboard, Jumper Wires, and push button switches.

Raspberry Pi Component Outline

Description of GPIO Pins:

GPIO stands for General-purpose input/output. For each pin it is possible to set it as a input or output.  These decisions are set at run time. For example, running a python a script that sets pins to be input are output would be considered run time.



Ribbon Cable(Left) and T-Cobbler(Right)




Description of T-Cobbler:

In the above picture you see two items. The Ribbon Cable has two connector ports located on both ends. One end of the Ribbon Cable will connect to the GPIO pins on the Raspberry Pi and the other end will connect to the top of the T-Cobbler. This will correctly map the pins to the numbers on the T-Cobbler so you can easily connect to the right GPIO pin.

Breadboard




Description of Breadboard:

According to Wikipedia, it is a board used for making experimental electrical circuits.



Jumper Wires


Description of Jumper Wires:

The Jumper Wires are used on the breadboard to connect components. Also, it transfers the electronic signals on the breadboard.


T-Cobbler, Jumper Wires, Push Buttons, and Ribbon Cable










Wednesday, April 20, 2016

Starting Webpage On Startup

In order for my project to work as expected, I need to be able to constantly view a webpage. For convenience, it's important to make sure the webpage starts automatically. On the Raspberry Pi you are able to put certain commands in a specific place to make sure it starts at boot up.

The web browser I use is called Iceweasel and can be installed in less than 3 minutes. The reason I used Iceweasel, is because you can view any website in full screen, set a certain website to run on open, and you can customize the appearance of any website.

Link To Download Iceweasel
Customizing Webpage With Iceweasel

After downloading Iceweasel, I configured the autostart file to allow me to load my website using Iceweasel automatically.






 


Setting Up Auto Start for Iceweasel:




           


Webserver On The Pi

Tools Needed:
  • Raspberry Pi
  • Wifi

Tips: You may run into a problem with not being able to edit the default index.html file. This is because you need to grant your user to have root access to your pi. That step is also included in the guide linked above. Also, don't forget to restart apache after you make any changes to any file concerning the Apache web server. I would make changes and expected to see the results but, I did not restart the Apache web server. This tip should save you ample time!







Saturday, April 9, 2016

LCD Screen

Instead of buying a new LCD screen for my project I will just use the screen from my old worthless laptop. I did some research to find out if this was possible and turns out it definitely is. I found a youtube video for screen removal for my laptop(Gateway NE56).
LCD Removal










Now that my screen is removed, I need to be able to connect my Pi to it. A piece that allows me to do that is a comparable controller board. A controller board is a board that have the same input/outputs your laptop had before you disconnected the screen. In order, to find my comparable controller board I needed to use the S/N tag from the back of the LCD screen.

(Cracked Iphone 6 Camera)



(Controller Board)





Here is a picture of my Pi, Controller Board, and LCD screen connected. Furthermore, the controller board and the Pi have separate power supply. However, you could solder a usb cord to your controller board and use that as power for the Pi.