Team Progress Report for Team-AI

Project Topic: Smart Aquarium

Team Member: Jiangwen Wei, Xiangchao Wang, Yue Cao, Yilin Wang

1.   Current Progress

1.1  Project Review

We planned to build a smart micro-biosystem called “Smart Aquarium” that can detect and feedback upon the environmental changes. It was motivated by the thoughts of human-computer interaction in current world and the concerns about nature protection. The system, consist of water and soil environment, was designed to use four sensors (Figure 1-1). The whole system is supposed to react individually to the environment changes through a programmed control center

 

图片包含 屏幕截图

描述已自动生成

Figure 1-1 Diagrammatic sketch for the Smart Aquarium

1.2  Purchase Review

We have figured out our purchase list and prepare for buying the items mostly through Amazon, the purchase list is showed on Table 1-1:


 

Table 1-1 Purchase Table for Project

Item name

Quantity

Price

Aqueon 10-Gal Black Aquarium

1

$30.00

Source one LLC 1/8-Inch-Thick Acrylic Plexiglass Sheet

1

$14.99

RGBZONE 1M 1.17mm 28AWG 40PIN Wire Flat

1

$6.99

DEYUE Solderless Prototype 830 tie Points Breadboard

3

$7.99

Sanniu Led String Lights, Mini Battery Powered Copper Wire Starry Fairy Lights

1

$6.99

YEECO DC 3.5-12V 9V 6V Water Pump

2

$12.99

LLC Food Grade Vinyl Tubing – 10ft 5/16 ID 7/16 OD

1

$5.49

 

1.3  Programming Progress

The four sensors work as relatively independent sections from each other. We have not only finished building the logic loop for these sensor systems but also nearly finished the python code apart from some test experiments (Figure 1-2). The following will illustrate the progress of Progress one by one.

 

Figure 1-2 Python Code for Sensors

Ø  DHT11 Temperature & Humidity

The DHT11 sensor has passed the test experiment, the python code is posted as following:

 

import RPi.GPIO as GPIO

import time

 

data = []

j = 0

 

GPIO.setmode(GPIO.BOARD)

 

time.sleep(1) #GPIO.4

GPIO.setup(4, GPIO.OUT)

GPIO.output(4, GPIO.LOW)

time.sleep(0.02)

GPIO.output(4, GPIO.HIGH)

GPIO.setup(4, GPIO.IN)

 

while GPIO.input(channel) == GPIO.LOW:

           continue

while GPIO.input(channel) == GPIO.HIGH:

           continue

 

while j < 40:

           k = 0

           while GPIO.input(4) == GPIO.LOW:

                     continue

           while GPIO.input(4) == GPIO.HIGH:

                     k += 1

                     if k > 100:

                                break

                     if k < 8:

                                data.append(0)

                     else:

                                data.append(1)

                     j += 1

 

print "sensor is working."

print data

 

humidity_bit = data[0:8]

humidity_point_bit = data[8:16]

temperature_bit = data[16:24]

temperature_point_bit = data[24:32]

check_bit = data[32:40]

 

humidity = 0

humidity_point = 0

temperature = 0

temperature_point = 0

check = 0

 

for i in range(8):

           humidity += humidity_bit[i] * 2 ** (7-i)

           humidity_point += humidity_point_bit[i] * 2 ** (7-i)

           temperature += temperature_bit[i] * 2 ** (7-i)

           temperature_point += temperature_point_bit[i] * 2 ** (7-i)

           check += check_bit[i] * 2 ** (7-i)

 

tmp = humidity + humidity_point + temperature + temperature_point

 

if check == tmp:

  print "temperature :", temperature, "*C, humidity :", humidity, "%"

else:

  print "wrong"

  print "temperature :", temperature, "*C, humidity :", humidity, "% check :", check, ", tmp :", tmp

 

GPIO.cleanup()

Ø  HC-SR501 Infrared Motion Module

We have finished the coding and test process for infrared sensor, the python code is posted as following:

 

import RPi.GPIO as GPIO

import time

 

def init():#12:sensor out, named as gpio in

#11: relay in,set as gpio out

    GPIO.setwarnings(False)

    GPIO.setmode(GPIO.BOARD)

    GPIO.setup(12, GPIO.IN)

    GPIO.setup(11,GPIO.OUT)

    pass

   

       

def detct():

                     while True:

        if GPIO.input(12) == 1:

            GPIO.output(11, GPIO.LOW)

            print "People is here"

                                                               time.sleep(60)#LED on 60s

                                                               GPIO.output(11, GPIO.HIGH)

                                                               time.sleep(0.5)

        else:

            GPIO.output(11, GPIO.HIGH)

            print "Nobody"

                     time.sleep(6) #test every 6 second

       

 

init()

detct()

GPIO.cleanup()       

 

The first test for infrared motion sensor was successfully finished, the sensor can detect the motion of human beings and give a feedback to the LED light. (showed on Figure 1-3)

图片包含 室内, 墙壁, 地板, 就坐

描述已自动生成图片包含 墙壁, 室内, 地板

描述已自动生成

Figure 1-3 Test for Infrared Motion Sensor

In this test, the sensor was independently connected with the Raspberry Pi and an LED light also on the circuit. The details are showed on Figure 1-4.

图片包含 黑色, 室内, 餐桌

描述已自动生成图片包含 人员, 手, 掌握, 室内

描述已自动生成

Figure 1-4 Details for Circuit

Ø  Photosensitive Light Sensor Module

The code used for controlling light sensor has been written without testing and debugging.

Ø  Water Level Sensor Module

We have figured out how to use the water level sensor and written down the python code showed on Figure 1-2.

1.4  Presentation Progress

We are preparing the presentation part as well as the programming part. The website on Git-hub has been set up while the report on Wiki has been established with a fixed context. The Git-hub and the Wiki website are showed on Figure 1-5 and Figure 1-6.

图片包含 屏幕截图

描述已自动生成

Figure 1-5 Git-hub work Page

图片包含 屏幕截图

描述已自动生成

Figure 1-6 Wiki web-site Page for Group AI

1.5  Reflection

Several new Methodologies out of class are used in the programming and website part. We have learned something new based on our focusing on during the past two weeks. The reflections of our project have been summarized as follows. For programming part, we have a deeper understanding about Raspberry Pi and the appliance to GPIO function. With a collaboration between the electrical circuit and programming design, it can control the feedback part (such as an LED light or a pump) smartly using a replay outputting different electronic signal. Apart from the basic theories about the circuit, we also learn about the working principle of the relay and the normally open and normally closed design, the relay controls the realization of the external circuit. Designing and controlling the circuit design of multiple sensors working together using Python code.

2.   Problems Encountered

2.1  Programming Problems

Although we have finished the structural code on the four sensors, we still have a long way to go. We have concerns about the followings:

Ø  How to use Python code implements relay control for external circuits (such as pumps) or using python code to achieve digital-to-analog conversion.

Ø  How to connect sensor circuit to achieve digital to analog conversion and work in a multiple circuit.

Ø  How to calibration a reasonable parameter for a sensor.

Ø  Future problems: The water level sensor controls the precise problem of the water pump (it is difficult to accurately control the water pump to ensure that it does not exceed the upper limit of water); the human body infrared sensor is greatly affected by the environment; the external circuit and the relay are properly connected to ensure normal operation;

2.2  Physical Problems for the Project Demo

Apart from programming problems, there are some physic concerns about project if making up a project demo for presentation. The first problem is how to protect the electronic devices against leakage since the components such as the water pump are underwater, the waterproof performance of the self and the connecting line needs to be tested. Then, a specialized make place is needed with tools like cutting machines, drill bits, glue guns, etc. The issue has been initially solved since we found the lab on the second floor of Hams Hall with a workbench and tools that can be borrowed. But this is still a concern which is posted here in case there is any other help needed. Thirdly, there are potential problems in circuit design such as insufficient voltage, complicated lines and insufficient breadboard. It is supposed to have an extra power source for the pump and the relay circuit since it is impossible for a Raspberry Pi to provide all the power for the four sensor systems.

2.3  Html Problems

The Html Problems are mainly related to a java script for html and how to use Git-hub for a starter. It will be more friendly to a rookie if there is a tutorial for setting up a website. The project member will also learn by themselves.

3.   Future Plan

3.1  Sensor programming

Further work in programming should be processed but mainly focus on the collaboration between the code and the circuit. Besides, the control code on photosensitive light sensor and water level sensor has not been tested yet. The group are going to figure it out in one week.

 

Secondly, the group members are going to work on the system circuit design which controls the detecting part and feedback part. It will take about one week to going.

 

Finally, the group is planning to leave the last week for testing and further adjustment in case anything could possibly happen.

3.2  Website construction on Git-hub

Since the repository on Git-hub has been established, the following step on website will focus on the context and some UI design on the final version. The present website is blank and need a further detailed construction in the following weeks.

3.3  Tank assembly

This will be a kernel part of the future work because the tank is the most important part for demo presentation. The assembly will begin in not time once the circuit and code tests were done. It is estimated that tank assembly will be finished in last week although the group members will make their great efforts to finfish it as early as possible.

3.4  Presentation Preparation

The presentation preparation contains two part, one is the report and the other is the demo video. The report has been on the writing stage from last week and some parts will be upload on Wiki pages in this week. The demo video is supposed to begin on around Oct. 5th, which is this Friday.