Pages: [1]   Go Down
Author Topic: arduino + 16x2 tinkerkit lcd dallas temperature sensor DS18S20  (Read 1479 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an UNO R3 and a Tinkerkit LCD which for this example I am using in serial mode. I am trying to have a dallas one wire temp sensor DS18S20 display just the temp in the upper left hand corner on the serial lcd. I used the DallasTemperature example called "simple" and i removed the lines: 

Code:
Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");
so that it only reports just the temp itself and not "requesting temperatures" and "DONE" and here is my code I am using:

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

// Data wire is plugged into port 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(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // Start up the library
  sensors.begin();
}

void loop(void)
{
  // call sensors.requestTemperatures() to issue a global temperature
  // request to all devices on the bus
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println(sensors.getTempCByIndex(0)); 
 
}

This seems to work OK it has garbled text in the beginning but then the screen has just the temp in the upper left corner like i want. The only problem i have so far is the temp updated real fast and there is a ghost number below on line 2. so the temp says 24.45 then below that pulsing fast is the same thing 24.45

so far ill call this a success compared to my other lcd attempts.

all the dallas examples work great when i hook up multiple sensors etc. using serial monitor now I would like to basically have the display say A24.55 B25.56 C34.56 then D, E, F temps below so i can have 6 temps displayed with a letter before it showing what sensor it is.

so if anyone can show me a better sketch or what to add to this one to fix it and not have any temp display on the second line at all that would be great, I already figured out to add a delay at the bottom of a second and the ghosting delays and only pulses once for a split nano second each second.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I added a delay at the end and now its more clear what is going on if you want to look at this sketch.

I am very new and i cant figure how to clear the screen. In my mind it would spit out the temp then immediately clear the screen before it gets a chance to jump down to the second line. I tried including the liquid crystal library and using the a clear screen command but it just gave me some orange errors at the bottom and i don't know where to insert it into the code to do it right anyway.

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

// Data wire is plugged into port 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(void)
{
  // start serial port
  Serial.begin(9600);

  // Start up the library
  sensors.begin();
}

void loop(void)
{
  // call sensors.requestTemperatures() to issue a global temperature
  // request to all devices on the bus
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println(sensors.getTempCByIndex(0)); 
  delay(1000);
 
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello I have been trying to get a simple lcd and arduino working for a while now. I finally bought a Tinkerkit LCD thinking it would be easier and there is little to no documentation or examples and it seems like one guy/kid running the show. The website and facebook haven't been updated in months unaswered questions. Something calling itself a forum but its more like little tiny chat clouds in an informal twitter type setting than an actual forum.

all the examples on the arduino playground for i2C or serial lcd is just plain outdated code and does not work at all. So finding arduino hard enough now i have this Tinkerkit LCD that has its own library to run etc and its just making things even harder on top of hard. Especially since the website is a joke and not very helpful. The examples are all over the place with no actual code on most of it just snippets of code and hes like put this in and put that in and you are like where adn when you finally find out where its like well you should have initialized this firs t and included this library at the top etc. etc. well OMFG dude put some code up then.

Its also missing any kind of datasheet. They say its a full fledged leonardo but there are no basic examples of how to do anything on it so its useless almost to me.

Is it just me or does it seem like the whole Tinkerkit thing is some rich nephew of the guy who owns arduino and he talked him into some side american enterprise and its all good in theory but they fell way way way way short on the support and website and documentation and keeping up on things after launch so the nephew is lazy. That is what it seems like to me.


anyone have any examples or real tutorials on how to use the Tinkerkit LCD besides the one very confusing example each of twi and serial on thier website both of which dont have a full code so i can run it.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post a link to this device, or some information about it? You must know more than you are letting on here.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i have a tinkerkit lcd and i am using the serial connection to talk to my arduino via Tx/Rx. When i load an example from the liquid crystal library it says to define the pins etc.

I am not hooking up my arduino directly to 7or 8 pins etc. on the display i am just using serial comunication so i am lost from the start on how to use the library.

should i just load an example and use whatever it says the pins are etc.

and this dang TinkerKit lCD it has no documentation its supposed to be a leonardo and it has a lcd with 16 pins soldered onto it. and it has sensor plugs on the back labeled A0 A1 A2 and D6 D5 D12. So I assume all the other pins on the leonardo are used being attatched to the lcd. well which ones where etc. and what pins are left I assume its digital pins 5,6,and 12.

anyway the tinkerkit has a library with even less documentation on how it works so using the actual leonardo inside it to control it would be nice but at this time with the crappy tinkerkit website and examples i t is probably 200-500% harder to figure out right now.

So would you believe all i am trying to do is put in a clear screen command OMFG that is all I want to do is report the dallas temp probe like it does then clear the screen and repeat and i am no closer after all this time than when i started Ready to just quit if something that simple has no documentation and is this hard i cant do it searching forums by myself at home.

So anyway how do i use this library when the arduino is using just the Tx wire to comunicate to the display instead of the tons of wires solution etc.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.tinkerkit.com/lcd/

Ironically the little example at the bottom of thsi page is basically exactly what i want to do except instead of using the thermosistor that is included with tinkerkit I want to use a simple dallas one wire sensor that i can get to work fine in all the examples for it on my R3 uno.

« Last Edit: September 10, 2013, 09:12:19 pm by ghost2501 » Logged

NSW Australia
Offline Offline
Faraday Member
**
Karma: 80
Posts: 3247
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

all the examples on the arduino playground for i2C or serial lcd is just plain outdated code and does not work at all.
No, that's not true at all.  No such code is "outdated", if it worked when it was written, it will be working still.  But it may not match what you have in hand.

So finding arduino hard enough now i have this Tinkerkit LCD that has its own library to run etc and its just making things even harder on top of hard. Especially since the website is ... not very helpful.
That may well be the case.  I took a look for you for your later post and concluded that it was a different implementation to anything with which I am familiar - so am not in a position to help.

The examples are all over the place with no actual code on most of it just snippets of code and hes like put this in and put that in and you are like where and when you finally find out where its like well you should have initialized this firs t and included this library at the top etc. etc.
Actually, that tends to be what this business is about - you start with known working examples, and "mix and match" pieces to do what you want.

Its also missing any kind of datasheet. They say its a full fledged leonardo but there are no basic examples of how to do anything on it so its useless almost to me.
I sympathise.

Is it just me
No, you are more-or-less right in general.  You do need a fair few smarts to work through this stuff.  Someone here may have been through it before.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i have a tinkerkit lcd ...

In order to get reliable responses you should post a link that will enable us to be certain that we are investigating the same device that you possess.

Quote
... and i am using the serial connection to talk to my arduino via Tx/Rx. When i load an example from the liquid crystal library it says to define the pins etc.

The LiquidCrystal library is designed to deal with a parallel display so you will need to use another library either instead of or in addition to the LiquidCrystal library.

Quote
... anyway the tinkerkit has a library ...

We need a link to that library in order to even attempt to answer your questions.


Don
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check your cross posts for other suggestions.

Don
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check your cross posts for some suggestions.

Don
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@OP: Could you please not start lots of posts about what is basically (or seems to be) one problem? It just fragments the responses and then we have to trawl back and forwards to see what other people suggested.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is a link to the tinkerkit library page. http://www.tinkerkit.com/tklcd-library/

As for the liquid crystal library only running on parallel displays as said above then i am even more confused because every example that tinkerkit gives uses the liquidcrystal library for things like clear the lcd etc. here is an example that works fine on the tinkerkit LCD.

Code:
/**
* Simple Hello World program. To be run on an Arduino connected
* to a TinkerKit LCD module via Serial.
*/

#include <Wire.h>
#include <LiquidCrystal.h>
#include <TKLCD.h>

//TKLCD_Serial lcd = TKLCD_Serial(); // when connecting to TKLCD over Serial
TKLCD_Local lcd = TKLCD_Local(); // when programming a TKLCD module itself


void setup() {
  lcd.begin();
  
  lcd.clear();
  
  lcd.print("Hello World!");
}

void loop() {
   // nothing do be done
}

so one way or another this display seems to use the library. More confusion. I am sorry but I just dont seem to have anywhere to start
« Last Edit: September 11, 2013, 08:57:04 am by ghost2501 » Logged

Pages: [1]   Go Up
Jump to: