[riot-devel] Soil Moisture Sensor

ALESSANDRO NICOLI alessandro.nicoli at studenti.unipr.it
Thu Oct 13 11:17:37 CEST 2016


Hi Peter,
I've used the default parameters for ADC_0, that are described in the
attached (RIOT/boards/samr21-xpro/include/periph_conf.h).

Hi Akshay,
Yes, i tried to let the sensor floats in air, with a 10bit precision, and
it gives me back a plausible value (less than 40/1024).
Than i tried to put it in mineral water, and it replied with a value next
to 1000/1024, that it seems to be correct.

Only in the soil (where it should works correctly) it gives back a no-sense
value...and i don't know why.


thanks a lot!

*best regards, *
*Alessandro*

2016-10-12 9:48 GMT+02:00 <devel-request at riot-os.org>:

> Send devel mailing list submissions to
>         devel at riot-os.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.riot-os.org/mailman/listinfo/devel
> or, via email, send a message with subject or body 'help' to
>         devel-request at riot-os.org
>
> You can reach the person managing the list at
>         devel-owner at riot-os.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of devel digest..."
>
>
> Today's Topics:
>
>    1. Soil Moisture Sensor (ALESSANDRO NICOLI)
>    2. Re: Soil Moisture Sensor (Peter Kietzmann)
>    3. Re: Soil Moisture Sensor (Akshay Mishra)
>    4. I2C driver function to read a register with 16 bits       address
>       (Kees Bakker)
>    5. Re: alternative socket-api (Kaspar Schleiser)
>    6. Re: I2C driver function to read a register with 16 bits
>       address (Hauke Petersen)
>    7. Coding conventions amendment (Oleg Hahm)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 11 Oct 2016 16:32:22 +0200
> From: ALESSANDRO NICOLI <alessandro.nicoli at studenti.unipr.it>
> To: RIoT Dev List <devel at riot-os.org>
> Subject: [riot-devel] Soil Moisture Sensor
> Message-ID:
>         <CAFsA-_2x_4gmfBn8KK7740SYFwx22hiCzpz2ayq
> fTKOg6iWGaA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi all,
> I'm trying to use a Soil moisture sensor with a Samr21-xpro and RIOT os.
> The sensor used is as follows :
>
> https://www.seeedstudio.com/Grove-Moisture-Sensor-p-955.html
>
>
> I have *4 soil jars (with different moisture concentrations)* that i'm
> gonna use for testing,  i've already tried to get moisture values with
> *Arduino
> Uno* and they seem to be acceptable.
> *For both, i used the built in ADC with 10 bits of resolution.*
>
> But when i try to use the samr21, it gets me always 330 as value (10 bits
> ADC).
> For the SAMR21* i used the default parameters for ADC_0*.
>
> There is a way to rectify the readings, or some kind of calibration to do?
>
>
> Thanks a lot,
> *best regards, *
> *Alessandro*
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.riot-os.org/pipermail/devel/attachments/
> 20161011/89c17d33/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 11 Oct 2016 16:46:21 +0200
> From: Peter Kietzmann <peter.kietzmann at haw-hamburg.de>
> To: RIOT OS kernel developers <devel at riot-os.org>
> Subject: Re: [riot-devel] Soil Moisture Sensor
> Message-ID: <f56b24b5-c67b-fac8-8321-0ced512746a9 at haw-hamburg.de>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Alessandro,
>
> what are the default values for ADC_0 on the samr21-xpro board and which
> driver did you use?
>
> Best
> Peter
>
> Am 11.10.2016 um 16:32 schrieb ALESSANDRO NICOLI:
> > Hi all,
> > I'm trying to use a Soil moisture sensor with a Samr21-xpro and RIOT os.
> > The sensor used is as follows :
> >
> > https://www.seeedstudio.com/Grove-Moisture-Sensor-p-955.html
> >
> >
> > I have *4 soil jars (with different moisture concentrations)* that i'm
> > gonna use for testing,  i've already tried to get moisture values with
> *Arduino
> > Uno* and they seem to be acceptable.
> > *For both, i used the built in ADC with 10 bits of resolution.*
> >
> > But when i try to use the samr21, it gets me always 330 as value (10 bits
> > ADC).
> > For the SAMR21* i used the default parameters for ADC_0*.
> >
> > There is a way to rectify the readings, or some kind of calibration to
> do?
> >
> >
> > Thanks a lot,
> > *best regards, *
> > *Alessandro*
> >
> >
> >
> > _______________________________________________
> > devel mailing list
> > devel at riot-os.org
> > https://lists.riot-os.org/mailman/listinfo/devel
> >
>
> --
> Peter Kietzmann
>
> Hamburg University of Applied Sciences
> Dept. Informatik, Internet Technologies Group
> Berliner Tor 7, 20099 Hamburg, Germany
> Fon: +49-40-42875-8426
> Web: http://www.haw-hamburg.de/inet
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 11 Oct 2016 20:28:08 +0530
> From: Akshay Mishra <akshay at dspworks.in>
> To: RIOT OS kernel developers <devel at riot-os.org>
> Subject: Re: [riot-devel] Soil Moisture Sensor
> Message-ID:
>         <CABSY_Zsg8Q_x2-ADsCQQ9mAnR8FiPsBbAGDGPhfPBnn_
> 1tySnw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Start with measuring the voltage value? Try giving some different analog
> input less than 3.3V
>
>
>
> On Tuesday, 11 October 2016, ALESSANDRO NICOLI <
> alessandro.nicoli at studenti.unipr.it> wrote:
>
> > Hi all,
> > I'm trying to use a Soil moisture sensor with a Samr21-xpro and RIOT os.
> > The sensor used is as follows :
> >
> > https://www.seeedstudio.com/Grove-Moisture-Sensor-p-955.html
> >
> >
> > I have *4 soil jars (with different moisture concentrations)* that i'm
> > gonna use for testing,  i've already tried to get moisture values with
> *Arduino
> > Uno* and they seem to be acceptable.
> > *For both, i used the built in ADC with 10 bits of resolution.*
> >
> > But when i try to use the samr21, it gets me always 330 as value (10 bits
> > ADC).
> > For the SAMR21* i used the default parameters for ADC_0*.
> >
> > There is a way to rectify the readings, or some kind of calibration to
> do?
> >
> >
> > Thanks a lot,
> > *best regards, *
> > *Alessandro*
> >
>
>
> --
> *Akshay Mishra*
> *Chief Technology Officer*
> GSM: +91 98693 21611
> Skype: mishrakshay
> Office: +91 22 2500 3488
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.riot-os.org/pipermail/devel/attachments/
> 20161011/55e4b13d/attachment-0001.html>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 11 Oct 2016 21:29:27 +0200
> From: Kees Bakker <kees at sodaq.com>
> To: RIOT OS kernel developers <devel at riot-os.org>
> Subject: [riot-devel] I2C driver function to read a register with 16
>         bits    address
> Message-ID: <ac4b8681-6b0e-3aeb-2f57-7be5d938fe6a at sodaq.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hi,
>
> The SHT2x I2C device has a register with a 16 bits address. If I'm correct
> we don't have a function in the I2C driver to do that. Right?
>
> Assuming we need to extend the driver API, what would be a good name
> for such a function?
>
> All I can come up with is i2c_read_regs2:
>
> /**
>   * @brief   Read multiple bytes from a register at the I2C slave with
> the given
>   *          address
>   *
>   * @param[in]  dev          I2C peripheral device
>   * @param[in]  address      bus address of the target device
>   * @param[in]  reg          the 16 bits register address on the
> targeted I2C device
>   * @param[out] data         array holding the received bytes
>   * @param[in]  length       the number of bytes to read into `data`
>   *
>   * @return                  the number of bytes that were read
>   * @return                  -1 on undefined device given
>   */
> int i2c_read_regs2(i2c_t dev, uint8_t address, uint16_t reg,
>                    char *data, int length);
>
> --
> Kees Bakker
> Founder
> SODAQ
> M. 0031617737165
> www.sodaq.com
>
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 11 Oct 2016 23:35:08 +0200
> From: Kaspar Schleiser <kaspar at schleiser.de>
> To: RIOT OS kernel developers <devel at riot-os.org>
> Subject: Re: [riot-devel] alternative socket-api
> Message-ID: <ffaba4af-6161-02ce-1661-3adcfeb58bad at schleiser.de>
> Content-Type: text/plain; charset=utf-8
>
> Hi,
>
> On 10/07/2016 03:49 PM, Alexander Aring wrote:
> > came across [0] today and remembers me that RIOT also plans some simple
> > "conn" API for a bsd socket alternative.
>
> Interesting concept.
>
> Unfortunately it relies on in-stack dynamic resource management (e.g.,
> "tcp_connect()" returns an integer as resource handle, which thus must
> be managed by the tcp implementation), which sock tries to avoid.
>
> Kaspar
>
>
> ------------------------------
>
> Message: 6
> Date: Wed, 12 Oct 2016 09:48:23 +0200
> From: Hauke Petersen <hauke.petersen at fu-berlin.de>
> To: RIOT OS kernel developers <devel at riot-os.org>
> Subject: Re: [riot-devel] I2C driver function to read a register with
>         16 bits address
> Message-ID: <41830aae-a9f4-3a05-5124-4c601df18cf0 at fu-berlin.de>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hi Kees,
>
> you are right, the current interface does not support 16-bit registers.
> We are however overhauling the I2C interface as we speak, and the
> re-worked interface does have support for them (see [1]). Feel free to
> take a look and comment on the proposal!
>
> Cheers,
> Hauke
>
> [1] https://github.com/RIOT-OS/RIOT/pull/4926
>
>
> On 11.10.2016 21:29, Kees Bakker wrote:
> > Hi,
> >
> > The SHT2x I2C device has a register with a 16 bits address. If I'm
> > correct
> > we don't have a function in the I2C driver to do that. Right?
> >
> > Assuming we need to extend the driver API, what would be a good name
> > for such a function?
> >
> > All I can come up with is i2c_read_regs2:
> >
> > /**
> >  * @brief   Read multiple bytes from a register at the I2C slave with
> > the given
> >  *          address
> >  *
> >  * @param[in]  dev          I2C peripheral device
> >  * @param[in]  address      bus address of the target device
> >  * @param[in]  reg          the 16 bits register address on the
> > targeted I2C device
> >  * @param[out] data         array holding the received bytes
> >  * @param[in]  length       the number of bytes to read into `data`
> >  *
> >  * @return                  the number of bytes that were read
> >  * @return                  -1 on undefined device given
> >  */
> > int i2c_read_regs2(i2c_t dev, uint8_t address, uint16_t reg,
> >                   char *data, int length);
> >
>
>
>
> ------------------------------
>
> Message: 7
> Date: Wed, 12 Oct 2016 09:48:28 +0200
> From: Oleg Hahm <oliver.hahm at inria.fr>
> To: RIOT OS kernel developers <devel at riot-os.org>
> Subject: [riot-devel] Coding conventions amendment
> Message-ID: <20161012074827.GF12152 at hobbykeller.org>
> Content-Type: text/plain; charset="utf-8"
>
> Dear rolling IoTlers,
>
> as far I'm concerned it has been an undocumented coding convention so far
> to
> use `int` or `unsigned int` for iterator variables in a loop instead of
> fixed
> width integer types. Does anybody object to adding this to the coding
> conventions explicitly?
>
> Cheers,
> Oleg
> --
> The problem with a SQL security joke is that Sony don't get it.
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: signature.asc
> Type: application/pgp-signature
> Size: 801 bytes
> Desc: not available
> URL: <http://lists.riot-os.org/pipermail/devel/attachments/
> 20161012/c1f2f768/attachment.sig>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>
>
> ------------------------------
>
> End of devel Digest, Vol 44, Issue 10
> *************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20161013/b8ece74c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: periph_conf.h
Type: text/x-chdr
Size: 12837 bytes
Desc: not available
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20161013/b8ece74c/attachment-0001.h>


More information about the devel mailing list