14M Digital temp sensor 16x2 LCD?

DLP1

New Member
I really don't want to do this but I am extremely lost. First problem I have right now is my LCD is not displaying text right. I used hippies code and it worked for a while displaying "Hello world" then it just stopped. It now displays Hello and a couple of odd characters on the first line. I think one is the pie symbol. If I remove the code for the top line it will display World with no problems on the bottom line and same thing for the top line.

Now when it was working I was trying to figure out how to program it to display the temperature. After trying some of the sample code and messing around I got it to do either question marks and the cursor would blink or it would display dots. I know that the code was wrong.

I don't like looking for the easy way out but some times it's just better to move on (It's been about a month). So my question is what might be causing the text to display wrong? And how am I supposed to display the temp? Full code would be nice.:eek:

Also I have redone all connections and it worked again while starting out with the 10k pot low and slowly moving it up but that stopped too.
 

eclectic

Moderator
DLP.
Could you please post

1. The circuits (old and new).
2. The code that originally worked.
3. Your present code.
4. What is the power supply?

And, "better to move on". Just my individual opinion :- AXE033.

e
 

westaust55

Moderator
Please advise what LCD module you have. Is it Serial, parallel or i2c comms.

Which temperature sensor do you have? DS18B20 or something else like a thermistor? You make mention of a 10K pot – is that to test the analogue input in place of the temp sensor?.

Provide a copy of your program and others will have a chance to look for possible errors in your program.

We can help but do need more specific information to work with.

Edit:
Ah eclectic slipped in there with the same sort of request :)

Edit2:Are you still using parallel mode for the LCD as per thread:
http://www.picaxeforum.co.uk/showthread.php?p=67665#post67665
 
Last edited:

hippy

Technical Support
Staff member
It seems like you've gone back towards the original code to see if that still works which is a good idea and you've found a problem there. It could be that what you have isn't exactly as it should be, something lost or changed in going forward then going back. The best suggestion would be to post the code then we can have a look to see what's gone wrong.
 

DLP1

New Member
I am using the DS18B20 with a 4k7 resistor between pin 4 and 4.5v (3 AA batteries for my power supply).
This is the lcd I am using with a direct connection.

The first file 14M is what I am using for my connections and code. And the second is a copy and paste from the editor. It is also the current code I have been using.
 

Attachments

westaust55

Moderator
Bit of a long shot . . . but have you added an electrolytic capacitors to the power supply. Not the often sugegsted 100nF decoupling capacitors but say 22uF electro/tantalum types for power supply support
This can increase the time for the power supply to rise and disrupt the LCD display.

What happens if you press the reset button for the PICAXE after the system has started? Does it display correctly then?

You have no delay at the start of the program to give the LCD display time to initialise.

A couple of things to try:

1. Before the GOSUB InitialiseLCD, try adding:
Code:
PAUSE 1000
2. In the EEPROM statement, try moving the data $01 and $0C as:
Code:
EEPROM 2, ($28)
EEPROM 3, ($01)
EEPROM 4, ($0C)
EEPROM 5, ($06)
$01 is like LCD reset and then $0C turns the display on.
 

DLP1

New Member
I tried adding the code and got the same problem. But one thing I may have been doing wrong was leaving the download cable plugged in after programming. Now if I remove the power supply and reconnect it will display World! on the bottom line for a second then Hello on the top line and switch to blank boxes. I do not have any capacitors at the moment so I'll look around and see if I can find any.
 

westaust55

Moderator
I tried adding the code and got the same problem. But one thing I may have been doing wrong was leaving the download cable plugged in after programming. Now if I remove the power supply and reconnect it will display World! on the bottom line for a second then Hello on the top line and switch to blank boxes. I do not have any capacitors at the moment so I'll look around and see if I can find any.
Having the programming cable connected should not cause problems. I frequently have mine left connected, unless I go into walk-around mode.

There is no specific need to add any electro/tantalum type capacitors.
My thought was that if you did already have some, it may slow the rise time of the supply voltage so the LCD does not automatically get to initialise properly.


Now if I remove the power supply and reconnect it will display World! on the bottom line for a second then Hello on the top line and switch to blank boxes.
does suggest the LCD is not initialise properly at the start.

While it seems to be the LCD that needs to be properly initialised, do you have a reset button for the picaxe to try pressing so the LCD get initialised again through the program after the power supply has stabilised (after switch on)

Another thought - total guess here but have a look at the calibfreq command. not used myself but others have found it can help get their comms working correctly for LCD's.
Sugegst you do a search for this command on this forum first to understand better what others have done.
 
Last edited:

hippy

Technical Support
Staff member
The code you have looks okay, both versions are the same except for the comments at the top of the first not being in the second. WIth the behaviour described it doesn't feel like a wiring fault to me.

My money would be on power supply being too low. Use some new batteries or preferably a 7805 regulated supply. Some LCD's can be very picky about their operating voltage. With the backlight that could be draining batteries quicker than you think, the DS18B20 can also draw a reasonable current when operating.
 

manuka

Senior Member
I'll go with the LCD supply too. Many annoyingly insist on 5-5½V & just will not behave properly on weary AAs, even though most PICAXEs are tolerant down to ~3V. THOUGHT:How about you try that LCD simulator program of Matt's that was posted here a week or so back? It looked very user friendly indeed! Link to it via => http://www.picaxeforum.co.uk/showthread.php?t=9883 Stan
 

moxhamj

New Member
I think westaust55 et al are right with the power supply issue. I had an LCD display do similar strange things the other day - after working fine for a week. What had changed? I had added a some more circuitry and so the plugpack had a higher current drain, so the startup times were different. The answer for me was to increase some of the startup delay variables. It could be working fine because the batteries were in good condition, then as they go flat the internal resistance changes and they droop a bit at startup. Then the delays which worked fine in the beginning are not long enough. Also the delays in the published code may have been set for regulated supplies, not for battery supplies.

So maybe tweak the delays, add some extra ones (especially between startup instructions) and maybe think about a regulated 5V supply.
 

westaust55

Moderator
LCD display operation

If the displayed characters also seem dull, then I concur that low voltage is the most likely issue.

If the displayed characters are clear and dark in colour, then IMHO the cause is potentially related to the LCD module not initialising fast enough and dropping characters.

It is a little puzzling when you say:
Now if I remove the power supply and reconnect, it will display World! on the bottom line for a second then Hello on the top line and switch to blank boxes.
The program is a single pass with the word “Hello” on the first line and “World!” on the second line. Then it’s the END of the program!

Once the program has reached sending “World” to the second line, cannot see how it will go back and display “Hello” on the first line later. Are you doing a reset between these text displays?

And then switches to blank boxes? Are these solid blocks/boxes for characters or an empty outline? Either way, if you can [B}clearly[/B] see the characters, seems like bad comms or invalid data, rather than a low voltage problem.
 
Top