Eco-Flow Smart HVAC System

This is a draft
eco-1.png

Result #

Webcast

Capstone Experience #

The capstone project is the culmination of one’s experience in college. The foundation, each brick, supports the cap. Everything I was exposed to contributed to the project. GWU CS Senior Design Paper

Capstone Arch

                            ^----/......./---.^                            
                         .--.    :^     ^/   ^.--.                         
                      ^:+^       ^/     /        ^+:^                      
                    ^:-  :-       -:..^:.       -:  -:^                    
                   -:     ./-.-:--..^^^..--:-.-/.     :-                   
                  /.       ^+-^             ^-+^       ./                  
                 :.:-    ^:-                   -:^    -:-:                 
                --  ^:-.-/^                     ^/-.-:^  .-                
                /     ^/+                         +/^     /                
               .-      :.                         .:      -.               
             --/:-----:o                           o/-----:/--             
             /         +                           +         /             
             /        ^+                           +^        /             
             /        -+                           +-^       /             
             --/:----/+o                           o----:++/--             
               ::----^ +                           +.---^ .:               
               ::^ ^---o                           o.  .--::               
               :/:-.^ ^o                           o:--^ ^::               
               :-^^---.+                           +^^.----:               
               -/-.  ^-o                           o:-^ ^-::               
               :-.---. +                           +.---. .:               
               ::.  .--o                           o.^ ^--::               
               :/:--^  o                           o::-.  -:               
               :-^^.--.+                           +^ .----:               
               -++/-...+                           o+/:...:-               

email.png

options.png

Jeff, Vick,

Welcome to your SD team!  Please see my recent email to all SD Troopers about what the next steps are.  You can find your team's Trello board @ https://trello.com/b/~private~.  Your project (vaguely described to allow you creativity) is:

Embedded: micro-climate furniture. By some estimates, the U.S. spends approximately 40% of its energy on indoor climate control. Much of this is inefficient because large volumes of indoor space are heated/cooled simply to cool individuals. This project will design office furniture with in-built AC/Heater for micro-climate control around an individual. The project will involve embedded systems (control of HVAC) and sensors (thermal). This project is a grand-challenge ARPA project.
- What to start with: learn Raspberry-PI programming, control a motor, investigate how to build a small HVAC, identify suitable furniture (movable desk/chair) to allow piping. Talk to graduate student Andrei.

Best,
Your SD Mentors (Gabe and Simha)

This was the initial specification we were given. When working on long term projects, the goals are constantly changing and evolving. We’re constantly “pivoting”, and changing the business goals.

Technical Stuff #

Components #

architecture.png
This is overall architecture we developed. They could be divided into the software(Where we analyze information from the world) and hardware(Actuation, where we act on the information) components. This prototype represents a PID controller with only a P since we’re assuming there is no error or drift by the components in this scenario.

Software #

Image Analysis (analysis_aggregator.py) #

Image analysis is responsible for analyzing the FLIR Lepton images. It sends the images to the services through the broker.

#### Establish the Service Clients
person_detection_client = MajorDomoClient("tcp://127.0.0.1:5555", verbose)
grid_client = MajorDomoClient("tcp://127.0.0.1:5555", verbose)
person_info_client = MajorDomoClient("tcp://127.0.0.1:5555", verbose)

We receive the message from the image worker(lepi_subscriber.py) and forward them to each service.

message = analysis_receiver.recv()
grid_client.send("grid", message)
person_detection_client.send("person_detection", message)
person_info_client.send("person_info", message)

This shows all the processing done by each service.

Image Worker (lepi_subscriber.py) #

The subscriber is responsible for receiving images from the lepton. If the server is unable to read frames fast enough the Lepton will have probelems syncing.

Hardware Controller (hardware_controller.py) #

The hardware controller fans out json commands for each hardware component depending on the analysis sent by analysis_aggregator.

Image Services #

These services are all given the raw image frames as bytes. We convert them into LePi objects located in /lib/lepi/server.py

Person Detection (person_detection.py) #

We use an SVM for detecting a person in the frame. The classification is done on a normalized lepton image, meaning instead of dealing with raw temperature values we put them on a scale of 0 to 255.

We have found these parameters to be effective.

win_size = (80,80)
block_size = (16, 16)
block_stride = (16, 16)
cell_size = (16, 16)
num_bins = 9
hog_size = (24, 24)

Person Position / Average Temperature (person_position.py) #

We use the central moment of the largest connected component of an image that we applied a threshold to.
This lets us determine where our thermal endpoints should point. In addition to telling the position we also get the average temperature by getting the average temperature of each point of the human and convert it to Fahrenheit.

Getting the To(Observed Temperature) real temperature of a pixel. This is equation. There are missing parameters like the sensor temperature and the outside temperature.

Ax + By + c = To
x = pixel value
y = temperature of the sensor

We get the surface temperature of our subject at multiple places. We did it on 5 particular spots.

Then we solve the equation. Since we know the observed temperature we solve for the coefficients A, B, C

Once they have been solved for we know the mapping between the pixels values. We then do a thresholding and get the largest connected component. Then we get the
average temperature of each point on the thresholded image.

Once each point is computed we send the average back to the analysis aggregator.

Grid (grid.py) #

This was one of original ideas for the temperature calculation. We were to give each thermal endpoint a quadrant and calculate the temperature we needed to cool or heat for each square.

Raspberry Pi Service #

This service creates a connection to the LePi subscriber using zeromq and sends lepton frames. We use this library to grab frames https://github.com/cosmac/LePi. The service also runs a Flat Field Correction(FCC) every minute.

Adding a service #

To add a service create the py file in ./services directory.

To gain access to the lepton and zeromq libraries add this line.

sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib/lepi"))
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "lib/mdp"))

Extend from the Service Base Class. There are 2 different types of base components. Services and workers. Workers connect to the broker and follow the REQ REP pattern.
Below are examples of services.

class LePiSubscriber(Service):
    def __init__(self, name):
        super().__init__(name)

def main():
    service = LePiSubscriber("LePi Subscriber")
    if conf.DEBUG is True:
        sub.connect("tcp://127.0.0.1:2454")
    else:
        sub.connect("tcp://169.254.44.12:2464")
class ServiceWorker(Worker):
    def __init__(self, name, broker, service, verbose):
        super().__init__(name, broker, service, verbose)


def main():
    verbose = '-v' in sys.argv
    worker = PersonDataCollectionWorker("Person Data Collection", "person_data_collection", "tcp://127.0.0.1:5555", verbose)

For workers this line is extremely important. Since all services connect to the same broker the only thing that distinguishes the services apart are their names.

PersonDataCollectionWorker("Person Data Collection", "person_data_collection", "tcp://127.0.0.1:5555", verbose)
"Person Data Collection" - Titled used when debugging
"person_data_collection" - Component name
"tcp://127.0.0.1:5555" - Broker address
verbose - "Log levels"

Keep track of the endpoints being used.

Note: We began using the if conf.DEBUG ports to debug the individual components with services located in /tests/services/

If your service requires a model. E.g. An svm or the calibration matrix for the FLIR Lepton place them in ./models

Once you’re finished with that it would be advised to add the component to start.sh so you will not have to manually start each service.

Hardware #

Pan-tilt #

pantilt-full.png

pantilt-single.png

pantilt-mount.png
Mount designed by Chris Poole

Damper #

damper_floor.jpg

damper_top.jpg

damper_side.jpg

damper_axleMount.jpg

Damper_3dprint.jpg

IR Emitter #

Controlls the AC. Gives temperature control.
IR_topview.jpg

IR_topangle.jpg

Evolution #

Original architecture
[![IR_topangle.jpg](https://camo.githubusercontent.com/0e0182c3c6026507a42fe0e5457b6892f5af05ca/68747470733a2f2f67772d63732d73642e6769746875622e696f2f73642d31382d65636f2d6675726e69747572652f6173736574732f696d616765732f546865726d616c2d496d6167696e672d53746570732e706e67(https://camo.githubusercontent.com/0e0182c3c6026507a42fe0e5457b6892f5af05ca/68747470733a2f2f67772d63732d73642e6769746875622e696f2f73642d31382d65636f2d6675726e69747572652f6173736574732f696d616765732f546865726d616c2d496d6167696e672d53746570732e706e67)

Soft Skills #

Presenting #

Reflection #

 
6
Kudos
 
6
Kudos

Now read this

Hybrid Images

This post is about hybrid images with Python. I will be following the approach described in the SIGGRAPH 2006 paper. Approach # The technique described in the paper takes a pair of images, and takes the high frequency of 1st image and... Continue →