DS18B20 and Particle Photon

· Cyrano Protocol

Building a temperature reading particle photon.

DS18B20 and Particle Photon #

Wiring #

Components #

Details #

Phase 1 #

 1#include "DS18.h"
 2
 3
 4DS18 sensor(D2);
 5
 6int led2 = D7; // Instead of writing D7 over and over again, we'll write led2
 7double tempC = 0; // temperature in celcius from the ds18b20
 8
 9
10void setup() {
11  pinMode(led2, OUTPUT);
12  Particle.variable("tempC", tempC); // makes a r/w var queryable through UI
13}
14
15void loop() {
16  digitalWrite(led2, HIGH);
17
18  delay(2000);
19
20  digitalWrite(led2, LOW);
21
22  if (sensor.read()) {
23    tempC = sensor.celsius();
24    Particle.publish("temperature", String(tempC), PRIVATE);
25  } 
26  delay(2000);
27}
28

Phase 2 #

Working on ideas for storing some of the data

July 25, 2022 #

Todo #