Two DS1820's same wire -> two on typical 52 slots one node

63 views
Skip to first unread message

MikeMc

unread,
Aug 20, 2015, 1:18:29 AM8/20/15
to souliss
Hi I have 2 DS1820's on one pin, and am trying to get them to work properly as 2 typical 52 nodes on a peer.  

One node works fine, displays on souliss app correctly.

When I try to add the second node, neither shows correctly on the app.  
The debug shows the sensors are being read correctly, just do not seem to update the typical correctly.

Loop: Sensor 1: 24.37 Loop: Sensor 2: 24.12

on the app, slot 1 shows OK status, but reading: 0C
slot 2 shows OK status, and Reading: NaN

I can comment out all code referencing slot 2 and slot 1 then works correctly.

Here are excerpts from my sketch  code that is applicable, would appreciate any assistance

Thanks,

Mike

-================================-
slots and defines etc:


// This identify the number of the logic slot
#define MYLEDLOGIC          0               
#define DALLAS1             1     
#define DALLAS2             2    

#include <OneWire.h>
#include <DallasTemperature.h>
#define DALLASPIN 2 
OneWire ourWire(DALLASPIN); 
DallasTemperature sensors(&ourWire); 

byte addr_sensor1[] = {0x28, 0xFF, 0xAC, 0xA3, 0x02, 0x15, 0x04, 0x46 };
byte addr_sensor2[] = {0x28, 0xFF, 0xC2, 0xA3, 0x01, 0x15, 0x02, 0xCC };

-================================-

setup():

    sensors.begin(); 

    Set_SimpleLight(MYLEDLOGIC);        
    Set_Temperature(DALLAS1);
    Set_Temperature(DALLAS2);


-================================-


loop()

        FAST_910ms()    {
          // read sensors
          sensors.requestTemperatures(); 

          {
          float dallas1 = sensors.getTempC(addr_sensor1);
  Serial.print("Loop: Sensor 1: ");
  Serial.print(dallas1); 
          Souliss_ImportAnalog(memory_map, DALLAS1, &dallas1);
          }

          {
          float dallas2 = sensors.getTempC(addr_sensor2);
  Serial.print("Loop: Sensor 2: ");
  Serial.println(dallas2); 
          Souliss_ImportAnalog(memory_map, DALLAS2, &dallas2);
          }


                FAST_2110ms()
        {
           Logic_Temperature(DALLAS1);
           Logic_Temperature(DALLAS2);
        }




Di Maio, Dario

unread,
Aug 20, 2015, 5:58:44 AM8/20/15
to sou...@googlegroups.com

Hi Mike,

the analog values use two slots, so the second should be at 3 and not at 2.

Regards,
Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/a5efce81-b42c-4b5f-bff1-6a6fa73537e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MikeMc

unread,
Aug 21, 2015, 2:36:44 PM8/21/15
to souliss
Thank you! That fixed it!

Regards,

Mike

Reply all
Reply to author
Forward
0 new messages