Forum Members section DIY Ferduino controller Temperature sensor Question

Temperature sensor Question  [SOLVED]

Ask here about your controller made with pieces purchased in other shops.

Post Number:#1 Post Mon Sep 29, 2014 6:21 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 38
Gender: None specified
National Flag:
Brazil
Good night people!
In my project I have to use 2 separate heatsinks, one for each LED LUMIA 5.1 and the ferduino project boasts only three sensors (water, environment, heatsink), in my case I will need more sensor to another heatsink, totaling four sensors (water, environment, heatsink1, heatsink2).

Is there any solution without having to change the code by adding another variable to the new sensor?

Sorry my bad english, some times i need google translator kkkk

hugs

Ps.: Obrigado pelas ajudas Fernando!

Post Number:#2 Post Tue Sep 30, 2014 1:28 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi Marcos!

I'll not change Ferduino for you but, will give a simple example for you learn how it works.

#include <OneWire.h>
#include <DallasTemperature.h>

const byte sensoresPin = 49;  // Sensor connected to pin 49

float tempH2;

unsigned long previousMillis = 0;

OneWire oneWire(sensoresPin);
DallasTemperature sensors(&oneWire);

DeviceAddress sensor_heatsink2 = {0x28, 0x9C, 0xA9, 0xAA, 0x03, 0x00, 0x00, 0x44}; // Find the address using the example "tester" available in DallasTemperature.

void setup ()
{
  Serial.begin(38400);
  Serial.println("I'm alive!");
  Serial.println();
  sensors.begin();
  sensors.setResolution(sensor_heatsink2, 12);
}

void check_temperature()
{
  sensors.requestTemperatures();
  tempH2 = (sensors.getTempC(sensor_heatsink2));  // Get temperature

  Serial.print("Heatsink 2 temperature: ");
  Serial.print(tempH2);
  Serial.println(" C");
}

void loop ()
{
  if (millis() - previousMillis > 5000) // Check function to each 5 seconds
  {
    check_temperature();
    previousMillis = millis();
  }
}


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Tue Sep 30, 2014 3:13 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 38
Gender: None specified
National Flag:
Brazil
Thanks Fernando,


You can specify any program to emulate the code without upload the code to arduino?

best regards.

Post Number:#4 Post Tue Sep 30, 2014 5:56 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

For Ferduino not.

To codes more simple have the Proteus.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Wed Oct 01, 2014 1:55 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 38
Gender: None specified
National Flag:
Brazil
Thx Fernando!




Return to DIY Ferduino controller





Who is online

Users viewing this topic: No registered users and 1 guest