Go Down

Topic: wake up arduino pro mini using time (Read 199 times) previous topic - next topic

bmg1234

Hello

I am doing a project to send sensor data from one arduino mini pro to another using NRF24L01.

Sensor will activate maximum three times a week. so i don't want to waster power so i will but transmitter in to deep sleep mode and wakeup when sensor is activated and sends data, i have done till here.

Now i want to make another interrupt using timer that arduino should wakeup every 5 hours and sends the transmitter battery status and goes to sleep after sending data. because i am new to this timer concept can some please help me with any example code or some reference links.

Thank you

PaulS

What "timer" are you talking about? One of the three (or 5) built into the Arduino?

What sleep mode are you using? Some sleep modes disable the timers, so you can't make a timer wake the Arduino, because the timer isn't running.
The art of getting good answers lies in asking good questions.

bmg1234

Hello Paul

Thank you. I am giving battery voltage to analog pin. i want transmitter to send this data every 2 hours once.

What are the options? how can i do this? i am not getting any idea. please help me

PaulS

Quote
What are the options?
Options for what? By far, the simplest solution is to acquire an RTC, with an alarm capability, and set the alarm to fire whenever you want to wake the Arduino up.
The art of getting good answers lies in asking good questions.

pylon

If "deep sleep" means power down sleep, the only built-in timer available is the watchdog timer. The longest time frame available is 8 seconds but you can wake up, update a counter and immediately go to sleep again if you want to wait a multiple of these 8 secs.

bmg1234

Options for what? By far, the simplest solution is to acquire an RTC, with an alarm capability, and set the alarm to fire whenever you want to wake the Arduino up.
I don't think RTC is good choice it consumes more power. I need to find some solution. is there any option to make time of delay 1 hour to send analog data message from transmitter to receiver.

PaulS

Quote
I don't think RTC is good choice it consumes more power.
From its own battery, which will last a year or more.

But, fine, struggle along on your own, stuck in your own ways.
The art of getting good answers lies in asking good questions.

jremington

#7
Dec 06, 2018, 04:40 pm Last Edit: Dec 06, 2018, 04:40 pm by jremington
Quote
I don't think RTC is good choice it consumes more power.
So, it was a bad idea to put an RTC in every personal computer that has been made over the last, oh, 30 years.

bmg1234

Sorry if i was mistaken. Thank you i will try using RTC.

wvmarle

I don't think RTC is good choice it consumes more power.
More power than what?

It's the normal way of doing it.

But that battery level you want to measure - is that the same battery that powers the Arduino? How do you plan to measure this?
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

bmg1234

But that battery level you want to measure - is that the same battery that powers the Arduino? How do you plan to measure this?
Battery will be placed at transmitter side. i want to measure transmitter battery voltage at receiver side.

wvmarle

So you have a sensor that wakes up and takes a measurement once every few days, a measurement that needs to be transmitted.

But you're taking the battery level every five hours, and then transmit that as well. Isn't THAT a massive waste of power? That one transmission easily takes as much battery power as the days sleep in between sensor measurements.

Maybe I'm missing something. The description is pretty vague, really. Images would be very helpful to picture what's really going on.

I'm ignoring the part where you suggest that you measure the battery voltage magically from a distance... because that just totally doesn't make any sense so there must be more to it.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

bmg1234

Hello

Thank you for your response. I am doing project for fuel tank cap security system. some one can cut the battery and steal the fuel. every one hours driver cannot go and check that there is battery connected or not. tank will be open by drive 3 days once. what if some one cuts the battery and driver didn't check for 3 days.

so i want to make sure that battery is connected every few hours at receiver side. receiver will be connected to GPS tracking device where we can see the status of connection.

If this is useless. can someone please tell me how to check that there is battery connected or connection between transmitter and receiver is fine.

wvmarle

It sounds like you're going to place some sensor at the cap that detects whether it's being opened; make sure you wire it in a way that it's a normally closed circuit, which opens when the cap is unscrewed. That way you can detect whether the wires to the cap are cut.

The normal solution is to hide the battery and the rest of the system - put it in an inaccessible place (e.g. inside the vehicle, and have it trigger like a normal car alarm as well, so by movement or doors opening, before the thief can reach the actual electronics and disable the thing). I remember that it used to be commonplace to have a red LED blinking to indicate a car had an alarm present (sometimes just a blinking LED to pretend it's there), thus preventing thieves from even attempting the theft. Do mark your car as having such a system, it's enough to deter all but the most determined thieves (which would likely just steal the whole vehicle if they can't get to the fuel).

The only way to make sure a battery is there and your device is working is to power up the battery powered device and have it transmit a message. That costs a lot of power.

Not likely a would-be thief will spend the time searching for how to disable a battery when trying to steal your fuel. Even so: stealing fuel won't take long, can't imagine a thief would spend more than 5-10 mins on that, so a once every 5 hour check is far too little. The theft is likely to be completed long before the message is due.

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

bmg1234

Hello

I totally agree with what you explained and its fine. what if fuel cap is open and i don't receive message at receiver side. what i should is battery dead or some other issue. that is why to make sure battery is alive and communication is good i want some data to transfer one in a day whether its battery status or any other when sensor is not activated.

Can you please give me some ides how this can be done.

I am thinking to use RTC to interrupt some digital pin by settings time. Interrupt pin will be enabled and information is sent to receiver.

Please correct me if i am wrong and help me to solve this issue.

Go Up