Made by Alice Patig and Andrew Berry

Norway

Weekly Progression


March 20, 2020:

Our project is done! Click here to watch a demo of our Pet Hydration Station.



March 13, 2020:

In our fourth week of the pet hydration station we were planning on bringing the whole project together to completion. This involved (1) getting the I2C sensor to work, (2) getting the bluetooth UART communication to work, (3) making the peripherals interact correctly with the Servo motor, (4) printing a case for the servo to be hot glued to the water dispenser, and (5) cleaning up all of the wires and hardware.

  1. Getting I2C to work:
    • Unfortunately after a long time spent trying to research and debug the I2C soil moisture sensor the with help of the TA's, we could not figure out what was wrong with our setting for I2C which was resulting in the sensor sending the data early and then the data expired before we could read it. We believe this was as a result of a timing issue and due to poor documentation of the sensor online we could not find a solution to make this work as planned. Although, we have changed out plan for the project to rather than using I2C we are going to use SPI with the internal Gyroscope as our second communication and just for sake of using the soil sensor we are going to plug it into the arduino to use arduino libraries and then have a digitial write from the arduino to a GPIO on the STM32 to let the STM32 know when the sensor has passed a threshold (not submerged in water) to ensure that the bowl does not overflow. After this changed we still have more than two external peripherals and two types of communication.
  2. Getting bluetooth UART communication to work:
    • This was successful in getting the bluetooth communication to work with termite to trigger the water to dispense manually if the owner would like to refill it manually.
  3. Making the peripherals interact correctly with the Servo motor:
    • This was successful all of the peripherals interact correctly with the servo. If the soil sensor is out of water the servo opens until the sensor is submerged, if the board is tited in the X direction then the servo opens for a short period of time. If a command is sent through Termite to the bluetooth peripheral the servo will open the valve.
  4. Printing a case for the servo to be hot glued to the water dispenser and for the STM32 and hardware:
    • We simply 3D modeled and printed a case for the servo to secure it to the glass.
    • We also made a small case to protect the board and other pieces of hardware.
  5. Cleaning up all of the wires and hardware:
    • We used heat shrink to clean up the wires so they dont get tangled and also to cover solders.

To do next week:

  • Film the final project to be submitted through gauchospace.
  • Put together all of the code in an organized way and add it to the submission


March 6, 2020:

In this third week of working on our hydration station, we were planning to (1) Research and buy a more powerful servo motor, (2) Modify and test the PWM code to correspond to our new servo motor (if it arrives in time), and (3) Connect the STEMMA Soil Sensor via the two 10k Ohm pull-up resistors and modify and test the code the get readings from the sensor.

  1. Research and buy a more powerful servo motor:
    • We found a more powerful servo motor, and ordered it. We chose this motor because it is more powerful, it also uses PWM, it was cheap and it would arrive in time.
  2. Modify and test the PWM code to correspond to our new servo motor (if it arrives in time).
    • Unfortunately, the new servo motor just arrived. Thus, we have not yet been able to implement the PWM code to correspond to our new servo motor. However, we are planning to do this early in the upcoming week.
  3. Connect the STEMMA Soil Sensor via the two 10k Ohm pull-up resistors and modify and test the code the get readings from the sensor.
    • With the newly aquired 10k Ohm pull-up resistors, we were able to connect the STEMMA Soil Sensor to modify and test the code to see if we could get readings from the sensor. Unfortunately, there is not much documentation on STEMMA available online. After modifying our code several times, were able to get some readings: testing it in water and outside of water. However, the readings are incosistent and we suspect a timing issue. After Andrew visited the Teaching Assistant this week, who provided insight to where the timing issue could be but still mentioned how it will be diffacult to properly debug without a proper datasheet, we decided to write to Adafruit directly. We are excited to hear back soon. Thereafter, we will do our best to ensure our STEMMA gives reliable readings.

To do next week:

  • Modify and test the PWM code to correspond to our new servo motor.
  • Await response from Adafruit and modify code accordinglty to get reliable readings from STEMMA.


February 28, 2020:

In this second week of working on our hydration station, we were planning to (1) Research and buy a water dispenser valve, (2) Test the servo motor on this dispensor to allow for some time to order a stronger motor if necessary, and (3) Finish lab 3, and therefore become familiar with I2C in order to start writing code for our STEMMA Soil Sensor. The progress in each area is listed below.

  1. Research and buy a water dispenser valve:
    • We found a large water dispensor with a valve that opens and closes upon rotation of the handle by 90 degrees. The valve opens relatively easily, but not so easily that it leaks. The water container can hold enough water for at least a week for a pet.
  2. Test the servo motor on this dispensor to allow for some time to order a stronger motor if necessary.
    • We found out how to communicate with the servo motor via pulse width modulation (PWM). On the data sheet, we found that the position of the motor at 0 degrees correspons a pulse of 1ms, a position at 90 degrees to a pulse of 1.5ms, and a position at 180 degrees to a pulse of 2ms. The period must be 20ms in total. If we operate at upcounting, rising edge, low true mode, we have that the duty cycle is: CRR/(ARR+1). We chose the clock of 4MHz, and a prescalor of 3. Thus, tclk = 100us. Thus choosing ARR = 199, gives a CRR = 10 for a position of 0 degrees, CRR = 15 for a position of 90 degrees, and CRR = 20 for a position of 180 degrees. Using the code from lab 2, we tried rotating the motor from position 0 to position 90, to 180 and back (with some delay in between actions).
    • We then tested the strength of our servo motor. We firmly taped our motor to the rotational valve. We held the motor in place so that it could exert its force on the valve to open it. Unfortunately, our motor was too weak to succeed. We now have to find out how much stronger our new motor needs to be, and order it.
  3. Finish lab 3, and therefore become familiar with I2C in order to start writing code for our STEMMA Soil Sensor.
    • We successfully finieshed lab 3 and are now familiar with I2C communication. We intended to modify our code and run it on our STEMMA Soil Sensor. However, we needed 10k Ohm pull-up resisotrs, which we did not have on hand during our group meeting. As a result, Andrew bought these resistors at the machine shop today. Instead, during the meeting, we were examining the data sheet of the STEMMA Soil Sensor and our code from lab 2, to understand what needed to be added and modified in the code. It was difficult to test our modifications, as we did not have the resistors to connect to the sensor. We will meet again and connect the sensor correclty in order to modify and test the code.

To do next week:

  • Research and buy a more powerful servo motor.
  • Modify and test the PWM code to correspond to our new servo motor (if it arrives in time).
  • Connect the STEMMA Soil Sensor via the two 10k Ohm pull-up resistors and modify and test the code the get readings from the sensor.


February 21, 2020:

In this first week of working on our hydration station, we were planning to (1) research and order parts online, (2) learn how to use different protocols in lab 3, and (3) continue to refine our website. We are successfully competing these tasks. The progress in each area is listed below.

  1. Research and order parts online for the project. We have researched and bought the following items:
    • A servo motor to open and close the water dispenser valve. We chose the SG90 Digital Servo motor. We chose it because of its availability in the shop (no long associated delivery time) and its low cost. One potential draw back of this motor could be that it is not strong enough to open and close the water dispenser valve. Once we have the water dispenser, we will be able to test if it is powerful enough.
    • Sensor to sense water level falling below threshold using I2C. We chose the Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor (https://www.adafruit.com/product/4026). We chose this sensor, as it operates with I2C, costs only 7.50 USD and has been proven to work well in a project our peers conduced.
  2. Learn how to use different protocols
    • This week, we have been completing lab 3. In this lab we have learned how to use UART and how to interface with a Bluetooth module using it. Furthermore, we learned to use SPI to receive gyroscope measurements. We will be using I2C in order to receive temperature measurements. This knowledge will be important for our project and we will likely be able to use some of the functions we wrote this week to communicate with the STEMMA Soil Sensor and all other peripherals.
  3. Continue to refine our website:
    • We now both have access to editing this website (previously we would log in via one of our accounts). We have added a block diagram to better represent the modules of our project (see “Project Proposal” below).

To do next week:

  • Research and buy a water dispenser and a water dispenser valve.
  • Test the servo motor on this dispenser to allow for some time to order a stronger motor if necessary.
  • Finish lab 3, and therefore become familiar with I2C in order to start writing code for our project.


February 9, 2020:

This is now the start of week one of working on this project. We have come up with a our project as you can see in the proposal below. We also have made this website where we can keep an up to date log of how the project is going. To do's for this week are:

  • Research and order parts online for project. Parts are listed in the proposal.
  • Learn how to use different protocols in lab3
  • Continue to refine this website for our projects needs