Back to Parent

Outcome


Problem Statement:

My chubby tubby hamster does not exercise enough. On average, a hamster runs 2-3 miles a day. Because hamster is nocturnal animal, she usually doesn't run on the wheel until I go asleep. In the day time, she runs occasionally, but because I spend most of my time in school I can't see her daytime activity either. To motivate her to get enough exercise, I want to design a reward mechanism that can automatically offer her treats when he runs over 2 miles a day, without me closely monitoring her activity.

Goal: 

This device should count and indicate how long my hamster runs for a day. When she runs over 2 miles a day, she will receive a treat. A magnet is going to be attached to the outside of the hamster wheel, and when the wheel rotates once, a hall effect sensor will sense it and count once. Using the inner perimeter of the wheel I can calculate how many turns equals to 2 miles. An LED is also needed for indication of functioning. When she reached the goal, a servo with food will rotate and drop off food into her bowl. This will help solving the problem because the mechanism will motivate her to run more.

Process: 

  1. Identified the problem
  2. Searched for relevant work
  3. Built rough circuit: a servo, a sensor, and a button. Applied existing codes from reference sources.
  4. Adjusted codes for each part
  5. Removed button
  6. Added codes so that two parts are communicating
  7. Added LED to indicate servo move
  8. Adjusted codes to reset sensing counts
  9. Added button back in
  10. Adjusted codes to use button to manually reset sensing counts
  11. Added RGB LED to indicate counts, and adjusted codes
  12. Adjusted codes

The biggest problem I met was to make the codes work. Every time the codes were realizing some functions but not all of them, so I have to adjust them over and over again. I also struggled to decide if I should let the system automatically reset the counter or should I manually reset it. In one version I used both but that was a mess, so I just decided to manually reset it. 

Img 6631
Show Advanced Options

Outcome: 

The final prototype uses a hall effect sensor to sense and count the rounds the wheel turns. When the wheel turns 6726 times it's approximately 2 miles. When reached that goal (for indication the prototype will use 20 instead of 6726), the servo will turn and drop food into the cage.  Before the sensor sense anything, the LED is blue. When it started to sense, it turns red until it reaches the goal, then it turns green. A button is used to reset the counts, and when reset, the LED is blue again. When servo moves, another LED whill be on to indicate its movement.

Show Advanced Options
Diagram bb
Show Advanced Options

Parts

  • Photon * 1
  • Breadboard * 1
  • Servo * 1
  • Hall Effect Sensor (US5881) *1
  • RGB LED * 1
  • Regular LED * 1
  • Resistor * 5
  • Button * 1
  • Jumper Wires * N
  • Magnet * 1
  • Spoon * 1
  • Hamster Wheel * 1
  • Food * N
  • Hamster * 1 (Most important!)


Show Advanced Options
Ifttt
Show Advanced Options

Reflection

Before this project I barely know anything about coding, but during this project I learned a lot from not only class but also from friends and internet. If I would have done it differently I might want to try more different sensors to figure out which one is more suitable for this project. Overall, I'm quite happy about the result of the outcome and I think I've learned a lot of new things. I think I could do better if I had a chance to dig into coding.

Drop files here or click to select

You can upload files of up to 20MB using this form.