Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

precise analog input device


Ondrej Bajer

Question

Hi guys,

 

I need a Z-Wave analog sensor, that is more precise (and more stable) than a RGBW module. Since my technical skills are very limited, I'm offering a deal to anyone who is interested in building such device for me.

Requirements:

- have to work with HC2, EU frequency

- 4 analog inputs 0-10V

- resolution 12 bit (4096 individual levels) or better

- reports value on POLL or Level Change

- device reports itself to HC2 as a temperature sensor, 0V=0°C, 10V=100°C

- have to work with industrial 0-10V sensors, Rmin=1MOhm (IE: industrial watter level pressure sensor)

- powered by 24V power source

- no batteries needed for operation

- DIN rail casing

 

I'm offering 250EUR for a working device.

Anyone interested, please let me know.

 

Background story: I need to continuously monitor watter level in 3 separate tanks with HC2. I've tried to use RGBW analog input, but watter level was chaning very slowly (cca 0.1V per 14 days) so that RGBW was not able to notice that change. Translation into temperature is needed because temperature is one of the two variables that HC2 is able to visualize using weekly chart (the other is power consumption).

 

Thanks beforehand,

Ondrej Bajer

Please login or register to see this attachment.

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Hi Tinman,

     

    My sensors have accuracy of 0.5% F.S., so getting somewhere closer to this would be nice.

     

    I'm looking for 12 bit ADC, which is 4095 counts.

    4095 counts on 0-10V scale, translates into step size 0,0024V

    This should be achievable using Z-Uno plus two circuits, I hope:

    - The input circuit to adapt 10V to Z-Uno's analog input.

    - Power stabiliser, to adapt 24V power source to Z-Uno's needs.

     

    Are you interested, please?

     

    PS: I would say that many people will be interested in buying such device over time, as 0-10V is defacto standard.

    Yes, Fibaro RGBW module can be adapted, using a buffer circuit from @petergebruers , but RGBW module itself has very poor resolution: 0-10V with a 0.1V step size. That's just 100 individual levels. Simply the ADC in RGBW is meant to be controlled by dimmer/potentiometer, so 100 levels is OK. But for long-term measurement it's not a realiable solution, as I learned. 

    Edited by Ondrej Bajer
    Link to comment
    Share on other sites

    • 0

    me? no, honestly no time, but as you already said, z-uno might work for you. 

    Link to comment
    Share on other sites

    • 0

    Interesting... Unfortunately I am 100% hobbyist and I can not offer production quality work... But I'd like to offer my opinion. I think to achieve that kind of resolution, noise and offset of the zero point through cable loss are your ennemies. Fortunately your signals are slow-changing so you can do analog filtering. I would recommend an integrating ADC (or a few of those) with differential input, like the dirt cheap ADS1115:

     

    Please login or register to see this link.

     

    I have used it to measure battery voltage with 15-bit resolution.

     

    If you look at the example projects of the Z-Uno, I'd say it is capable of doing what you want...

     

    I hope someone picks up your request and offers some help.

     

    Maybe post on the Z-Uno forum too.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • So, how about to produce just a PCB with a power and input circuits and a socket for holding Z-Uno.

    PCB will be equipped with terminals, that can be screwed on to pins from the photo (Haseman DIN rail casing for Fibaro RGBW).

    For the start, let just use standard 12-bit ADC resolution, 0-1023 (which is 10x finer that RGBW module's capability).

     

    Still not interested? :)

     

    Thanks,

    Ondrej

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Maybe you can consider something like this?

    Please login or register to see this link.

    Link to comment
    Share on other sites

    • 0
    On 10/22/2017 at 4:46 PM, Ondrej Bajer said:

    Still not interested? :)

     

    I am a 100% amateur electronics hacker. I know my limitations. In the nineties, I made my own PCBs. Today, I bodge components, modules, SMD parts and adapters on perfboard. I also dabble  my schematics on a piece of paper. I know how to make a schematic in KiCad, but it takes much longer! I only would do it if I had to share something. All my projects are unique, I do not benefit from scale.

     

    It may sound as if I am not proud of my own work... But I am! With my limited tools, I make stuff and enjoy doing so. That's why I shared my opinion, and I hoped to attract some discussion (thanks @jamietang for joining this topic)... And maybe someone can provide you with a professional solution...

     

    This is one of my recent hacks: adding a 0-10 V input to an existing ESP8266 (notice the "Manhattan style" of SMD passives):

     

    H801_mod2.jpeg.93578e6707fc401e49515a3a7633c682.jpeg

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Based on what I did to the poor CA3140E depicted below, I would say that you are much better than me :D 

    Anyway, one piece of Z-Uno is on the way to my residence. I'll try not to kill him too early.

     

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
    1 hour ago, Ondrej Bajer said:

    Based on what I did to the poor CA3140E depicted below, I would say that you are much better than me :D 

     

    On the contrary, your device is *a piece of art* (no kidding!).

     

    I just watched this movie... It seems appropriate to mention it...

     

     

    I'll see what I can find out about the analog input of the Z-Uno. Until now, I have only attached digital sensors to it.

     

    Did I understand correctly... you already own the analog sensors, so digital solutions like the DS18B20 are out of the question?

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I need to continuously measure the fluid level in my nuclear waste tanks, so I have a pair of LMK307 fluid-pressure sensors already submerged in. Datasheet attached.

    I went for analog, 3-wire, 0-10V version, as other options were RS485 or HART protocol, which seemed too complicated to be read by any mass-production z-wave device. What a mistake!

    If I knew, that RGBW module's resolution is so poor and even needs a buffer circuit, I would choose RS485 + some z-wave DYI board instead. Now, I have to use a DIY (Z-Uno) anyway.

     

    By the way, are you aware of liquid-pressure sensor, that emulates DS18B20, aka Dallas digital temperature sensor? As 1-wire input for Dallas is on almost every Z-Wave micromodule...door/window sensor, motion sensor, DIN Rail modules etc. To be honest, I will not throw away my pressure sensors, but Dallas emulation could be a solution for other people looking to solve the similar task.

    Please login or register to see this attachment.

    Edited by Ondrej Bajer
    Link to comment
    Share on other sites

    • 0
    13 hours ago, Ondrej Bajer said:

    so I have a pair of LMK307 fluid-pressure sensors already submerged in. Datasheet attached.

     

    I had a quick glance at the datasheets. Nice device. Lets see if wee can achieve 0.1% accuracy on that 0-10  bus...

     

    13 hours ago, Ondrej Bajer said:

    By the way, are you aware of liquid-pressure sensor, that emulates DS18B20, aka Dallas digital temperature sensor? As 1-wire input for Dallas is on almost every Z-Wave micromodule...door/window sensor, motion sensor, DIN Rail modules etc. To be honest, I will not throw away my pressure sensors, but Dallas emulation could be a solution for other people looking to solve the similar task.

     

    As far as I can tell, the 1-wire thing is pretty much a "Dallas" thing. They sell some interface chips (convert to I2C if I remember well) but I never tried one of those.

     

    1-wire does not use differential signalling like RS-485 or ethernet, and that is one of its problems in noisy environments. It was designed for short distances. But you can make it work with several meters or 10s of meters, if you follow their guideline:

     

    Please login or register to see this link.

     

    The advantage of RS-485 over ethernet is long distance (1 km) at low speed is possible. But ethernet rules because of its high signalling speed and the fact that there is no common ground between endpoints, so it does not introduce ground loops.

     

    Because I'm fairly new to Z-Uno, I did some ADC characterization this morning and I've found these issues:

    1. Reading 4 inputs takes about 1 ms and that is rather slow. I guess it is the typical overhead of the "analogRead" function. I bet the Z-Uno is capable of faster acquisition and processing (DMA?), but I do not think it currently exposes a faster interface. This is not a showstopper for your project. I still have to check if I can get enough noise & hum reduction from sampling about 6 times per 20 ms.
    2. If I sample more than one input, I get input leakage. This is a showstopper. If there is no fix, you would have to use low impedance buffers to the Z-uno inputs (Rout <10 ohm, order of magnitude) - or one buffer and an external multiplexer. But if this can be solved by a software update or workaround, a simple RC filter at the input seems possible.

    I posted the issue (including a demo sketch) and I hope I get an answer today or tomorrow, please check this link:

     

    Please login or register to see this link.

     

    If I find the time, I'll connect an ADS1115 to my Z-Uno and see if I can get better results. I know it works on Arduino, but not all Arduino libraries are Z-Uno compatible.

     

     

     

    Link to comment
    Share on other sites

    • 0

    Thanks, @tinman.  Very useful information. I assumed that the ADC is OK for 10 bit and the specs confirm this. But not really 12 bit if we consider absolute accuracy. Good enough for 0-10 V interface, if we ignore noise performance and ignore the fact that it is not an integrating ADC. I think for 12 bit you would really have to do some measurements... In a previous life I was a test engineer (microchip testing) so I am always skeptical when someone mentions "ADC bits" (or linearity, repeatability, monotonicity, absolute and relative accuracy and drift, missing codes, bandwidth, noise, ...).  Sorry, I got carried away!

     

    I measure  <1 uA at the input at room temperature. Spec says +/ 10 uA but that is probably over temperature range.  Plausible. When I use the mux, I measure up to 60 uA input current, this has to be an issue with the implementation of the read function on the Z-Uno, not the SoC. At least, that is what I think.

     

    So I think I'm still going to test my ADS1115, then find out what I can get from the internal ADC.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi guys,

    so I bought a handbag of components, and tried to put everything together. Result is not that bad - it works at least ;) And when compared to RGBW, it's a HUGE improvement, also.

    I'm reading a value from Analog Input #3 (10bit, 0-1023) every 5140ms.

    Then I report it back as °C. HC2 is set to 10s polling

    For example, an absolute value of 348 is transaled into 38,4°C, maximum value of 1023 will be reported as 102,3°C - which is nice.

    As you can see on the chart, there's a lot of noise visible, but now it's okay for me. The chart shows a fluid level lowering, as I started pump to test the sensor.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

     

    8 hours ago, petergebruers said:

     

    Because I'm fairly new to Z-Uno, I did some ADC characterization this morning and I've found these issues:

    1. Reading 4 inputs takes about 1 ms and that is rather slow. I guess it is the typical overhead of the "analogRead" function. I bet the Z-Uno is capable of faster acquisition and processing (DMA?), but I do not think it currently exposes a faster interface. This is not a showstopper for your project. I still have to check if I can get enough noise & hum reduction from sampling about 6 times per 20 ms.
    2. If I sample more than one input, I get input leakage. This is a showstopper. If there is no fix, you would have to use low impedance buffers to the Z-uno inputs (Rout <10 ohm, order of magnitude) - or one buffer and an external multiplexer. But if this can be solved by a software update or workaround, a simple RC filter at the input seems possible.

     

     

    1) For me, slow reading is not an issue, but for other applications this might be a problem. Especially if one wants to collect more samples over a short period of time and then calculate an average to eliminate spikes. Clearly, this ADC implementation is not meant for audio recording, of course.

     

    2) I found the same issue. Even if I pull-down A0-A2 with resistors, there's a leakage between inputs. A0-A02 inputs are giving very similar values to the A3, where I have external voltage applied. I tried to put 1s delay before reading each input, but that didn't help either. (Now I wonder what would happen, if I read A3, then read A0, wait 1s and read A0 again...for a shame I cannot test it today...)

     

    Anyway, it looks like a viable solution, so I will try to experiment with different pull-downs and capactitors for low-passes. Just to see, whether I'm practically limited to a single Analog Input per Z-Uno board, or not. Low impedance input buffer would be a sure solution, but I'd like to avoid of using more IC's, as much as possible.

     

    One thing to add:

    My watter-pressure sensor gives 10V for 6 meters of watter level. Height of my tank to the very top is 2,7m. That means that the maximal voltage I will ever get from the sensor is 4,5V.

    Since Analog Input pins of Z-Uno are operating in range 0-3,3V, I have to lower the input voltage to be safe. For the start, I simply divided voltage by 2, using resistor divider.

    To use the full scale, and still be safe, it would be better to divide by 1,5 (4,5 / 1.5 = 3V).

     

    So, is it a good idea to use 10K+20K resistors for this? Plus a small capacitor as a low-pass?

    Please login or register to see this attachment.

    Edited by Ondrej Bajer
    Link to comment
    Share on other sites

    • 0

    @Ondrej Bajer thank you for reporting back. I'll select some quotes and respond...

    27 minutes ago, Ondrej Bajer said:

    there's a lot of noise visible, but now it's okay for me. The chart shows a fluid level lowering, as I started pump to test the sensor.

     

    Nice chart! Yes, noise is your enemy ;-)

    Since we come to the same conclusions regarding the ADC on the Z-Uno (multiplexer issue, noise) - not all bad because, well, you have it for free :-) - I suggest you persue this approach, while I'll do something regarding averaging and the ADS1115.

     

    Why I keep going on about that chip... You can have a break-out board for a few $ and it does a few things very well! Best thing: it averages while it is sampling. No need to code that! It will automatically reject noise. It also has a 4 input multiplexer. Note your Z-Uno can only sample about once every 2 ms (actually once every 1 ms, 4 channels but that leveas no time for processing the result!). 

     

    31 minutes ago, Ondrej Bajer said:

    For me, slow reading is not an issue, but for other applications this might be a problem. Especially if one wants to collect more samples over a short period of time and then calculate an average to eliminate spikes.

     

    The ADS1115 might be not as slow as you think, it has these data rates: 8, 16, 32, 64, 128, 250, 475, 860. While it converts, it does not block your Z-Uno.

     

    33 minutes ago, Ondrej Bajer said:

    I found the same issue. Even if I pull-down A0-A2 with resistors, there's a leakage between inputs.

     

    Z-Wave.me answered they'll try to replicate the issue. I'll post the result.

     

    34 minutes ago, Ondrej Bajer said:

    Since Analog Input pins of Z-Uno are operating in range 0-3,3V, I have to lower the input voltage to be safe. For the start, I simply divided voltage by 2, using resistor divider.

    To use the full scale, and still be safe, it would be better to divide by 1,5 (4,5 / 1.5 = 3V).

     

    First you have to decide if you are going to use your voltage regulator as a reference (On a Z-Uno, that will be about 3.1 Volt, not 3.3 V, due to the voltage drop of D6) or the reference of the chip = 1.25 V. I think you get better results from the internal reference, once you know its value it should be pretty stable. So I'd use analogReference(INTERNAL);

     

    A resistor divider is OK. It should be low resistance (k ohm range) even when they fix the leakage problem.. You probably want your Z-Uno to withstand an accidental connection of an input to 24 V. You must not inject more than 10 mA into a pin so the upper resistor should be at least 2 k. I have to do more tests to optimize the input circuit, I think you want a pretty high RC constant to filter the input... 

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...