Eheim autofeeder

Request new hardware or ideas for the controller
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Eheim autofeeder

Post by Piper »

jsclownfish wrote:Let me know if you want me to post the code (I'm not at my PC at the moment).

-Jon
That would be great if you could. That sounds like exactly what I want to do.

Thanks,
Charlie
User avatar
jsclownfish
Posts: 378
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

Re: Eheim autofeeder

Post by jsclownfish »

OK, so here is how I do it. I tried to simplify my ino files down to the autofeeder stuff. Also, you'll see I slowly added more options so there are 4 now:
1. feed once a day
2. feed twice a day
3. feed every hour during the day
4. feed on command with a memory location read to trigger the event.

Here is the relevant main code...

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  
and here is the relevant IO code....

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
} 

Hope that helps.
-Jon
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Eheim autofeeder

Post by lnevo »

So it looks like the button "press" is really just a momentary action. Was trying to figure out how much time I needed to "hold" the button down for..i

For the electronics part. You are just going from the io module to relay and relay to button?
User avatar
jsclownfish
Posts: 378
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

Re: Eheim autofeeder

Post by jsclownfish »

Yes. I just used a little plastic box to to hold the 5V relay from RadioShack http://www.radioshack.com/product/index ... Id=2062478.

Jon
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Eheim autofeeder

Post by lnevo »

That gives me a great idea... :)

Roberto can you sell me a small ReefAngel box with a mini usb port? i'm thinking like the pressure switch case. I can install the relay in that and run a mono audio cable up to the feeder :)

I could use the hole to mount the mono jack :) just need to make sure it'll be ok size wise...

If we can do something shoot me a PM with the options :)
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Eheim autofeeder

Post by rimai »

Sure. It's very tiny though.
Roberto.
User avatar
jsclownfish
Posts: 378
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

Re: Eheim autofeeder

Post by jsclownfish »

I like that idea! I don't like that mine is hard wired now and I haven't taken the time to change it. The RadioShack plastic box is also too big. I'd think you would need a IO size box though.


Jon
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Eheim autofeeder

Post by lnevo »

Yeah The pressure switch may be too tiny...but io module size would work :) i've no idea how big the relay is.. :)
User avatar
jsclownfish
Posts: 378
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

Re: Eheim autofeeder

Post by jsclownfish »

the one I used was maybe 1" long and 1/4" around.
Jon
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Eheim autofeeder

Post by lnevo »

Just picked up the relay some mono ports and jacks. The relay is not the one linked but it should be fine. Pretty small.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Eheim autofeeder

Post by lnevo »

I found an old blackberry charger that is now modded with a mono jack and i wired up the relay to a mono port and its working :) now i just need my feeder. I actually want to see if i can find room inside the unit for the relay.
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Eheim autofeeder

Post by Piper »

lnevo wrote:I actually want to see if i can find room inside the unit for the relay.
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.

Let us know if you manage to stuff it all in the feeder. I'd like to see how you do it.

~Charlie
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Eheim autofeeder

Post by lnevo »

If it can't fit, I'll just put the relay it into a project box and swap the jack for a plug on the extension cable I made. :)
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Eheim autofeeder

Post by Piper »

I've been reading through the various mods and it should be easy enough to put the relay on a small board along with the components I need to bring the voltage down to 3.3v form 5v on the wall wart. I ordered a bunch of parts/pieces last week to build the projects from the book I'm reading and I'm just waiting for that to ship. I should have everything I need in that batch other than the relay. I'll pick up the relay from Radio Shack on the way home tonight.

Hopefully I can get this put together by next weekend and not turn my autofeeder into and expensive paperweight :)

~Charlie
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Eheim autofeeder

Post by lnevo »

Got my feeder today and got everything installed. Was no way to get it stuffed in without doing the battery mod. I put it all in a small take out plastic container. I'm just gonna grab a small project box tomorrow. I tested plugging it in and unplugging. It triggers immediately. Can't wait to get this hooked up.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Eheim autofeeder

Post by lnevo »

Connected the feeder up today. Had to cut the clamp out a bit so i could attach it to the cross brace instead of the rim. Works like a charm. Its connected to my WC pump extension cord for now until I start on the revamp and my new code...

Here's some pics:
Image
Image
Image
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Eheim autofeeder

Post by Piper »

All my electronics parts/pieces finally came in and I'm ready to get going in on this but I have a question before I start. From the PDF attached to the page in this link (http://www.manhattanreefs.com/forum/diy ... pex-3.html) he is using the following items to convert his 5v DC wall wart to 3.2v DC to power the feeder.
  • 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
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?

~Charlie
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Eheim autofeeder

Post by rimai »

I think you are just fine with that voltage regulator.
Roberto.
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Eheim autofeeder

Post by Piper »

I'll give it a shot. Thanks, Roberto!
Amos Poh
Posts: 107
Joined: Sun Jul 22, 2012 4:51 am
Location: Singapore

Re: Eheim autofeeder

Post by Amos Poh »

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 :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Eheim autofeeder

Post by lnevo »

I only did the control part. I still rely on battery.

All you need are some audio mono ports and jacks, a small project box and a relay. Amos i believe you have the dc power expansion? If so you can connect a 12vdc relay right to that and when its powered on it completes the circuit. You wire the relay to the pins on the feeder button and it closes the circuit when you provide power to the relay which then feeds the fish. The mono ports are just to make everything look nice. If you do the battery replacement u might be able to put the relay inside the feeder.
Amos Poh
Posts: 107
Joined: Sun Jul 22, 2012 4:51 am
Location: Singapore

Re: Eheim autofeeder

Post by Amos Poh »

Thanks Inevo :)

Did i mention iam a Idiot when it comes to electrical engineering :) lol.
I still dont get what to purchase and how to assemble it. yes i do have a power control expansion how can i use that to power the feeder?

Sorry for the noob questions
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Eheim autofeeder

Post by lnevo »

Power +/- goes to relay +/-

Relay output connects to pins ok manual button.

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 :)
Amos Poh
Posts: 107
Joined: Sun Jul 22, 2012 4:51 am
Location: Singapore

Re: Eheim autofeeder

Post by Amos Poh »

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 :)

Thanks for the patience by the way :lol:
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Eheim autofeeder

Post by lnevo »

Amos Poh wrote:
lnevo wrote:Power +/- goes to relay +/-

Means Power of Feeder +/- Goes to power Control expansion +/-
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,

For the other part, you'll need to crack open the feeder and you'll see the button that you push (there are 2 of them) when you want to feed manually. You will need to solder wires to two of the pins and connect that to the output side of the relay. There's some links earlier in the thread with pictures and some other directions I had found (and didn't use for their circuit) that may make it clearer.
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Eheim autofeeder

Post by Piper »

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 :)
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.

The easiest way is as Lee suggested and just use the RA to power the relay that triggers the button and just keep the batteries in the unit to power the it. I used an old 5v cell charger wall-wart to power my feeder but if you do that you need to use/make a voltage regulator to go from 5v (or whatever you have) to 3v. You can also find one cheap on-line: http://dx.com/p/mini-dc-4-40v-to-dc-1-5 ... ule-142488

If you use a 12v relay (http://dx.com/p/oje-sh-112dm-12v-5a-pow ... ack-141959) you can use your DC expansion to trigger it.

Image

Using the image above as an example, you would wire your DC expansion to pins one and two of the relay. You would wire pins 3 and 4 to the button on the feeder. When you apply power from the DC expansion to pins 1 and 2 of the relay it will trigger the relay closing (or completing) the circuit at pins 3 and 4 which would emulate a button press on the feeder. In newbie terms the relay is taking the place of the button on the feeder.

~Charlie
Piper
Posts: 296
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Eheim autofeeder

Post by Piper »

I should note that not all relays are the same. Some may have the pins in different locations and some may have more pins. You need to check the diagram and/or data sheet for your relay for proper wiring. Just make sure that if it is a 4 pin relay that it is "NO" or Normally Open. That means if there is no power to the relay it's open or not completing the circuit. Many of the relays you will find have 5 pins which will handle either case depending on how you wire it.

~Charlie
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Eheim autofeeder

Post by lnevo »

The 4 pin relay is sometimes referred to as SPST (single pole, single throw) relay.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Eheim autofeeder

Post by Sacohen »

So how many volts is being sent to the feeder trigger.

From this link.
http://wamas.org/forums/blog/13/entry-4 ... ontroller/
it looks like the feeder is getting 12V off of the relay.

I'm wondering if I can do this using a 3V Walwart to replace the batteries and a 12V signal coming out of the Power Expansion Module.

If I set program the RA to only close the Power Expansion Module of a second then I shouldn't need the capacitor and resistor.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Eheim autofeeder

Post by rimai »

If you are using a relay, like piper posted above, there is no voltage being sent to the feeder.
You are basically closing the relay contacts similar to what you would do manually on a button.
Roberto.
Post Reply