Ds 3231 based home automation.

I have a home automation setup that I made a few months ago and I want to add a DS 3231 to automatically power up the arduino every morning and have it power down at night. I was able to set up the alarms for both times of the day. Also, when the alarm is triggered at night, I want to cut power to the Arduino and it's peripherals. It is powered by mains and I want to use a relay to shut it down. Is it fine to have a battery backed At Tiny 85 to deal with the alarm interrupts at night and in the morning? Also is it fine to have the at tiny run all night in low power mode so the INTCN can be used to wake the At tiny first and have it power up the arduino through the relay? Any other suggestions?

It is powered by mains

So why power it down ?

The arduino is connected to a bunch of relays and a couple of pir sensors. Definitely I don't want to turn the lights on after I go to bed. Also I do want to minimise power consumption of the system.

Definitely I don't want to turn the lights on after I go to bed.

That is not a reason to power the system down

Well it's got a bunch of sensors and a voice module. It's the electhouse voice recognition module v3, and some relays and pir sensors. I just don't wanna use mains power supply at night. Even if I put the arduino to sleep in low power mode the rest of the stuff still draws power. And running that 24*7 has a few problems like burning out the supply, which has happened a few times.

running that 24*7 has a few problems like burning out the supply, which has happened a few times.

Then use a better power supply.

How much power does the power supply actually use ?

Okay, the thing is I've tried as many power supplies as I can, but all of them tend to heat up when run on long durations. Plus, I'm actually running it, not like a science project but using it everyday. That way I had to change the power supply a few times. I've tried 5v 1A and 5v 2.5 A. So I'm forced to switch it off every night and turn it back on manually as soon as I wake up. I'm trying to automate the task of turning it of and back on again. That's the reason I used the DS 3231. And with a display on the front, that displays time and stuff, I would sure want it shut down at night with the rest of the stuff.

Well, is adding a digital switch to the power supply a bad idea altogether? Is it possible to put the arduino to low power mode AND have all the other sensors off? It's going off track and turning into an electronics question but could you shed some light on that because I'm still learning. Thanks.

DheerajG:
Okay, the thing is I've tried as many power supplies as I can, but all of them tend to heat up when run on long durations. Plus, I'm actually running it, not like a science project but using it everyday. That way I had to change the power supply a few times. I've tried 5v 1A and 5v 2.5 A.

Assuming you've calculated and or measure the actual current draw, and are satisfied that 2.5A is enough, if "many power supplies ... tend to heat up when run on long durations" there has to be something wrong.

What is the current requirement?

Are the supplies of sufficient quality that you would expect them to operate 24/7? Or are they cheap and nasty? Is there sufficient ventilation? Do the power supplies' documentation say they're good for continuous use?

You should perhaps provide a schematic of the whole thing. Maybe there's a wiring fault approaching a short circuit that's causing more current to draw that you expect.

Okay, thank you for that wonderful insight into the power requirements of the project. The whole projet is on a breadboard for now because I wanted to add the rtc module, so the wiring might be the culprit. I will check that once. But even if it was the problem, the arduino must blow out first before anything else does, right? Feel free to correct me if I'm wrong about this.

It's not that the power supply issue is the only reason I want to power it down at night, because the sensors don't have much to process at night, and the fact that it has an lcd display made me to think of shutting it down every night. Thats why I thought I might as well do this so I don't have to deal with the hassle of turning it on and off everyday.

Is this even possible? Because the reason I bought the RTC was to just get two birds in one stone.

The very easy way to turn the power on and off at given times would be to use an old fashioned mechanical time switch, but you really shouldn't need to

Okay great. Seems like that's exactly what I wanted. Will check that out. Thanks.

I still think that turning the Arduino on and off is the wrong approach

I'd be really happy to hear how would you solve the problem. Except a new power supply because if you deal with the power on/off and that's solved.

As far as I can tell the problem is the power supply. Have you measured the current consumption of the project when it is running under various conditions ? How exactly are you supplying power to the system, ie how does the power get to the Arduino ?

I’m powering it with a 5 V 2.5 A supply. The arduino gets the power through the Vin. This power supply seems to work just fine and is not giving me any problems now. The earlier one just gave me 1A but I figured that wasn’t enough when I measured the current draw which was between 2 - 2.5A. That’s why I switched to 2.5A. Now the supply heats up just like any other power supply and it’s all good. The current draw I measured was on a pcb but now it’s all back on breadboard. Could that make a difference?

Anyways, having sorted out that issue I want to shut down the arduino or just sensors and the display connected to the arduino using the alarms on the DS 3231. That’s where I’m stuck at. Do I need like some mosfet based control circuit?

Could anyone please help me with this because I’m a complete noob at electronics…

The arduino gets the power through the Vin.

The Vin pin is designed to allow the Arduino to accepts a voltage between 7V and 12V which the Arduino regulates down to the 5V that it requires, so I am surprised that it works at all when supplied with 5V.

If your power supply really does supply 5V then connect it to the 5V pin on the Ardiuino but check the voltage first

At the risk of sounding like a stuck record...

You should perhaps provide a schematic of the whole thing.

Yeah meant the 5V input pin, sorry. It works with 5V. Everything else is just in parallel with the supply. Is that wrong?

I'm out until you post a schematic