Integrating ph and ORP sensors into Blynk

Hey Licht,

Just an update on some progress…

Got the pH sensor up and running with some stability on an UNO. Did not include temperature compensation which certainly needs to be done.

I now have a couple of ESP8266-12 development boards and have had some good luck. They seem every bit as stable as the UNO without the need for the separate W5100 ethernet. Have ported over to the Arduino IDE and running successfully. Now back to Blynk to see how to integrate the sensors.

How are you making out?

R

I ordered an ESP-12 but I fried it and waiting for new ones now, LOL.

The temperature sensor (Dallas one-wire) works perfectly though, so that is not an issue. Been really busy lately with work (a co-worker was just let go …) and some other projects. I think it shouldn’t be that hard. The major issue will be building the device I think. I was thinking of using a regular drainage pipe of about 8" wide, put some weight on the bottom, like you see in boats, and then stick the sensors through it and use siliconmastic to get it water tight.

Sorry to hear about the fried ESP! Never fun,

Would you mind sending me your sketch for the ESP8266 with the temp sensor? Might save me some time or at least give me an idea?

I agree with the pipe (probably white PVC) but thinking to get it down around 2 or 3".

R

It’s not too heavy, this is the Arduino code so you should be able to put it in ESP without any trouble:

#include <OneWire.h>
#include <DallasTemperature.h>
 
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
 
// Setup a oneWire instance to communicate with any OneWire devices 
// (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
 
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

void setup()
{
  Serial.begin(9600);
  sensors.begin();
}

void loop()
{
  sensors.requestTemperatures();
  float temp = sensors.getTempCByIndex(0);
  String str;

  str += temp;
  str.remove(4);
  str +="℃";
  Serial.println(str);

  delay(1000);
}

This should be about it. I used this sensor: http://www.dx.com/p/ds18b20-waterproof-digital-temperature-probe-black-silver-204290#.VgBUAbQkRE4 but if you get something with the same chip, it should be fine. It doesn’t need calibrating, which makes it quite useful. It does need a resistor like so:

PS. the colors on the dx.com thing are clear, but in case you just get the chip, “Onderkant” means “bottom” in Dutch.

1 Like

Thanks Licht,

The sketch I had been using was significantly more complicated. I’ll give yours a shot. Looks like additional sensors can be added in?

Actually found the same sensors as you. I think I paid about $10 USD for five of them from AliExpress.

R

Nice!

Because it’s onewire, you can use other sensors as well. There are even combined ones with humidity I think. The one from DX is waterproof, but I think you can buy just the chip. The beauty of the OneWire protocol is, as it says, there is only one wire. I think there are a couple other way to hook them up, but I found this the most convenient :slight_smile: