johncollin
Google translates as:
Hey
I’ve been wondering if Ruuvi could be used as a simple voltage logger. The current need would be to monitor the 12V voltage of a standard lead-acid battery, but this could be applied to any voltage measurement.
Could Ruuvi’s battery voltage measurement be easily used for this purpose? I would use resistors to scale the current measurement range (what could it be?) to fit 12V and again scale the measurement results from the csv table back to the correct one.
Would you be able to find a ready-made guide somewhere, or some tips:
Battery voltage measurement range?
At what point on the circuit board / schematic is it best to “stab”?
Or is it easier to convert some other measurement quantity into an external voltage measurement?
OH679GD
HQJaTu
The ADC converter can be found in several free GPIO ports. For the battery as a friend MAX471 (From China MAX471 Spanning Stroom Sensor Module Hoge Precisie Detectie Board Dc 3 36V Lading Ontlading Monitor Voor Arduino|Sensoren| - AliExpress 3.55€ / pc). The battery voltage goes through that and you get a 0-1.5 VDC output from the 0-14.4 VDC input, which is then run through the AD converter and you get a number from the digital side. What the number means must of course be calibrated separately.
Although not much money has been spent yet, now the real work begins: the company needs to know how to read that pin and pass it on to someone.
Surely someone has already done Tuommonen?
johncollin
Thanks for the comment, HQJaTu
That would probably be a workable solution, but as you said, the work only starts when the company starts “stabbing”.
However, I’m looking for a simple solution that doesn’t touch programming, but uses the existing measurement and scales it appropriately at both ends and tries to get by with as few changes as possible. I can keep a hammer and a knife in my hands and have good tools for surface joining work, but I don’t want to change the software. Starting threshold too high.
otso Staff
RuuviTag’s operating voltage range is 1.8 - 3.6 V, as such, if the voltage can be scaled to that range, the measurement should be successful.
A bigger question mark in measuring a lead-acid battery is the details of voltage scaling, the RuuviTag draws about 20 mA of current during radio transmission. Maybe some operational amplifier connection as a current buffer could work for this? It should also be noted that the RuuviTag is quite a capacitive load, so the connection should be thought of as one that remains stable and on the other hand has time to react to the radio’s current spikes. You would hardly get enough power through the resistor distribution alone, or if you put very small resistors, the battery will drain through the resistor distribution.
I know of at least one project where RuuviTags were used to measure LiFePo batteries, as they naturally have a measurement range of about 3.2 - 3.6 V.
johncollin
Thanks Otso for the idea!
I haven’t even thought that you could do something like that, that is, convert the battery voltage into a battery voltage and use it as Ruuvi’s supply.
Rather, I thought that Ruuvu’s supply would be from the battery in the normal way and the battery voltage measurement would be detached for other use. This of course requires:
a) the analog input measuring the battery voltage can be disconnected by “stabbing” and connected to a new use.
b) the firmware does not use the battery voltage information for any critical operation,
c) the electrical characteristics of the voltage input must be known (impedance, measurement range,…?). You can get them from data sheets .
d) it must be known how the measurement is scaled in the software from the electronic measurement range to “visible on the screen”. Is the entire range used, e.g. 0…5V, or is it limited in the software, e.g. 1…4V. Well, this can be determined by experimenting. or from source code if well documented.
Of course, all of this can be figured out by yourself, but to save time I thought that someone else has probably already done something like this or at least tried.
Another application for such a measurement would be current measurement with a shunt. It is simple to implement when the meter is inherently galvanically isolated.
If the job turns out to be very difficult, Otso’s idea is a viable option.
Otso
RuuviTag measures the operating voltage directly from the VDD pin, i.e. there is no separate GPIO pin that can be disconnected from the battery and connected to the batteries.
As such, the test point at the bottom of the board could be used as an ADC, in the simplest way the firmware could measure the analog pin by changing the section · https://github.com/ruuvi/ruuvi.drivers.c/blob/master/src/tasks/ruuvi_task_adc.c RI_ADC_AINVDD to RI_ADC_AIN0 … RI_ADC_AIN0 7.
The measurement range, impedance and accuracy of the ADC depends on the configuration, if I remember correctly, the configuration is 10 us sample time, 1x measurement (no oversampling) and the incoming voltage is routed to 1/6 voltage division and compared to the internal 0.6 V voltage reference.
From this it follows that the measurement range of the ADC is 0 … 3.6V and the input impedance is a maximum of 100 kohm. The firmware reports the voltage as measured, but the data format limits the voltage to between 1600 mV … 3647 mV. Pins P0.30 / P0.31, AIN6 / AIN7 are free in the last PCB revision B8: ruuvitag_hw/ruuvitag_revb8_schematic.pdf at master · ruuvi/ruuvitag_hw · GitHub
They can be accessed from the base’s test points: RuuviLab | Pin-out Information
There is quite a lot to adjust here as well, but it should be doable
johncollin
Thanks again Otso for the thorough answer. It’s a shame that you can’t really get general-purpose voltage measurement from that, because the final range doesn’t start from zero.
However, both options are well suited for measuring the 12V battery voltage. Perhaps, however, that first option of measuring through the battery compartment is cooler.
I will report as soon as I have time to try it.