Wine bottle storage quality sensor thesis

Thread Starter

Svennn

Joined Aug 17, 2022
14
Hello,

I've dealt with long term running projects using microconstrollers. The key is to use one that allows nano power operation and only sense the environment once every so often, not every millisecond or even every second. The longer you can go without a new reading the longer the battery lasts. One i did was a refrigerator monitor that had AA batteries that would last for 2 years. That's a long time for batteries to last in an electronic device. One of the main points is that a new reading was only needed about once every 10 minutes (or something like that). That meant that the MCU would only have to wake up for maybe 1ms every 10 minutes to take a reading, and the rest of the time it could stay in sleep mode where the power consumption was in the nano watts. Since power is proportional to duty cycle, if you make a measurement that takes 1 millisecond every other millisecond you only use 50 percent power, so if you measure for 1 millisecond every second you only use 1/1000 of the power, and of course 1 millisecond every 100 seconds you only use 1/100000 of the power, etc., etc. There is a limit to that of course but that's the basic idea.
Still i question if 2 years would be enough because this would be best for expensive wines that are relatively old such as 10 to 25 years or more. That means the device has to be ultra reliable as well as have some sort of constant input power or periodic charging to replenish the battery.

This kind of project also falls under the category of security and that's probably the toughest category :)
One of the really important points i think is that the way a wine shows a problem is through the chemical changes that it went through over the years not necessarily what happened to the bottle. I would think a bottle could be sitting on a wine rack for 20 years and then the wine dumped out and replaced with new wine. To ensure that the measurement traveled with that particular liquid for the entire time would probably be impossible to guarantee as there are still too many ways to get around the system. Also, since the best test is to taste the wine i would think that a chemical measurement of some kind would be the ultimate test that would tell all about the past treatment of the wine itself. If you could do that it would be really great, provided that somebody hasnt done that already.

As a point of purely electrical design i guess it would be an interesting project, but if you could make it a practical one as well, you win the bigger prize :)
Good morning!

I appreciate the time that you took to respond. I have a question regarding the power consumption that you spoke of and how one can calculate it through the use of the datasheets. This temperature + humidity sensor uses 600 μA while measuring @3.3V input. If we assume that it uses 600 μA while measuring for a full second. If the device takes 0.5ms to power up and takes 4.5ms to complete a single measurement. Can we then calculate the expected current draw as follows: 600μA*(5ms/1000ms) = 3μA?

With regards to I2C, when selecting components is I2C communication speed of importance? Is there any other factors that I should be concerned over?
 

Ya’akov

Joined Jan 27, 2019
9,165
While this video is concentrating on the ESP8266, it explains the test setup to measure current consumption for MCUs.

Andreas also has other low power content. He's very good at doing things rigorously.

 

atferrari

Joined Jan 6, 2004
4,770
I have experience in using temperature sensors (in long voyages periods) and shock/impact sensors. Hope this could spark some ideas.

In long voyages, for bulk cargoes (fish meal - grain, byproducts and others) temperature sensors are of common use. In bulk carriers (as in silos ashore) they are deeply buried at various levels below surface. Read every xx hours or automatically interrogated. They are usually wire linked. BTW, humidity gets attention too.

I've seen shock / impact sensors installed on important parts / components of project cargo, fitted with their own battery. They cannot be accessed in voyage and their data can be read via a proprietary software at destination. Some can even distinguish ship's hammering / pitching / rolling from harmful shocks. For periods of maybe three or four months, now that I think of it, batteries were very small.

A cheap solution for the above with not so expensive but still delicate cargo are mechanical sensors stuck on the sides. If for any reason the piece, goes out of the vertical collapsing on the ground a visual indication changes from green to red and no matter what you do stays like that.
 

MrAl

Joined Jun 17, 2014
11,486
Good morning!

I appreciate the time that you took to respond. I have a question regarding the power consumption that you spoke of and how one can calculate it through the use of the datasheets. This temperature + humidity sensor uses 600 μA while measuring @3.3V input. If we assume that it uses 600 μA while measuring for a full second. If the device takes 0.5ms to power up and takes 4.5ms to complete a single measurement. Can we then calculate the expected current draw as follows: 600μA*(5ms/1000ms) = 3μA?

With regards to I2C, when selecting components is I2C communication speed of importance? Is there any other factors that I should be concerned over?
Hi,

Yes if you take one reading per second and provided that the device does not draw a surge current when it first turns on or starts to take a reading. It's easiest to think of in terms of power and duty cycle.
The power is of course P=I*V
and if the duty cycle is 5/1000 then the average power is:
Pavg=P*5/1000
and so the average current is:
Iavg=Pavg/v
and that's the best way to think of it i think because power averages over time.

The I2C speed is only as important is it needs to be for your project.
If the I2C has to send (let's say) 100 bits and the speed is 1000 bits per second then of course it takes 0.1 second to send the command and then to receive the data it depends on the number of bits again. If the data was 32 bits then the time to receive the data is 0.032 seconds after the measurement is complete. So the total time is 0.1+0.032 which of course is 0.132 seconds. That will of course add to your MCU awake time.
At 10k bits per second, it would be 0.0132 seconds.
If you only have to send 32 bits for the command though and 32 bits of data to receive then the total time at 1k bits per second would be 0.064 seconds but at 10k bits per second it would be 0.0064. If you can get 100k bits then it would take 0.00064 seconds which starts to look reasonable.
 

Thread Starter

Svennn

Joined Aug 17, 2022
14
Good day,
I have some questions concerning the power draw of these sensors while the MCU is entering and exiting sleep mode to take measurements.

Some of the questions I have are:

  • What are the advantages/disadvantages of powering the sensors (granted they do not exceed the current limit) through the GPIO pins? Would this minimize power consumption or is it bad practice?
  • Is a better alternative powering the sensors through the 3.3V rail of the MCU and then make use of a switch to power the loads? Is it appropriate to connect the gate of the transistor to a GPIO pin to switch the loads on and off?

If interested, the components I am using are:


If anyone has any experience in projects of this nature, your help will be greatly appreciated!

Thank you.
 
Last edited:

Thread Starter

Svennn

Joined Aug 17, 2022
14
What, precisely, do you mean by "powering the sensors through the GPIO pins"?

Can you explain what you intend to do?
The GPIO pin will be connected to the supply voltage of the sensor. When a measurement is needed, the GPIO output will be set to high.
 

Ya’akov

Joined Jan 27, 2019
9,165
The GPIO pin will be connected to the supply voltage of the sensor. When a measurement is needed, the GPIO output will be set to high.
I know it is clear to you but "the GPIO pin" is ambiguous. I can guess at it. Do you mean you'd dedicate a pin to the Vcc of each sensor and set them high as each is required?

If so, you are almost certainly better off using the pin to turn on a MOSFET that connects the sensor to the power rail. The problem with using the pin directly is that it was not designed to be a power source and potential unexpected consequences are quite likely.
 

Thread Starter

Svennn

Joined Aug 17, 2022
14
I know it is clear to you but "the GPIO pin" is ambiguous. I can guess at it. Do you mean you'd dedicate a pin to the Vcc of each sensor and set them high as each is required?

If so, you are almost certainly better off using the pin to turn on a MOSFET that connects the sensor to the power rail. The problem with using the pin directly is that it was not designed to be a power source and potential unexpected consequences are quite likely.
That's exactly what I mean, thank you Ya'akov.
 
Top