Plant babysitter help

So I'm working on a project that turns on and off a light and a pump in order to take care of my cactuses for me.

Here's the original components:

Realtime Clock - used to keep track of the the time even when the Arduino is not powered on. Mine also has a temperature sensor in it I'm utilizing.

Relay - used to switch on the light fixture. The light is plugged into a wall socket for power. The wall also powers the Arduino through an adapter.

Pump - used to bring water from a cup/vase to the pipe that drops water onto the plants. I have it set to water once a week on Sunday at noon and I don't ever want to change that. The amount of water given is changed by the delay time between turning the pump on and off. I'll have to find a rough formula for ml per second on. (The water splits to hydrate 3 plants)

LEDs - I want to use like 3-5 RGB LEDs to determine if my plants are in the ideal temperature range. When the plant is good, all the lights are green. As it gets warmer individual lights switch to red (or blue for colder).

So I managed to have this system working and coded. I'll post my code later when I'm not on mobile. The main idea is in the loop section of the code I have it run once to initialize the variables (hour light on = 8, hour light off = 20, pump day of the week = "Sunday") and then I run the rest of the code in a while(true) loop so it keeps going and checking the times and temps. I have a 10 second delay at the end of the loop as well. This system works as is, but I was thinking it would be cool to have an LCD screen where you could push one of 4 buttons to change the time light on, time light off, amount of water (aka pump time), and ideal temperature that way you could easily adapt the system for any kind of plants.

Here's where I'm a little stuck:
• I'm using A4 and A5 for the clock SDA and SCL but the LCD screen will need SDA and SCL as well. How can I make them both work?

• Will the Arduino have enough power to power all the LEDs, the relay, the screen, the clock, the buttons, and the pump? I assume it will but I am just curious.

• How do I make the buttons work as inputs to cycles through options (hours on/off, water, temp). Is the system of coding I have now bad because of the 10 second delay? Will that prevent the buttons from being read in when it's on a delay?

• Am I gonna run into unseen errors by enabling the changing of these variables? Would I be best just sticking with my basic plan now that works without the LCD screen and buttons?

Any insight you guys could provide would help. This is my first big project. I've done some basic coding with individual parts but I've never thrown them all into a system like this.

Great project!

  1. If the LCD is an I2C device, it has a unique address, so you can share SCL and SDA with the RTC. If not, the LCD does not need to use A4 and A5. Tell us exactly which LCD you have.

  2. Yes, if there are enough I/O pins for everything. Pins can be shared between the buttons and other devices, like a non-I2C LCD display.

  3. Don’t use delay and it won’t give you a problem. See the Blink Without Delay coding example that comes with the Arduino IDE.

Post your code for suggestions on the other topics.

Thanks for the help! I've got a good idea of the wiring diagram and I've got my first full draft of code out so I'm gonna test that in a week or so when we have time to get it all built. I'll post code and wiring then if it gives me any trouble.