Go Down

Topic: Temperature logger (Read 531 times) previous topic - next topic

komika

Sep 29, 2014, 06:40 pm Last Edit: Sep 30, 2014, 07:23 pm by komika Reason: 1
Hi there,

i have an arduino with an ethernet shield and a temperature sensor (DS18B20). On the arduino is a Modbus TCP Server running. The Modbus Server is available over a dynamic dns domain. A Webserver is pulling the sensor data every 15 minutes and writes the values in a mysql database. My website is displaying the values:

http://allopensensors.com/sensor

Just an idea to publish data over Modbus TCP.

raschemmel

If I were you I would package it and market it as a product.  Of course I would love to see the schematic and code if you feel like posting that .  XD
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

komika

I will try to write a tutorial, because i'd like that people share there sensor data on my website.

The Schematic is a basic DS18B20 schematic with an Ethernet Shield on arduino.

The sketch is strongly based on the mudbus example:
Code: [Select]
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include "Mudbus.h"
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 3
Mudbus Mb;
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
//Function codes 1(read coils), 3(read registers), 5(write coil), 6(write register)
//signed int Mb.R[0 to 125] and bool Mb.C[0 to 128] MB_N_R MB_N_C
//Port 502 (defined in Mudbus.h) MB_PORT
EthernetServer server(80);
void setup()
sensors.begin();
Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");
{
  /* Temperatur
  */
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");
 
  Serial.print("Temperature for the device 1 (index 0) is: ");
  Serial.println(sensors.getTempCByIndex(0));
  /*
  */
  uint8_t mac[]     = { 0x9A, 0xAA, 0xDA, 0x00, 0x51, 0x06 };
  uint8_t ip[]      = { 192, 168, 2, 8 };
  uint8_t gateway[] = { 192, 168, 2, 1 };
  uint8_t subnet[]  = { 255, 255, 0, 0 };
  Ethernet.begin(mac, ip, gateway, subnet);
  //Avoid pins 4,10,11,12,13 when using ethernet shield

  delay(5000);
  Serial.begin(9600);
  server.begin();
  pinMode(7, INPUT);
  pinMode(8, OUTPUT);
}

void loop()
{
  Mb.Run();
 
  //Analog inputs 0-1023
  Mb.R[0] = sensors.getTempCByIndex(0)*10; 
  Mb.R[1] = analogRead(A1);
  Mb.R[2] = analogRead(A2);
  Mb.R[3] = analogRead(A3);
  Mb.R[4] = analogRead(A4);
  Mb.R[5] = analogRead(A5);

  //Analog outputs 0-255
  analogWrite(6, Mb.R[6]); //pin ~6 from Mb.R[6]

  //Digital inputs
  Mb.C[7] = digitalRead(7); //pin 7 to Mb.C[7]

  //Digital outputs
  digitalWrite(8, Mb.C[8]); //pin 8 from Mb.C[8]

}


raschemmel

I don't know much about Ethernet or webservers so do you mean you post the data on a website every 15 minutes and anyone can look at it or is it a Login controlled website to view the data ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

komika

For the moment it is only an idea. I'd like to collect sensor data (temperature, humidity,...) and show it on a website. Just like a weather map.

komika

updated the url: http://allopensensors.com/sensor

raschemmel

in case you haven't been paying attention there is an epidemic demand for remote temperature monitoring of plant growing operations disguised as "My grandma's vegetable garden" but it is obvious it is much more than that. The people who need them have money to burn so if you want to make some money you should concentrate on marketing a Login access webserver temp logger product and sell it with "n" sensors as a plug & play package. Grandma will thank you..... XD
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Go Up