Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conect onewire sensor #50

Open
maverik23 opened this issue Jun 1, 2014 · 2 comments
Open

conect onewire sensor #50

maverik23 opened this issue Jun 1, 2014 · 2 comments

Comments

@maverik23
Copy link

anyone know how to connect a DS1820 sensor OneWire to receive temperature data?

@rixon
Copy link

rixon commented Jun 1, 2014

Yeah, there's lots of documentation on this. Check out these:

These show using an interface board. You don't need an interface, though. On my Duemilanove, I run four OneWire sensors off a single port (2). I'm running three wires so I can run reliably on a 10 foot long bus, and the pull-up to the data line. You can run without the power wire, and use a common frame as a ground to get true one wire operation.

@maverik23
Copy link
Author

I have already connected the sensor to another arduino sketch.
right now I'm using duino with heimcontrol.js. where I have to modify the sketch to receive data from this sensor.

I have connected the sensor to pin 11.
and I modified the code but does not work

/*

  • Digital read
    */
    void dr(char *pin, char *val) {
    if (debug) Serial.println("dr");
    int p = getPin(pin);
    if(p == -1) { if(debug) Serial.println("badpin"); return; }
    int oraw = 0;
    if(pin==11)
    {
    int oraw = sensors.getTempCByIndex(0);
    }
    else
    {
    pinMode(p, INPUT);
    int oraw = digitalRead(p);
    }
    char m[7];
    sprintf(m, "%02d::%02d", p,oraw);
    Serial.println(m);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants