What I would "like" to find is a program that has 2,3,4 or 5 button in a series (This would be to save pins). button 1 would = a 10 minute timer, button 2 = 20 minute timer, button 3 = 30 minute timer etc. I do not want a delay because I do not want the whole unit shutting down. I will be incorporating a lot of I2C in the mix and I will have the amtel328 multi button standby slave talk to the main unit. The main unit will just be spitting out the info as to what the slave is doing. It can be any circuit any way, thats not a problem because this will be on a stand alone chip. It will be driving relays and I would prefer N/C incorporated relays/relay setup. I will have to have a minimum of 6 relays ready disconnect AC powers when one of the buttons is/are pressed.
Button options
10 minutes
20 minutes
30 minutes
3 hours
Ignore and return to normal/run mode
I have looked around and seen a few schematics that have buttons with resistors, but nothing like what am looking for.
Does anyone know of such a schematic, sketch or library?
Why not connect each switch to a separate input? With only five buttons to connect it's not obvious that you're running out of pins. If you are, you could either use a shift register or a resistor ladder to connect the buttons.
PeterH:
Why not connect each switch to a separate input? With only five buttons to connect it's not obvious that you're running out of pins. If you are, you could either use a shift register or a resistor ladder to connect the buttons.
Well the OP wanted at least 5 buttons, at least 6 relays, I2C (which eats up A4/A5 on the Uno). That is 13 pins. Figure pin 13 might be problematical due to the resistor for the LED, and perhaps not using pin 0/1 due to using the serial monitor. That would be 16 pins, out of 20 possible pins on the UNO.
1ArduinoFan:
What I would "like" to find is a program that has 2,3,4 or 5 button in a series (This would be to save pins). button 1 would = a 10 minute timer, button 2 = 20 minute timer, button 3 = 30 minute timer etc. I do not want a delay because I do not want the whole unit shutting down. I will be incorporating a lot of I2C in the mix and I will have the amtel328 multi button standby slave talk to the main unit. The main unit will just be spitting out the info as to what the slave is doing. It can be any circuit any way, thats not a problem because this will be on a stand alone chip. It will be driving relays and I would prefer N/C incorporated relays/relay setup. I will have to have a minimum of 6 relays ready disconnect AC powers when one of the buttons is/are pressed.
Button options
10 minutes
20 minutes
30 minutes
3 hours
Ignore and return to normal/run mode
I have looked around and seen a few schematics that have buttons with resistors, but nothing like what am looking for.
Does anyone know of such a schematic, sketch or library?
The sketch will be the easy part. The inputs can be handled with a Resistor ladder setup (2 inputs only needed) or some form of port expansion - others have mentioned the i2c options and that would be logical one to go with.
Look at the SImpleTimer Library - it wraps up using the millis function into something easy to understand and implement. If your needs get greater later on you can then look at moving to millis once you understand how to write non-linear code.
Ahhhh, a resistor ladder, thats what it is called!? I have seen it before but wasnt sure what it was called.
I guess I could use the MCP23017 chip or the like but I was trying to keep it all in the ATmega chip itself. I plan to have 3-5 slaves running to the main board with the TFT LCD (may even have an individual chip for that also?).
Example 1: ATmega will house the too hot/cold code to turn on the fan if temps get over 80 degrees and turn off the lights at 82 degree's. If temps gets to 77 degrees, turn on heater through relay.
Example 2: Feed mode (this is where the switches come in, in this example/thread) press a button and it shuts all the pumps down. Press another and it resumes but will hold one relay/110v outlet off for "x" amount of minutes.
The main computer and slaves will communicate through I2C with the main running the TFT LCD telling me what the slaves are doing/showing as there will be a slave for lights and other oddities.
Okay, thanks guys, i will take a lookie at the links and suggestions, very much appreciated.
1ArduinoFan:
Ahhhh, a resistor ladder, thats what it is called!? I have seen it before but wasnt sure what it was called.
I guess I could use the MCP23017 chip or the like but I was trying to keep it all in the ATmega chip itself. I plan to have 3-5 slaves running to the main board with the TFT LCD (may even have an individual chip for that also?).
Example 1: ATmega will house the too hot/cold code to turn on the fan if temps get over 80 degrees and turn off the lights at 82 degree's. If temps gets to 77 degrees, turn on heater through relay.
Example 2: Feed mode (this is where the switches come in, in this example/thread) press a button and it shuts all the pumps down. Press another and it resumes but will hold one relay/110v outlet off for "x" amount of minutes.
The main computer and slaves will communicate through I2C with the main running the TFT LCD telling me what the slaves are doing/showing as there will be a slave for lights and other oddities.
Okay, thanks guys, i will take a lookie at the links and suggestions, very much appreciated.
Depending on how many fish you are stocking you might also want to look at one or more Air pumps to ensure the Oxygen level of the water remains high enough when you have pumps off etc - i would use this as a safety measure and have this running all the time completely seperate to the Arduino control.
craigcurtin:
Depending on how many fish you are stocking you might also want to look at one or more Air pumps to ensure the Oxygen level of the water remains high enough when you have pumps off etc - i would use this as a safety measure and have this running all the time completely separate to the Arduino control.
MichaelMeissner:
This type of problem is generally called Blink without delay (BOD).
Seems to me that in English, that would be "BWD" or "B0D". You are presumably referring to a German version?
craigcurtin:
The inputs can be handled with a Resistor ladder setup (2 inputs only needed) ...
Clever idea, used in many consumer products, notably computer monitors and MP3 players.
Notoriously unreliable in my experience, the cause of a collection of now useless and largely unrepairable such devices that worked for a while.
Well, with the minimal parts I would be looking at, there is not much to go wrong with a few resistors and a crystal, but, if my plans ever get deep, I will definitely keep it in consideration. Thanks for the heads up.
1ArduinoFan:
Well, with the minimal parts I would be looking at, there is not much to go wrong with a few resistors and a crystal, but, if my plans ever get deep, I will definitely keep it in consideration. Thanks for the heads up.
The cause of the failure is actually moisture ingress into the pushbuttons.
craigcurtin:
Depending on how many fish you are stocking you might also want to look at one or more Air pumps to ensure the Oxygen level of the water remains high enough when you have pumps off etc - i would use this as a safety measure and have this running all the time completely separate to the Arduino control.
Craig
Hmmm, interesting idea. Thanks.
Everyone who has done aquaponics for any period of time, knows that you measure your success in how few fish have died on you in the last month i.e. the bastards always die and there will always be something going wrong (hardware wise) that you have not planned on.