Announcement

Collapse
No announcement yet.

DS18B20 and uLCD43-PT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    They think it is purely in the code. The replies I got are as follows

    The problem must be in your Arduino code then. You are really reducing your output range with a 10K ohm resistor.
    and
    I think you have other problems besides the non linearity of the voltage divider.

    Brian

    Comment


    • rcbandwidth
      rcbandwidth commented
      Editing a comment
      All things considered the board seems to be your best choice IMHO....

  • #17
    Running this sketch, voltage_serial_monitor_read I am reading 1.42 volts via serial monitor with no input on the eTape. When I touch the eTape at the 8" mark, the voltage increases to 3.04. That is with a 560k ohm resistor in series and connected as in the picture. If I run the other sketch, liquid level sensor example and open the serial monitor, I read Analog Reading 289.00 and Sensor Resistance 220.49 without any input on the eTape. If I touch the eTape at 8" I read Analog Reading 622.00 and Sensor Resistance 868.63. I am not sure if that tells you anything or not!

    Brian
    Attached Files

    Comment


    • #18
      Brian:Lets simplify this, just give me the raw A/D count using the following line.........int sensorValue = analogRead(A0);
      Take a reading at 8 inch, 4 inch, and 1 inch....and a final reading with nothing touched.
      Are you sure that touching the display at a certain level is the same as being submerged in water?.....I have my doubts.

      Comment


      • #19
        Bob,

        I apologize for being such an amateur. I have no idea how you want me to use that line of code. It appears in the sketch that I uploaded, voltage_serial_monitor_read but I have no clue what to do with the two lines that are after it. If I comment them out, I will have no command to print and if I leave it in, it will print voltage. Sorry for being no help.I will be sure to stick the damn thing in some water though.

        Brian

        Comment


        • #20
          I came up with this?

          /*
          ReadAnalogVoltage
          Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.
          Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

          This example code is in the public domain.
          */

          // the setup routine runs once when you press reset:
          void setup() {
          // initialize serial communication at 9600 bits per second:
          Serial.begin(9600);
          }

          // the loop routine runs over and over again forever:
          void loop() {
          // read the input on analog pin 0:
          int sensorValue = analogRead(A0);
          // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
          float voltage = sensorValue ;
          // print out the value you read:
          Serial.println(voltage);
          }

          I modified it from the earlier sketch that I posted and took out the conversion which I believe will give you the raw data you are looking for? No clue, but Im trying!

          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            Here, this is all you need: I put in a delay to make the readings easier to see in the Serial monitor.
            I will give you more info after you post the readings.

            // the loop routine runs over and over again forever:
            void loop() {

            Delay(1000);
            // read the input on analog pin 0:
            int sensorValue = analogRead(A0);

            // Display the analog reading (which goes from 0 - 1023)

            // print out the value you read:
            Serial.println(sensorValue );
            }

        • #21
          Bob,
          I could not get this to compile?


          This report would have more information with
          "Show verbose output during compilation"
          enabled in File > Preferences.
          Arduino: 1.0.6 (Windows 7), Board: "Arduino Mega 2560 or Mega ADK"
          sketch_feb23a.ino: In function 'void loop()':
          sketch_feb23a:5: error: 'Delay' was not declared in this scope

          Removed the delay and got


          This report would have more information with
          "Show verbose output during compilation"
          enabled in File > Preferences.
          Arduino: 1.0.6 (Windows 7), Board: "Arduino Mega 2560 or Mega ADK"
          core.a(main.cpp.o): In function `main':
          C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:34: undefined reference to `setup'


          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            I just gave you the code for the loop you still need your Setup code......No capital for delay

        • #22
          LMAO sorry I have been screwing around with this for the past 12 hours. I am losing my mind!

          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            How much of that whiskey is left?......LOL

        • #23
          Well, here are the results
          I used water and the eTape is suspended in the water (water all around it and I am not touching it)
          1" 496
          2" 447
          3" 397
          4" 379
          5" 404
          6" 446
          7" 481
          8" 517

          That seems weird to me that it starts out at 496 and then falls to 379 then climbs back up to 517.
          I attached the sketch, just in case you want to look at it.

          Brian
          Attached Files

          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            What value Ref resistor are you using?....you might want to wire in an adjustable potentiometer and set the pot until you get a reading of about 1,000
            This reading should be taken with 8 inches of water,this is your full scale value .

        • #24
          update on those readings.I found two problems with my method
          One, the device was touching the container bottom and I had tape covering the vent hole. This did make a difference.
          1" 306
          2" 330
          3" 346
          4" 372
          5" 397
          6" 435
          7" 481
          7" 550

          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            what is the 0 level (no water)

        • #25
          with the pot installed and adjusted to get as close to 1000 as I could
          8" 987
          7" 973
          6" 956
          5" 946
          4" 937
          3" 927
          2" 921
          1" 910
          0" 904
          Last edited by mpo881; 24th February 2015, 09:12 AM. Reason: fixed the value for 6"

          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            that does not look right you had better results with your fixed resistor....what fixed value were you using?....

        • #26
          It was a 560 ohm resistor

          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            the datasheet for the 8 inch model shows a ref resistor value of 1500 ohms +/- 20%....adjust your pot for a value of 1000 ohms and retest the range.
            You may have to retest with different values to obtain a more expanded range if you get what I mean.

        • #27
          Well, I did some putzing and the best range seems to be with the 560 ohm resistor
          0" 297
          1" 308
          2" 330
          3" 352
          4" 381
          5" 410
          6" 456
          7" 503
          8" 582

          Comment


          • rcbandwidth
            rcbandwidth commented
            Editing a comment
            Ok,I am going to be away till tomorrow afternoon....

            Bob

        • #28
          Sounds good. Have a good night and Thank you

          Comment


          • #29
            hello, can anyone help me please? I have a problem with display temperature on led digits number0. i use DS18B20 and arduino uno. Here is my arduino project. PLEASE HELP. Thank you so much.
            Attached Files

            Comment


            • #30
              Hi huy373,

              What seems to be the problem your experiencing?
              Make sure your LedDigits cover the range of the temp you write to it.

              I have tried this code into a simple genie project(attached here also) that only has 1 LedDigits widget and it seems to work. Can you also try this one? **you may have to change target display if you want to try the genie project.

              Code:
              //Include thư viện
              #include <genieArduino.h>
               //Include thư viện
              #include <genieArduino.h>
              //#include <OneWire.h>
              //#include <DallasTemperature.h>
              
              // Chân nối với Arduino
              //#define ONE_WIRE_BUS 3
              //Thiết đặt thư viện onewire
              //OneWire oneWire(ONE_WIRE_BUS);
              //Mình dùng thư viện DallasTemperature để đọc cho nhanh
              //DallasTemperature sensors(&oneWire);
              Genie genie;
              int tempC;
              void setup(void)
              {
                Serial.begin(9600);
                genie.Begin(Serial);
                //sensors.begin();
                pinMode(4, OUTPUT);   // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
                digitalWrite(4, 1);   // Reset the Display via D4
                delay(100);
                digitalWrite(4, 0);   // unReset the Display via D4
              
                delay (3500);         //let the display start up
              }
              
              void loop()
              { 
              
               // sensors.requestTemperatures();  
               // tempC = sensors.getTempCByIndex(0);
                genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x00, tempC);
                delay(1000);
                tempC++;  // for trial
              
                //Serial.print("Nhiet do");
                //Serial.println(sensors.getTempCByIndex(0)); // vì 1 ic nên dùng 0
              
                //chờ 1 s rồi đọc để bạn kiệp thấy sự thay đổi
                //delay(1000);
              }
              Hope this helps,
              Attached Files

              Comment

              Working...
              X