Close

First Prototype Build

A project log for Hedgehog Feeder

Hedgehogs in the UK are classed as an endangered species. For this reason I have chosen my final year project to be a hedgehog feeder.

abigail-smithAbigail Smith 03/14/2019 at 12:360 Comments

Pretty happy with how the first prototype build has gone.

Some things to note so far:

1) Storage box (85L) is too big. I'm glad I went to big rather than too small as it is easier to build, but the next prototype will be in a much smaller storage box.

2) Paddle in cereal dispenser is not robust enough for Ark Hedgehog food but works fine or finer food, such as meal worms. Manipulation of paddle design is needed. Perhaps a 4 paddle instead of 6.

3) Need to secure stepper motor to shelf more robustly as it vibrates and make a lot of noise, which would scare the hedgehog away.

4) Need to cut a hole in the storage box for entrance to feeder.

5) Need to adapt load cell mount to cater for larger area.

6) Code is currently not working as it should as food is being dispensed at weights lower than 350g.

7) Use of an 'if' statement '&&' in code to create weight ranges does not seem to be working as it should.

8) Need to have a play with delays and how many steps it necessary to give correct portion size.

// load cell
#include "HX711.h" 
#define DOUT  6
#define CLK  7
HX711 scale(DOUT, CLK);
float calibration_factor = 387600;

// hedgehog weight limits
int sensorMin = 0.350; // 350g
int sensorMax = 0.750; // 750g
int sensorMid = 0.450; // 450g
const int delayBetweenFeeds = 6e+7; //1 minute

//stepper
#include <Stepper.h>
const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 12, 11); //dirPin = 12, stepPin = 11
int previous = 0;

void setup() {
  Serial.begin(9600);
  //set up load cell
  Serial.println("Press T to tare");
  scale.set_scale(calibration_factor);  //Calibration Factor obtained from first sketch
  scale.tare();             //Reset the scale to 0
}

void loop() {
  //use load cell to weigh
  Serial.print("Weight: ");
  Serial.print(scale.get_units(), 3);  //2 decimal points
  Serial.println(" kg");
  delay(1000);
  
  //control dispensor with load cell readings and stepper
  if (scale.get_units()>sensorMin){
    Serial.print("Weight: ");
    Serial.print(scale.get_units(), 3);
    Serial.println(" kg");
    myStepper.setSpeed(30); //set RPM at which stepper will rotate when called to step
    Serial.println("stepperclockwise");
    myStepper.step(400);
    delay(10000);
  }
    
  else {
    myStepper.step(0);
  }
}

This is my code so far. 

Discussions