Best Sleep Mode for Atmega328p while using ADC

Hi everyone,

Im working a project that i get liquid samples on the my electrodes. And i observe the capacitance change on the electrodes when luquid is sampled. After observing the capacitance changes, im going to write the time instance to the EEPROM.

However, i also have to use a single coin cell battery. I have to run the system at least 4-5 months with single coin cell battery.

I do not know much about sleep modes of the chip. Is this possible ? If it is possible which sleep mode is suitable for me ?

Thank you so much,

You have to tell us more about your project. What external circuitry do you have on your Arduino (wiring diagram)? How often do you have to sample the liquids (tell us the least frequency still acceptable)?

As you’re writing to the EEPROM the frequency must be very low because only 1k of EEPROM memory is available. If a sample is 16bit that gives 512 data points. Spread over 5 months, that’s about one sample every 8 hours (given only one liquid has to be sampled).

Thank you so much for your answer.

Here is my schematic

Basically, i have 4 interdigited electrodes. The user will sample a liquid to electrodes in different times. For example, the liquid comes to first electrode might be tomorrow at 14:22, to second electrode might be 14:23, to third electrode might be 14:25 etc. I have to get the time informations of them and send the data via NFC.

The thing is that the system might be given to user after 5 months since it was produced. When it was produced, it will start to consume power from 3V coin cell battery and i want to use it at least 4 months.

The sampling time is not certain, it will be given to a user maybe after 2 months since it was produced. But it is possible to arrange a initialization method to indicate that it was given to user and start to work. However, after giving the system to user (after initialization), the system should check the ADC values that it gets from electrodes because when the liquid will come is unknown.

I was thinking that, is it possible to wake up the system when the ADC value of first electrode changes ? Up to that time, the system will sleep but needs to check the ADC values.

Thank you,

is it possible to wake up the system when the ADC value of first electrode changes ?

No, but you can wake up the processor at arbitrary intervals, sample and make a decision. Power consumption in deep sleep is negligible.

Excellent guide to power saving and sleep modes.

Note that there is a sleep_mode_adc that will allow an ADC wakeup, but in that mode the processor still consumes over 6 mA, and won't run for long on batteries.

It is possible to switch off adc and wakeup via interrupt on hardware interrupt pins. If you know the Analog value to wakeup arduino do it via comparator something like lm393 Output attached to interrupt pin after interrupt is triggered switch on adc and do whatever you want with it.

The sampling time is not certain, it will be given to a user maybe after 2 months since it was produced. But it is possible to arrange a initialization method to indicate that it was given to user and start to work. However, after giving the system to user (after initialization), the system should check the ADC values that it gets from electrodes because when the liquid will come is unknown.

How often do you have to sample to be sure to detect that liquid? So for example is a sampling frequency of one sample per minute sufficient? You don't have an RTC in your circuit, how do you know the exact time to log?