• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Just a clock...

Status
Not open for further replies.

granddad

Well-Known Member
I saw these at the 'Grand designs' exhibition in NEC ( UK) , and quizzed the guy about the plastic , seems for LED to shine through it has to be thin and polarised ? Looked like a interesting project, I have made lots of clocks, but not one you could say was cute ! thinking "Real Wood" , possibly seen something on ETO before. ?slide_5.jpg
 

DerStrom8

Super Moderator
Most Helpful Member
Funny you should bring this up now, I just watched this video a few days ago:

 

ericgibbs

Well-Known Member
Most Helpful Member
hi Gran,
This is one option for a wooden clock, no batteries required.!;)

How's the green house tech coming along.?

E
 

Attachments

granddad

Well-Known Member
Eric , I like building clocks ! I have 8x8 bi dot matrix and SS leds waiting for some solder . also a couple of max7 ??? drivers. thinking PIC24xxx , clock, alarm, temperature , all with IR control .... used a DS1338 module last time on the Greenhouse environment controller / monitor ,< this is progressing have remote end in garden GH, still in prototype mode. will up-date the thread,

DerStrom8 thanks for link, will take a look . Making a pleasing case will be the challenge. probably wont shine led through .....
rtc-ds1338-250x250.jpg
 
Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member
used a DS1338 module last time on the Greenhouse environment controller / monitor
Have a look at the DS3231, far more accurate than the other types - as it uses an internal crystal and temperature compensation as well.

Thanks to your help I've got mine working nicely now on my PIC24 :D I'm also using the sqw output to trigger an external interrupt every second to initiate reading the clock (and to run a seconds counter, to trigger various events).
 

ericgibbs

Well-Known Member
Most Helpful Member
hi G,
I agree with Nigel, the DS3231 is far superior to the DS1338, it also has a inbuilt thermometer.

E
 

Attachments

dr pepper

Well-Known Member
Most Helpful Member
Hi gramps,
I too build clocks, wacky ones.
Some recent ones of mine are built into aircraft instruments from the 50s & 60s.
The ds3231 features in some of mine too, I couldnt get the temp to work with the pic using asm, its something in my code as a 'duino works perfectly.
Me & Nige have been discussing on another thread tuner cans and fm receivers, I have been playing with these on another project, however this has given my an idea for a future project, a clock synchronised via broadcast Fm rds, I've already made clocks using Msf, Dcf, the internet & radio france on Lw.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
I couldnt get the temp to work with the pic using asm
I've no problems reading the temperature registers in C with a PIC24, just a question of reading the correct addresses.

Positive temperatures are OK, but I'm a bit confused over the negative ones - the datasheet isn't terribly helpful, and there's conflicting examples if you google - it's also difficult to test, as the DS3231 only measures every 64 seconds, making freezer spray testing difficult :D
 

granddad

Well-Known Member
OK where would you physically fit the DS3231 , inside the case ... really needs to be exposed to room temperature ?
I have used mcp9808 previously.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi G,
In order to check out the DS3231 I have extended my DS connections to the 18F4520 by 18 inches using a 4 core screened cable, it works fine.
I know that the DS has in built 10k pull ups, but I always add 2k2's as pull ups, at the DS end of the cable.

The next test I am trying to complete is a negative temperature trial, I have a polystyrene box which I use for temperature testing .
Using frozen food packs inside the box to pull the temp below zero!!!.

Will let you know what I find.

Eric
 

granddad

Well-Known Member
What you may have missed was the coin cell on the back of the ds bob in my photo, I have some mcp9808 ssop and a bob, not sure of pic at moment..

Now where is my magnifying glass !
 

ericgibbs

Well-Known Member
Most Helpful Member
hi,
On a COLD test it updates faily well down to ZERO, it then shows a decrementing low value.
This is my program as I did not expect my house interior to get to zero.!
I will modify my program and rerun the COLD test later today.
E
This image is a log from TeraTerm, ignore the values other than Temp and Temp.
 

Attachments

Nigel Goodwin

Super Moderator
Most Helpful Member
Hi Ian,

As your log doesn't go negative when the temperature does, presumably you're not checking bit 7 of the upper byte, where a one signifies a negative temperature.

Also, what happened to the last fractional digit?, and how did you get .9 at the end, when the only possible fractional values are 0.00, 0.25, 0.50 and 0.75?

My problem with negative numbers is the twos complement situation, some sites say you need to do it, and some say you don't.

I like your idea with the frozen food packs - although my current setup wouldn't make it very easy for me to do it - I'll have to arrange a different payout and try it some time.

As for serial terminal programs, I've found and started using Termite 3.2 - which is nice and small, requires no installation, and is very easy to use :D
 

ericgibbs

Well-Known Member
Most Helpful Member
hi Nigel,
Its me Eric, not Ian...:rolleyes:

I have modified the program to give negative temperature values from the DS3231, I will program a PIC and recheck it. [post what I get]

Ref the fractional part, I used rounding, you can see it changes in steps of 0.2 or 0.3 , which is accurate enough for me.

Frozen sprouts give the best results.:nailbiting:

E
 

ericgibbs

Well-Known Member
Most Helpful Member
hi Nigel,
Below is a clip from my Oshonsoft Basic program for the DS3231

I had to use a bigger poly box and 3 frozen packs of milk to get the temperature down -11.75 degrees Centigrade
Temperature is the 2nd column from the Right of the text listing.

The temperature was checked against a glass thermometer and a Tenma electronic thermometer.
Attached is the data Log from the PC, also a clip showing the +C to -C transition.

Eric

Ensure that the DS3231 has the SN suffix

;prog fragment

Dim sgn As String
Dim templ As Byte
Dim temph As Byte
Dim tempr As Word
Dim binval As Word

Gosub read_ds3231

tempr.HB = temph
tempr.LB = templ

If tempr.15 = 0 Then
sgn = "+"
tempr = ShiftRight(tempr, 6)
tempr = (tempr * 100) / 4
Else
sgn = "-"
tempr = ShiftRight(tempr, 6)
tempr = 0x3ff - tempr
tempr = tempr + 1
tempr = tempr And 0xffff
tempr = (tempr * 100) / 4
Endif

binval = tempr
Gosub bin2asc ' convert to ASCII

sdstr = sdstr + sgn + Chr(val(3)) + Chr(val(2)) + "." + Chr(val(1)) + Chr(val(0)) + ","

----------------------------------------------------------------------------------------------------------------------------------

read_ds3231:
I2CStart
I2CSend 0xd0 'DS3231 slave addr wr
WaitUs 10
I2CSend 0x00 'first word addr wr
I2CStop

WaitUs 10
I2CStart
I2CRead sda, scl, 0xd1, 0, secs
I2CRead sda, scl, 0xd1, 1, mins
I2CRead sda, scl, 0xd1, 2, hrs
I2CRead sda, scl, 0xd1, 3, day
I2CRead sda, scl, 0xd1, 4, date
I2CRead sda, scl, 0xd1, 5, mnth
I2CRead sda, scl, 0xd1, 6, year

I2CRead sda, scl, 0xd1, 0x11, temph 'temperature
I2CRead sda, scl, 0xd1, 0x12, templ
I2CStop
Return


BTW:
I know the program can be optimised.
 

Attachments

Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member
Thanks for that Eric, the temperature list looks pretty good.

I see you're combining the high and low bytes to a 16 bit word, and then processing it - I was assuming the fractional part didn't change when the reading went negative.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi Granddad,
For information about locating the Green house DS3231 module, I have extended the 18inch
test cable from the PIC to the DS3231 to 1mtr, no problems at all.
It is a 6 core screened cable, with the 2k2 PU's near the PIC.

So you can mount the DS to suit your layout.
Eric
GGGranddad...:woot:

Update: 26th Oct

Extended the 6 core screened cable connecting the PIC to a remote DS3231 to just over 2 mtrs, no problems.
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top