Ruuvin käyttö jänniteloggerina

Hei
Olen miettinyt, voisiko Ruuvia käyttää yksinkertaisena jänniteloggerina. Nykyinen tarve olisi seurata tavallisen lyijyakun 12V jännitettä, mutta tätä voisi soveltaa mihin vain jännitemittaukseen.

Voisiko Ruuvin paristojännitteen mittauksen ottaa helposti tähän käyttöön? Skaalaisin vastuksilla nykyisen mittausalueen (mikähän se mahtaa olla?) 12V:lle sopivaksi ja taas uudestaan skaalaisin mittaustulokset csv-taulukosta takaisin oikeaksi.

Löytyisiköhän tästä jo valmiiksi tehty ohje jostain, tai sitten vihjeitä:
Paristojännitteen mittausalue?
Mistä kohtaa piirilevyllä / schemassa on paras “puukottaa”?

Vai voiko jonkin muun mittaussuureen helpommin muuttaa ulkoisen jännitteen mittaukseksi?

OH679GD

ADC-muunnin löytyy useammastakin vapaasta GPIO-portista. Akulle kaveriksi MAX471 (Kiinasta MAX471 Spanning Stroom Sensor Module Hoge Precisie Detectie Board Dc 3 36V Lading Ontlading Monitor Voor Arduino|Sensoren| - AliExpress 3,55€ / kpl). Akun jännite pyörähtää tuon läpi ja ulos saat 0-14,4 VDC inputista 0-1,5 VDC outputin joka siis ajetaan AD-muuntimen läpi ja saat asiasta digitaalipuolelta numeron. Se mitä numero tarkoittaa, pitää tietysti erikseen kalibroida.

Vaikka rahaa ei vielä ole tärvelty paljoa, nyt alkaa varsinainen työ: firmiksen pitää osata tuota pinniä lueskella ja johonkin välittää eteenpäin.

Tuommosen varmasti joku on jo tehnyt?

Kiitos kommentista, HQJaTu
Tuo varmaankin olisi toimiva ratkaisu, mutta niinkuin sanoit, niin sitten vasta alkaa työ, kun firmistä alkaa “puukottamaan”.
Haen kuitenkin yksinkertaista ratkaisua, jossa ei kosketa ohjelmointiin, vaan käytetään olemassaolevaa mittausta ja skaalataan sopivasti molemmissa päissä ja koetetaan selvitä mahdollisimman pienillä muutoksilla. Minulla kyllä pysyy kolvi ja veitsi käsissä ja on hyvöt työkalut pintaliitostyöhön, mutta ohjelmiston muuttamiseen en viitsi ryhtyä. Liian suuri aloituskynnys.

RuuviTagin käyttöjännitealue on 1.8 - 3.6 V, sinänsä jos jännitteen saa skaalattua tuolle alueelle niin mittaamisen pitäisi onnistua.

Isompi kysymysmerkki lyijyakun mittaamisessa on jännitteen skaalaamisen yksityiskohdat, RuuviTag ottaa noin 20 mA virtaa radiolähetyksen aikana. Ehkä jokin operaatiovahvistinkytkentä virtapuskuriksi voisi toimia tähän? Siinäkin pitää huomata että RuuviTag on aika kapasitiivinen kuorma, eli kytkentä pitäisi miettiä sellaiseksi joka pysyy vakaana ja toisaalta ehtii reagoimaan radion virtapiikkeihin. Ihan pelkän vastusjaon läpi tuskin saisi tarpeaksi virtaa tai jos laittaa kovin pienet vastukset niin akku tyhjenee vastusjaon läpi.

Tiedän ainakin yhden projektin jossa RuuviTageja käytettiin LiFePo-akkujen mittaamiseen, niissä kun on luonnostaan noin 3.2 - 3.6 V mittausväli.

Kiitos Otso ideasta!
En ole ajatellutkaan, että noinkin voisi tehdä, eli muuntaa akkujännite paristojännitteeksi ja käyttää sitä Ruuvin syöttönä.

Pikemminkin ajattelin, että Ruuvin syöttö olisi patterista normaaliin tapaan ja paristojännitteen mittaus irrotettaisiin muuhun käyttöön. Tämä tietysti edellyttää:
a) paristojännitettä mittaava analogiatulo on irrotettavissa “puukottamalla” ja kytkettävissä uuteen käyttöön.
b) firmware ei käytä paristojännitetietoa mihinkään kriittiseen toimintaan,
c) pitää olla tiedossa jännitetulon sähköiset ominaisuudet (impedanssi, mittausalue,…?). Nuo saanee datalehdistä.
d) pitää olla tiedossa, miten mittaus on ohjelmistossa skaalattu sähköisestä mittausalueesta “ruudulla näkyvään”. Onko koko alue käytössä esim. 0…5V vai onko se ohjelmistossa rajoitettu esim. 1…4V. No, tämä selvinnee kokeilemalla. tai lähdekoodista, jos hyvin dokumentoitu.

Kaikki tämä on toki itse selvitettävissä, mutta aikaa säästääkseni ajattelin, että joku muukin on varmaan tällaista jo tehnyt tai ainakin yrittänyt.

Toinen käyttökohde tällaiselle mittaukselle olisi virtamittaus shuntin kanssa. On yksinkertaista toteuttaa, kun mittari on luonnostaan galvaanisesti erotettu.

Jos homma osoittautuu kovin hankalaksi, niin tuo Otson idea on varteenotettava vaihtoehto.

RuuviTag mittaa käyttöjännitteen suoraan VDD-pinnistä, eli siihen ei ole erillistä GPIO-pinniä jonka voisi irroittaa patterista ja kytkeä akkuihin.

Sinänsä levyn pohjassa olevan testipisteen voisi ottaa käyttöön ADCnä, yksinkertaisimmillaan firmware saattaisi mitata analogipinniä vaihtamalla kohdan ruuvi.drivers.c/ruuvi_task_adc.c at 0ccaa6963fc2e9b0be3f3c556f9a8376bd177eac · ruuvi/ruuvi.drivers.c · GitHub RI_ADC_AINVDD kanavaksi RI_ADC_AIN0 … RI_ADC_AIN7.

ADCn mittausalue, impedanssi ja tarkkuus riippuu konfiguraatiosta, jos nyt oikein muistan niin konfiguraatio on 10 us sample-aika, 1x mittaus (ei oversamplausta) ja sisään tuleva jännite ohjataan 1/6 jännitejakoon ja verrataan sisäiseen 0.6 V jännitereferenssiin.

Tästä sitten seuraa että mittausalue ADCllä on 0 … 3.6V ja sisääntuloimpedanssi enintään 100 kohm. Firmware ilmoittaa jännitteen sellaisena kuin se on mitattu, mutta dataformaatti rajoittaa jännitteen välille 1600 mV … 3647 mV. Pinnit P0.30 / P0.31, AIN6 / AIN7 ovat vapaana viimeisessä piirilevyrevisiossa B8: ruuvitag_hw/ruuvitag_revb8_schematic.pdf at master · ruuvi/ruuvitag_hw · GitHub

Niihin pääsee käsiksi pohjan testipisteistä: RuuviLab | Pin-out Information

On tässäkin melkoisen paljon säädettävää mutta pitäisi olla tehtävissä

Kiitos taas Otso perusteellisesta vastauksesta. Harmi, ettei tuosta oikein saa yleiskäyttöistä jännitemittausta, koska lopullinen alue ei lähde nollasta.

Molemmat vaihtoehdot sopivat kuitenkin hyvin 12V akkujännitteen mittaukseen. Ehkä kuitenkin tuo eka vaihtoehto paristopesän kautta mittauksesta on siistimpi.

Raportoin, kunhan ehdin kokeilemaan.

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.