Show Posts
Pages: [1] 2
1  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: March 04, 2014, 10:43:00 am
To convert the results to millimeters, just multiply the centimeter results by 10.
multiplying adds 0 at the end nothing more...
You want it to print mm instead of cm in the console?
If so change the abbreviations in the sketch:
Code:
Serial.println("cm");
to
Code:
Serial.println("mm");
And do as  john21403 says to mathematically  convert cm to mm.
that changes only printed text ..


but i need real measured values in mm not  cm
because cm result is rounded to full cm, but i need to see fraction
and i cant find where the rounding process is in code..
2  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: March 04, 2014, 04:32:45 am
no, i mean real mm ... 
multiplying adds 0 at the end..
3  Using Arduino / Sensors / Re: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.5 on: March 03, 2014, 06:18:15 pm
how can i change results to mm?
4  Using Arduino / Interfacing w/ Software on the Computer / Re: Labview DHT22 Digital sensor read on: February 04, 2014, 03:41:02 pm
working solution smiley
http://roboticlabview.blogspot.com.br/2014/01/arduino-dht11-labview-envio-de-email.html
5  Using Arduino / General Electronics / Re: Is this indeed a 10k thermistor? on: November 29, 2013, 04:41:20 am
but what is the simple way to give power to thermistor only that time when measuring ..?
6  Using Arduino / General Electronics / Re: Is this indeed a 10k thermistor? on: November 27, 2013, 04:51:30 pm
how to power 10k thermistor for preventing self heating?
if powering thermistor with arduino 5v all day , its geting warm.
 is it possible to power thermistor only  at measuring time? digital write?
7  Using Arduino / Installation & Troubleshooting / Re: arduino pro mini 3.3v cant upload on: November 21, 2013, 10:34:31 am
can i use UNO for programming 3.3v  mini?
and if a use CP2102 what i must choose  programmer type from ArduinoIDE ?
8  Using Arduino / Interfacing w/ Software on the Computer / Re: arduino sensor data to google via serial? on: November 13, 2013, 06:38:43 pm
now this code is working fine, it read serial port what arduino sends analogRead(1) and puts it google spreadsheet:)
my question is how to make more analogread cells to spreadsheet

Code:
import com.google.gdata.client.spreadsheet.*;
import com.google.gdata.data.*;
import com.google.gdata.data.spreadsheet.*;
import com.google.gdata.util.*;
import java.net.URL;
import processing.serial.*;
String uname = "xxx";  //Your google account user name
String pwd = "xxx";  //Your google account password
String spreadsheet_name = "sensorlog";  //Name of the spreadsheet you want to write data to.  Must match exactly, including case.
int spreadsheet_idx = 0; //Index for the "sensor log spreadsheet
Serial port;  // Create object from Serial class
int oldTime;  //timer variable
int reportingInterval = 2000;  //Number of miliiseconds between when sensor data is recorded
// Sends the data to the spreadsheet
void transmitData(float val) {
  String date = day() + "/" + month() + "/" + year();  //Build the current date
  String time = hour() + ":" + minute() + ":" + second(); //Build the current time
  try {
     //Create a new row with the name value pairs
     ListEntry newEntry = new ListEntry();   
     newEntry.getCustomElements().setValueLocal("date", date);
     newEntry.getCustomElements().setValueLocal("time", time);
     newEntry.getCustomElements().setValueLocal("reading", Float.toString(val));
     //Write it out to the google doc
     URL listFeedUrl = worksheet.getListFeedUrl();
     ListEntry insertedRow = service.insert(listFeedUrl, newEntry);
  } catch (Exception e) {
     println(e.getStackTrace());  }  }
void setup() {
  //Set up the serial port to read data
  //This code comes from example 11-8 of Getting Started with Processing
  String arduinoPort = Serial.list()[1];
  port = new Serial(this, arduinoPort, 9600);
  oldTime = millis();
  //Set up the google spreadsheet
  service = new SpreadsheetService("test");
  try {
     service.setUserCredentials(uname,  pwd);
     // Search for the spreadsheet named we're looking for
     // Note that according to the documentation you should be able to include the key in the URL, but I
     // was unable to get this to work.  It looked like there was a bug report in.
     // As a work around, this code pulls a list of all the Spreadheets in your acocunt and searches for the
     // one with the matching name.  When it finds it, it breaks out of the loop and the index is set
     URL feedURL = new URL("http://spreadsheets.google.com/feeds/spreadsheets/private/full/");   
     SpreadsheetFeed feed = service.getFeed(feedURL, SpreadsheetFeed.class);
     for (SpreadsheetEntry entry: feed.getEntries()) {
       if (entry.getTitle().getPlainText().equals(spreadsheet_name) ) {
         break;
       }
       spreadsheet_idx += 1;
     }   
     //Fetch the correct spreadsheet
     SpreadsheetEntry se = feed.getEntries().get(spreadsheet_idx); //Fetch the spreadsheet we want
     worksheet = se.getWorksheets().get(0);  //Fetch the first worksheet from that spreadsheet
     println("Found worksheet " + se.getTitle().getPlainText());
   } catch (Exception e) {
    println(e.toString());
  }
}
//Reads the port everye few seconds and sends the data back to Google
void draw() {
  float val = port.read();
  if (port.available() > 0) { // If data is available,
    val = port.read();        // read it and store it in val
  }
  //Determine if we need to report the level
  if ((millis() - oldTime) > reportingInterval) {
    oldTime = millis();
    transmitData(port.read());
      }   
 background(0); // Set background to black
  // Draw the letter to the center of the screen
  textSize(34);
    text(port.read(), 50, 50);
   delay(1000);}

how to add arduino example code serialcallresponse to my working code there are arrays..
Code:
int firstSensor = 0;    // first analog sensor
int secondSensor = 0;   // second analog sensor
int thirdSensor = 0;    // digital sensor
int inByte = 0;         // incoming serial byte

void setup()
{  // start serial port at 9600 bps:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  establishContact();  // send a byte to establish contact until receiver responds
}
void loop()
{  // if we get a valid byte, read analog ins:
      inByte = Serial.read();
    // read first analog input, divide by 4 to make the range 0-255:
    firstSensor = analogRead(0);
    // delay 10ms to let the ADC recover:
    delay(10);
    // read second analog input, divide by 4 to make the range 0-255:
    secondSensor = analogRead(1);
    // read  switch, map it to 0 or 255L
    thirdSensor = analogRead(2);
    // send sensor values:
    Serial.write(firstSensor);
    Serial.write(secondSensor);
    Serial.write(thirdSensor);             
  }
void establishContact() {
  while (Serial.available() <= 0) {
    Serial.print('A');   // send a capital A
    delay(300);  }}

9  Using Arduino / Interfacing w/ Software on the Computer / arduino sensor data to google via serial? on: November 07, 2013, 05:19:23 am
is it possible to read arduinos erial data with pc and post it to google spreadsheet without using arduino lan module..?
10  Using Arduino / Project Guidance / Re: Can arduino run multiple loops for 4 different things? on: November 06, 2013, 09:25:41 am
like this its working fine with 2different interval 2 leds are blinking smiley
long interval = 5234;           // interval at which to blink (milliseconds)
long interval2 = 1356;           // interval at which to blink (milliseconds)

in my case i use relays that drive an air blower  to work once a day ..

Code:
const int ledPin =  4;      // the number of the LED pin
const int ledPin2 =  3;      // the number of the LED pin
int ledState = LOW;             // ledState used to set the LED
int ledState2 = LOW;             // ledState used to set the LED
long previousMillis = 0;        // will store last time LED was updated
long previousMillis2 = 0;        // will store last time LED was updated
long interval = 5234;           // interval at which to blink (milliseconds)
long interval2 = 1356;           // interval at which to blink (milliseconds)
void setup() {
  // set the digital pin as output:
  pinMode(ledPin, OUTPUT); 
   pinMode(ledPin2, OUTPUT);    }
void loop(){
   unsigned long currentMillis = millis();
    unsigned long currentMillis2 = millis();
            if(currentMillis2 - previousMillis2 > interval2) {
       previousMillis2 = currentMillis2;   
         ledState2 = HIGH;
           digitalWrite(ledPin2, ledState2); 
  delay(500);
 ledState2 = LOW;
     digitalWrite(ledPin2, ledState2);
    if(currentMillis - previousMillis > interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   
    // if the LED is off turn it on and vice-versa:
       ledState = HIGH;
      // set the LED with the ledState of the variable:
    digitalWrite(ledPin, ledState);
 delay(500);
 ledState = LOW;
         digitalWrite(ledPin, ledState);  }}    }
11  Using Arduino / Project Guidance / Re: Can arduino run multiple loops for 4 different things? on: November 06, 2013, 07:07:26 am
how can i loop multiple events with blink wo delay example? if i want  2 different interval? can it work like this?


// set pin numbers:
const int ledPin =  4;      // the number of the LED pin
const int ledPin2 =  3;      // the number of the LED pin
// Variables will change:
int ledState = LOW;             // ledState used to set the LED
int ledState2 = LOW;             // ledState used to set the LED
long previousMillis = 0;        // will store last time LED was updated
// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long interval = 1000;           // interval at which to blink (milliseconds)
long interval2 = 3000;           // interval at which to blink (milliseconds)
void setup() {
  // set the digital pin as output:
  pinMode(ledPin, OUTPUT); 
   pinMode(ledPin2, OUTPUT);    }
void loop(){
  // here is where you'd put code that needs to be running all the time.
  // check to see if it's time to blink the LED; that is, if the
  // difference between the current time and last time you blinked
  // the LED is bigger than the interval at which you want to
  // blink the LED.
  unsigned long currentMillis = millis();
   if(currentMillis - previousMillis > interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   
    // if the LED is off turn it on and vice-versa:
    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;
    // set the LED with the ledState of the variable:
    digitalWrite(ledPin, ledState);  }





      if(currentMillis - previousMillis > interval2) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   
    // if the LED is off turn it on and vice-versa:
    if (ledState2 == LOW)
      ledState2 = HIGH;
    else
      ledState2 = LOW;
    // set the LED with the ledState of the variable:
    digitalWrite(ledPin2, ledState2);  }  }
12  Using Arduino / General Electronics / Re: Design of Analog Temperature sensor on: October 31, 2013, 11:58:56 am
but ds1820 network is very weak.. if one sensor gets wet or signal is interrupted then whole 1wire network gest messy..
 plan is to measure 30-40 temp points.. lots of wires and lots of things that can go bad, because composting process can be very acid and destroy wires and isolation..
i mean that when thermistor is broken it is not affect others in system..
13  Using Arduino / General Electronics / Re: Design of Analog Temperature sensor on: October 31, 2013, 06:53:02 am
i want to measure composting process its about 10-70 degree C.. i am thinking ... what sensors are the best solution fot that..
thermocouples, thermistors or ds1820...
14  Using Arduino / General Electronics / Re: Design of Analog Temperature sensor on: October 31, 2013, 05:48:53 am
can i power up thermistor with digital pin for preventing thermistor to all time powered and self heating?
15  Using Arduino / General Electronics / Re: Thermocouple calibration on: October 30, 2013, 12:10:53 pm
how  to calibrate MAX31855 ?

internal temp is ok but measured values are ...??
and why so different values?

Internal Temp = 23.62
C = -15.75
Internal Temp = 23.62
C = -16.75
Internal Temp = 23.69
C = -17.00
Internal Temp = 23.69
C = -15.75
Internal Temp = 23.62
C = -16.75
Internal Temp = 23.62
C = -16.00
Internal Temp = 23.62
C = -15.75
Internal Temp = 23.62
C = -15.75
Internal Temp = 23.62
C = -16.00

if i heat thermocouple with a lighter temp goes up...like normal... but when it cools down , values are.. dont know what ..

Internal Temp = 24.44
C = 48.25
Internal Temp = 24.50
C = 487.00
Internal Temp = 23.50
C = 721.25
Internal Temp = 24.25
C = 645.25
Internal Temp = 24.06
C = 758.25
Internal Temp = 24.37
C = 816.00
Internal Temp = 24.37
C = 281.50
Internal Temp = 23.37
C = 141.00
Internal Temp = 24.19
C = 87.75
Internal Temp = 24.50
C = 61.75
Internal Temp = 24.31
C = 47.25
Pages: [1] 2