That would be great if you could. That sounds like exactly what I want to do.jsclownfish wrote:Let me know if you want me to post the code (I'm not at my PC at the moment).
-Jon
Thanks,
Charlie
That would be great if you could. That sounds like exactly what I want to do.jsclownfish wrote:Let me know if you want me to post the code (I'm not at my PC at the moment).
-Jon
Code: Select all
// Vacation autofeeder memory locations
#define Vacation 100
#define VacationEnable Vacation //autofeeder on=1
#define VacationStartHr Vacation+1 //1st hour
#define VacationStartMin Vacation+2 //1st minute
#define VacationStart2ndHr Vacation+3 //2nd hour
#define VacationStart2ndMin Vacation+4 //second minute
#define FastFeed Vacation+5 //Fast feeder timer
#define VacationPulseFeed Vacation+6 //pulse signal from the internal memory function
byte Feed = 0;
void setup()
{
}
void loop()
{
//Autofeeder Mode
if ( (InternalMemory.read(VacationEnable) > 0) || (InternalMemory.read(VacationEnable) <= 2) ) // check for vacation mode 1 time a day
{
// Check if the current time is equal to the start time.
if (NumMins(hour(), minute()) == (NumMins(InternalMemory.read(VacationStartHr), InternalMemory.read(VacationStartMin))))
{
if (second() == 0)
{
Feed = 1; // Turn on feeder and feedmode
ReefAngel.FeedingModeStart();
}
}
else Feed = 0;
}
if ( InternalMemory.read(VacationEnable) == 2 ) // check for vacation mode 2 times a day
{
// Check if the current time is equal to the start time.
if (NumMins(hour(), minute()) == (NumMins(InternalMemory.read(VacationStart2ndHr), InternalMemory.read(VacationStart2ndMin))))
{
if (second() == 0)
{
Feed = 1; // Turn on feeder and feedmode
ReefAngel.FeedingModeStart();
}
}
else Feed = 0;
}
if ( InternalMemory.read(VacationEnable) == 3 ) // check for vacation mode hourly
{
if ((hour() >= 10) || (hour() <= 19)) //from 10a-7p
{
if (minute() ==30 && second() == 0) //once an hour on the half hour
{
Feed = 1; // Turn on feeder and feedmode
ReefAngel.Timer[FEEDING_TIMER].SetInterval(InternalMemory.read(FastFeed)); //short feed timer
ReefAngel.FeedingModeStart();
ReefAngel.Timer[FEEDING_TIMER].SetInterval(InternalMemory.FeedingTimer_read()); //reset original feed timer
}
else Feed = 0;
}
}
if ( InternalMemory.read(VacationPulseFeed) == 1 ) // feeder trigger for remote feeding
{
Feed = 1; // Turn on feeder and feedmode
ReefAngel.Timer[FEEDING_TIMER].SetInterval(InternalMemory.read(FastFeed)); //short feed timer
ReefAngel.FeedingModeStart();
ReefAngel.Timer[FEEDING_TIMER].SetInterval(InternalMemory.FeedingTimer_read()); //reset original feed timer
InternalMemory.write(VacationPulseFeed,0); //reset variable to 0 to mimic a pulse or button release
}
else Feed = 0;
//I/O module communication
Wire.beginTransmission(7); // transmit to device #7 (IO Module)
Wire.write('$'); // send the $$$
Wire.write('$');
Wire.write('$');
Wire.write(Feed);
Wire.endTransmission(); // stop transmitting
Code: Select all
#include <Wire.h>
#include <avr/wdt.h>
byte Feeder=0; //autofeeder signal
void setup()
{
Wire.begin(7);
Wire.onReceive(receiveEvent);
pinMode(10,OUTPUT); //autofeeder pin
digitalWrite(10,LOW);
}
void loop()
{
//feeder
if (Feeder == 0)
{
digitalWrite(10, LOW);
}
else if (Feeder == 1)
{
digitalWrite(10, HIGH);
}
}
void receiveEvent(int howMany)
{
if (howMany==4) // Our custom protocol is 4 bytes
{
byte cmd1,cmd2,cmd3,cmd4;
cmd1=Wire.read();
cmd2=Wire.read();
cmd3=Wire.read();
cmd4=Wire.read();
if (cmd1=='$' && cmd2=='$' && cmd3=='$') // the first 3 bytes of the custom protocol are $$$ to ensure it's coming from RA
{
Feeder=cmd4;
}
}
else
for (int a=0;a<howMany;a++)
Wire.read(); // if the number of bytes is not 4, discard everything
}
I found an old 5v wall wart today so I'll either have to make or buy a step down converter to get down to 3.3v. I wanted to keep it all in the battery compartment of the feeder but I don't think I'll get away with it if I use a converter. I'll pick up a small RadioShack project box to put everything in then run a cable up to the feeder.lnevo wrote:I actually want to see if i can find room inside the unit for the relay.
For those of you that used this method over keeping the batteries to power the feeder have you had any problems with this? I'm still very new to electronics and I understand the *very* basics of this and how/why it works but in my research for DC to DC step-down converters I've read on many sites using this method is not all that great and/or "clean". Is there anything inherently wrong with going this route?
- Supply List for building 5-‐3.2V Converter.
- 1-‐330 Ohm Resistor
- 1-‐470 Ohm Resistor
- 1-‐4.875"x2.5"x1.5" Project Box
- 1-‐Dual Mini Board (213 Hole)
- 1-‐LM317T Adj. Voltage Regulator
- 4-‐DC Power Plug (Size-‐N)
- 4-‐Coaxial Power Jack (Size-‐N)
- 1-‐5v Power supply from around the house
lnevo wrote:Power +/- goes to relay +/-
Means Power of Feeder +/- Goes to power Control expansion +/-
Relay output connects to pins ok manual button.
Relay output connects to pins ok manual button? this part iam not sure
Done thats all you need. Now when you power on the outlet, the relay closes, fish get fed. I think the simplicity is whats getting in the way
NO! The power is going to connect to a 12vdc relay that you will need from radio shack. The feeder is only 3v if you connect that directly to the feeder I'm not sure what will happen. I've only done the control part, not the battery replacement,Amos Poh wrote:lnevo wrote:Power +/- goes to relay +/-
Means Power of Feeder +/- Goes to power Control expansion +/-
What feeder did you get? Sounds like it might not be the Eheim feeder. If that's the case, you will need to open it up and figure out how to wire the relay to the button.Hi Piper and Inevo,
I recently brought a battery powered auto feeder and was thinking of powering it up via the ReefAngel instead of batteries also would be best if i can trigger a feed wirelessly.
Found this thread with lots of information but i am a idiot when it comes to electrical stuff. Possible to teach me what to buy and how to assemble?
1) power up the feeder using RA
2) trigger a feed wirelessly
Autofeeder is using 2x 1,5v AA battery
Thanks in advance