-->
Page 1 of 2

OLED Display / Clock / Temperature

PostPosted: Sun Dec 27, 2015 9:42 pm
by heckler
Hey Group,

I knocked up this test circuit that uses an I2C OLED display and 3 ds18B20 temp sensors.
It shows the date/time and the Centigrade value of the three temp sensors.
The temperature updates every 5 seconds.
The time updates every 30 seconds.
By the way it is running off an old cell phone battery at 3.3 vdc

It continues to amaze me at the power of this ESP BASIC and the little ESP-01 module.

Take note that the display and the three temp sensors all share the same data/clock pin.

@Mike... feel free to post this as an example project if you like.

regards, Dwight

Image
Image

Code: Select allmemclear
cls
oledcls
counter = 0
timesetup(-7,0)
delay 1000

button "Temperature" [gettemp]
button "Exit " [Exit]
gosub [gettime]
timer 5000 [gettemp]
wait
'
[gettemp]
counter = counter + 1
if counter = 6 then gosub [gettime]
temp 0 curr
oledprint curr 0 0
temp 1 curr
oledprint curr 0 2
temp 2 curr
oledprint curr 0 4
'
oledprint ramfree() 0 6
oledprint flashfree() 0 7
'
wait
'
[gettime]
counter = 0
bla = time()
dw = mid(bla,1,3) 'dow
mh = mid(bla,5,3) 'month
dt = mid(bla,9,2) 'date
hh = mid(bla,12,2) 'hour
mm = mid(bla,15,2) 'min
ss = mid(bla,18,2) 'sec
yr = mid(bla,21,4) 'year
oledprint dw 8 0
oledprint mh 8 1
oledprint dt 12 1
oledprint yr 8 2
oledprint hh 8 4
oledprint ":" 10 4
oledprint mm 11 4
'
return

[Exit]
end


If you want to convert to Farenheit...
Code: Select alltemp 0 curr
tf = curr * 9
tf = tf / 5
tf = tf + 32
PRINT tf

Re: OLED Display / Clock / Temperature

PostPosted: Mon Dec 28, 2015 12:11 am
by Mmiscool
This is really nice. I like how you included a schematic.

Re: OLED Display / Clock / Temperature

PostPosted: Mon Dec 28, 2015 10:06 pm
by forlotto
Beautiful project well done!

Thanks a million for sharing I was wondering if this could be done with a screen after seeing the espbasic screen that was done by mmiscool.

Keep them coming great work!

Re: OLED Display / Clock / Temperature

PostPosted: Tue Dec 29, 2015 11:10 am
by heckler
It may not be obvious to newbies in the picture above that the ESP -01 module is actually plugged into an adapter to allow it to be inserted into the breadboard.
Image

Also if you were wondering how to get a photo or drawing inserted into your post... the way I do it is to place the image file into my DROPBOX "public" folder, then rightclick on the file and "copy public link" then paste it in your post between the
"[img.]https://dl.dropboxusercontent.com/u/18761838/adapter.jpg[/img.]" like that.

does anyone know of an easier/better way??

I also use a tool called "faststone capture" www.faststone.org
that works GREAT for grabbing/cutting screen shots, etc. and I have used for years.

Their photo viewer is also very nice



thanks
dwight