[Philip] Finalizing code, wiring, and motor

This week I was very busy in creating a functional system. I finalized the code this week which takes into account the two PIR sensors and the camera, in turn opening or closing the door. In addition, this required much wiring for all the power and GPIO pins. I also helped Jing out with getting the solenoid to work (the transistor we were using needed 5V and the GPIO pins output 3.3V).

My major accomplishment this week had to due with the motor and door. Previously, Irene was not capable of creating a functioning motor, which prevented us from having an automated door. Earlier this week, Jing and I decided to fix this as we believed this was a necessary aspect of our project, especially for the demo on Monday. We found a new DC motor that we believed rotated at a fast enough speed and with enough torque. We were able to get this motor to work within a couple of hours. On Saturday, I successfully mounted the motor onto the door, then found a way to use fishing wire to pull the door up! It takes approximately 8 seconds for the door to completely open and 3 seconds for the door to close. Although this was not my aspect of the project I was assigned to do, I was willing to work on it to create a more complete project that better showcased my efforts this semester.

(If you look closely there is clear fishing wire attached between the motor and door)

May 4: Team Status

We need to finalize the wiring and make sure the system consistently works as intended. These risks will be managed on Sunday by moving our system to another room and retesting the entire thing.

No changes to system requirements.

[Jing] Final Status Report

This week, I focused on preparing for the final presentation.

I also worked on the circuitry for controlling the door. The solenoid circuit that I originally had was not compatible with the Jetson. It required 4V to activate the solenoid, but the Jetson outputs at most 3.3V. To solve this, I used a 22ohm resistor and another transistor with a 5V source to allow 4V to pass to the gate of the original transistor.

Additionally, I breadboarded an H-bridge to control the motor, but have yet to test it with actual code.

Weekly Status Report [May 4]

This week, the team finished the final presentation and worked together to finish integration and testing on the door. We finally found a solution to get the door to lift using a DC motor, a wheel, and wire.  We should have a fully demo-able product by Monday. The door will be able to automatically lift when a cat is detected by the webcam, and the door will be able to be locked and unlocked by the phone app.

[Philip] More Integration

This past week I have been doing a lot of integration. First, I greatly modified my Python script to include the inputs from both PIR sensors, call the open and close door functions, and fully communicate with the App. I had all the individual components ready which made this part easier. The logic for this script is well thought out and a main goal is to not close the door on the cat!

I have also been trying to use Jing’s newest algorithm on the Jetson but it has encountered difficulties. It is not smoothly replacing the older one. This is because Jing added a new layer to his algorithm which the Tensorflow on the Jetson does not like for some reason. This will be my priority this upcoming week because the older algorithm is not good enough.

In addition, I also worked on the presentation slides which are due Sunday night.

This upcoming week is crunch time! I will be getting Jing’s newest algorithm working on the Jetson and finish fully integrating the system.

April 27: Team Status

What are the most significant risks that could jeopardize the success of the project? How are these risks being managed? What contingency plans are ready?
In order of priority:
– The latest version of the inference script runs in AWS, but does not run on our Jetson. The latest script is important for testing. We can roll back to the older version (not desirable) as a last resort.
– We don’t have any testing done for how the system operates in light vs dark conditions. This is dependant on the new script running on the Jetson. We could test from our laptop, as a proof of concept, but it wouldn’t demonstrate the actual system working.
– The solenoid stopped working again. We can replace the components and try again.

[Irene] Controls

Good news: I got the motor integrated with the system, and I updated the Bill of Materials document. I rewired the circuit to share the 12V supply between the motor and the solenoid.

Bad news: the motor turns very slowly. I think the 12V supply is not supplying 12V.

In addition, I designed the control loop for the system, with the help of prof Bain. Essentially, it is an automatic door, like what one would encounter at the entrance to a supermarket or in an elevator. The door opens if there is movement on either side, then does not close until there is no movement in both sides. The control loop does this by taking turns checking the sensor for each side. It is like a scheduler that context switches between the two tasks, delegating equal time per task to make sure that the other task does not get starved out.

Next week, we gotta do the poster and the list of last min things to take care of. I’ll put together a comparison of how the camera performs during lit and unlit settings, and work with jing to fix the solenoid.

[Jing] Jetson Integration

This week I downloaded the final version of the trained neural network to use for our project. We ended up achieving an accuracy of 82% for the Cat vs. Non-cat inference. I breadboarded the final version of our solenoid circuit using the 12V DC Wall Adapter. The circuit was failing the first time because the transistor was blown, but after I replaced the transistor everything was working well. Finally, I worked with Philip to debug some issues with getting the machine vision code running on the Jetson. It turns out it was mostly just version incompatibility issues between the Jetson and Tensorflow.

I was in Boston for the end of the week (Fri – Sun) and so I wasn’t able to accomplish much else.

Next week, I will work with the team to finish integration and testing and get TensorRT running on the Jetson to improve performance. I will also begin preparing visuals (charts, etc.) for the final presentation and paper.

[Philip] Jetson Integration + App

In the first part of the week I focused on integrating the Tensorflow algorithm, the MQTT library, and the GPIO library into one Python script. Integrating the GPIO was fairly straightforward as when a cat is detected by the camera or the PIR sensor detects movement, I simply set an LED to turn on for 5 seconds. The MQTT library was a little more tricky because I had to define what information will need to be sent between the Jetson and the iPhone app. The iPhone app tells the Jetson when the user wishes the door to be enabled or disabled. The Jetson then interprets this command and applies it. In addition, when movement is detected, the Jetson informs the app of the time of the movement in addition to the direction (inbound or outbound). When the app receives this information it then interprets it and updates the screen. Finally, when the app first opens it requests an update automatically from the Jetson for the most recent movement which then sends the corresponding info back to the app.

In addition to changing a lot on the backend of the iPhone app, I also spent a lot of time with the design of the app. Here is the final version:

My progress is on track.

This week I will need to test the entire integrated system. This will require working extensively with Jing and Irene.