Me and a friend are working on building a fully automatic greenhouse with arduino. We use relais for highly powered stuff like fans and the pump. We have 3 relais, 2 servo's and a RTC module. But whenever we boot the arduino up, the RTC seemingly randomly resets. We think it has something to do with the pump because when we don't plug the pump in, it works just fine. The RTC we use is the ds1302. The arduino used is the arduino uno (non-chinese ripoff, the original). The power for the pump is from a usb-splitter, not from the arduino. This is the code. Don't think that's the problem, but it may be:
Just checked, no ground connected together, i am not powering the motors or pumps through the breadboard. I just made a rough scheme in tinkercad. They don't have pumps, fans, RTC modules or 12Volt connections, so i had to improvise and be a little creative:). The 9v block is the 12v supply. My friend noticed that the RTC module always went to 79 seconds after 20-22 seconds, and gets stuck there. Already thanks a lot!
The link: Login | Tinkercad
The "Smoke detectors" are relais, and the 9volt battery is a 12V power supply. The fans are configured to if the pin on the relais is high, the fans are on, same counts for the pump. Leds are switched opposite, so if the pin on the relais is true, the light will go off. I'm sorry if i wasn't clear or if my sketch isn't clear. I don't know whether i explained my problem right or not. I'm sorry if i did. I plugged everything in the right way, my RTC is giving wrong indicators. So the pump and fans go on when they shouldn't. Nothing to do with the several relais or the amount of power consumed(i think).
Update: I slept a night above it, and it magically improved. I don't have any idea what could have fixed it, but i am happy it just works! I think that's just how electronics work sometimes. @Idahowalker thanks a lot for your help and time!