Malavika Status Report 10/30/21

This week I was able to run the source code following the tutorial I found online to allow a user to ultimately control the PIR sensors and microphones. The website contains JavaScript that controls the 4 LED lights on the breadboard which is triggered by events such as a mouse click on the appropriate button or sliding the toggle button. The webserver is started on the Raspberry Pi terminal using node js and is run locally, which allows users to visit the webserver on any device by going visiting the ip address of the Pi on which it is running. Web sockets are also used to establish a connection to the client’s browser which allows the server to then send appropriate data to the specified GPIO pins. At the moment, the GPIO pins are controlling LED pins (as illustrated in the image below) but our final project will entail the LED strips being connected directly to the GPIO pins on the Raspberry Pi.

During our weekly meeting with Professor Yu and our TA, I received feedback saying the webserver portion of the project needs to be better motivated and justified. Currently, the scope of the webserver is just to allow users remote control access to the LED grid. However, in order to address this, I decided to incorporate a feature that will allow users to determine the weight of each sensor (microphone vs PIR) when the Raspberry Pi is deciding which thread count to decrement according to the presence of sensor data.

At the moment I am just incorporating buttons that allows users to specify to the central Hub to ignore data from microphones or PIR sensors. This will be done by using the MQTT protocol. The webserver will instantiate MQTT messages whenever buttons to toggle sensor weights (and turning on the light) are pressed and publish this to the destination of the communicate.py code running on the Raspberry Pi. The central code can then check for which messages are incoming using cases and send a signal to the appropriate thread in control of the LED grid section.

We plan on implementing this using a block signal (sent from the webserver in the event of a button click to turn an LED on) that the central communication code will place onto a queue of messages for the thread to process. If this block signal is seen by the thread, it will stop decrementing the counter for the light switch which turns off when the count is set to 0. Likewise, an unblock signal will be sent if the user turns off the button for the lightswitch which will eventually signal the thread to start decrementing again.

Diva-Oriane Marty Status Report 10/30/2021

This week Ryan and I worked on testing receiving input data from two different microcontrollers connected to different sensors. In the picture below you will see the two microcontrollers both sending data being received from two opposite facing PIR sensors. Next week, we need to make sure that the IDs of the microcontrollers are recognized by the base station.

I worked on looking for new microphones and ordering them. We ordered three types of microphones. Amongst these microphones, we have another copy of the previous type microphone in case the lack of signal (even after soldering) was due to a defect.  We will test them early next week.

I also worked on writing a threading script in python that works with simulated sensor data. Based on incoming sensor values, the thread corresponding to a work station modifies the work station’s score.

I implemented this in code:

The code is here

The code works, but the score values are random, so next week I want figure out a logic behind the score constants and timeout constants. I also want to have some idea of potential microphone thresholds from the new microphones we have ordered. In addition, I want to talk  through the web app with Malavika to figure out what other inputs the base station’s code needs to account for.

Ryan Gess Status Report 10/23

This week I focused on our ethics assignment and setting up our communication. The exercise on ethics was helpful and we received a lot of good feedback on our project about issues that we hadn’t considered before. Specifically, knowing the location of people in a room can give an adversary ability to do more harm.

Setting up our devices on CMU-DEVICE wifi proved to be a little more challenging than expected. This set us a little behind schedule but I think we are still on track as this week I successfully registered and connected all of our ESP8266 microcontrollers to CMU-DEVICE as well as the Raspberry Pi. This will help with testing as we won’t need to wire our entire system together. Now that these are setup, we can focus on setting these up with our sensors so we can do more exhaustive testing.

This site https://vimalb.github.io/IoT-ESP8266-Starter/ was particularly helpful in connecting ESP8266 to wifi and learning Mosquitto (communication protocol for IoT applications). Essentially it works by setting up our Raspberry Pi as a MQTT broker and publish messages to it from our sensor microcontrollers. Messages require a topic and a payload and each have a unique client identifier so we know which controller / sensor our message is coming from.

Malavika Status Report 10/23/21

This I made progress on the templates and static files for our website (as pictured below) as well the ethics assignment we had. For the ethics assignment, we read two articles, one by a historian, and the other by the ethics guest lecturer we saw in class in Wednesday that highlighted how we should think about the design decisions we make as engineers and how it affects the community in which it exists. We got to consult with other teams on the use case and possible vulnerabilities of our project, and received valuable feedback on how to improve our system to be more ethical and secure.

I also designed the login, register, and main page of the website on which each zone of the LED will be controlled. Using django and OAuth, I implemented the login feature which allows authenticates already existing users using their username and password which is stored in a sqlite database. New users that want to make an account on the Lights Out webapp and connect to their in home device can register a profile on the register page (I still need to use forms to implement this).

Diva-Oriane Marty Status Report 10/23/2021

This week in class we were focused on the ethics assignments. Outside of class I worked on microphone testing with our adafruit SPW2430. The preliminary testing is hopeful, but I was unable to get a working soldering machine, so the connection is not very accurate, so hopefully after soldering we will get even better results. The microcontrollers and raspberry pi have been registered with the cmu wifi, but we are still working out some connection issues. This step is necessary before we try to combine the two types of data.  The tests were run with an arduino in order to have an analog port to test with. The wifi microcontroller have analog ports, but for inital testing it is not necessary to run it over wifi.     This is an example of the results from one of the tests:

The tests account for the DC voltage bias. We had hope to be connected our different sensor data this week, but we are not too far off from our expected timeline.

Diva-Oriane Marty Status Report 10/16/2021

This week I primarily worked on the Introduction, Design Requirements, Architectural Overview and System Description of the design report. I spend the majority of the time thinking through the Software Design of our system and the interfacing between the sensors and the software. 

I also helped with the testing of the PIR sensors during lab.

Next week I plan to work on a lot on testing, and particularly focusing on the microphones, to determine false positives, reasonable thresholds, etc. I hope to also start combining the data from the PIR sensors with the microphone in some preliminary tests.

Malavika Status Report 10/9/21

This week I did more research into how to have the web server interface with the GPIO pins on the Raspberry Pi. I found a well documented tutorial on how to implement this using Node.js and web sockets. I also began working on the design report after we divided the report between ourselves.

Malavika Status Report 10/2/21

This week I spent time researching ways to have the website interface with the Raspberry Pi to accordingly update the logic for turning on and off each of the four lights. There are options such as PiUi to control the Raspberry desktop from your phone but it doesn’t allow a web server to interact with the GPIO pins on the Pi. Most alternatives I found have the same issue. Most of the week entailed working on finishing and finalizing our design presentation after taking into account modifications and feedback suggested by our Professors, TAs, and other students in the class. I also retrieved our packages with our materials we ordered from Scott Hall.

Diva-Oriane Status Report 10/09/2021

This week I was primarily focused on writing up the Design Proposal Report. I wrote out the Abstract, Introduction, and Design Requirements Sections.

Next week we plan on testing the PIR sensors to  verify our formation, and include it as part of our preliminary testing for our Design Proposal Report . We are still waiting on the microphones. With the Design Proposal Report being due on Wednesday that is my primary focus this week.