Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 [2] 3 4 ... 6

Author Topic: New project, A Clock  (Read 6347 times)

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: New project, A Clock
« Reply #15 on: November 18, 2020, 11:47:11 PM »

I don’t speak hardware, so I am full of awe.
Logged

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: New project, A Clock
« Reply #16 on: November 20, 2020, 08:13:48 AM »

A small preliminary experiment has yielded encouraging results.

Yesterday I rigged up a test device with existing hardware that has a PIC and photosensor, similar to the configuration I plan to use for the clock.  I set a fairly arbitrary trigger threshold, at the low end of the scale, but comfortably above the diode’s noise floor.  It was aimed out of a window that looks towards a wall and some trees, simply because that window was convenient.

Jelv’s excellent link to the Time & Date site gave me the predicted local sunrise/sunset times, so about 10 mins before official sunset I started watching.... the sensor triggered just about 45 seconds after “official” sunset.    This morning it triggered a little early for sunrise, but only by about 5 minutes.   

Considering there was no day to day averaging process, no calibration, and it wasn’t even pointing skywards, I’m pretty happy with that - maybe my clock could be accurate to within a couple of minutes. Possibly fluke results, but far exceeding my initial hopes for such a crude experiment.   :)
Logged

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: New project, A Clock
« Reply #17 on: November 21, 2020, 10:21:02 PM »

Thankfully someone has done all the maths for us: https://en.wikipedia.org/wiki/Sunrise_equation

It’s just dawned on me that whilst I engaged Weaver in debate of PIC vs more advanced hardware I never actually thanked him for his input so far, including that link.   Great stuff, maybe my existing long division assembly code won’t go to waste after all!

I am very nearly at a point where I have functional prototype hardware, ready to start SW development in earnest.  It all depends whether the stuff I’ve done today works first time when a voltage is applied tomorrow, or vanishes with a flash and a bang in a cloud of smoke, or somewhere in between. :D

Weaver also offered assistance with the maths.

I and others could try and help with the maths, although 40 years is a long time.

A resounding ‘Yes please’, if I get as far as actually deploying any maths.    Whilst  I may have once qualified in electronics, and spent my career writing software, I have never remotely considered myself to be a mathematician.  All input will be appreciated.   :)

Photographic evidence of fully featured prototype with (initially spoofed) time display could be available very soon now, if anybody remains interested.   :)
Logged

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: New project, A Clock
« Reply #18 on: November 21, 2020, 10:34:20 PM »

Photographic evidence of fully featured prototype with (initially spoofed) time display could be available very soon now, if anybody remains interested.   :)

Cats and kittehs are always interested.  :angel:
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: New project, A Clock
« Reply #19 on: November 22, 2020, 06:26:46 PM »

Cats and kittehs are always interested.  :angel:

The display is spoofed so not really proof of anything other than perhaps, proof of my misguided dedication to the cause.  But progress so far, development hardware...

The thing aimed skyward at the back, that looks like an LED, is in fact an LED.  I will use it as a photodiode, but reserve the right to think of a reason it might want to light up.   The four buttons have not got any specific purpose assigned but they seemed like a good idea.  I have included a piezo sounder in the design but haven't yet got one. 

Essentially I am thinking a device that has an LCD character display, four buttons, an LED, and has the ability to go 'beep', is bound to find a purpose.  Even if it fails to improve upon GPS for navigational purposes.

Tomorrow, work starts in earnest on the software.  :)
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: New project, A Clock
« Reply #20 on: November 22, 2020, 06:35:35 PM »

I’ve never seen PIC assembly language. I started out doing Z80 code, then Hitachi 6301, a small amount of MC68000 and VAX MACRO asm, then a good bit of 8086, and then switched to C for the next decade. Nowadays I write D, x86-64 asm, BASH occasionally and am dipping my toe into AWK and a lot of complex iOS Shortcuts programs for my iPad. I want to learn some ARM AAarch64 asm soon.
Logged

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: New project, A Clock
« Reply #21 on: November 22, 2020, 07:53:20 PM »


I’ve never seen PIC assembly language. I started out doing Z80 code, then Hitachi 6301, a small amount of MC68000 and VAX MACRO asm, then a good bit of 8086, and then switched to C for the next decade. Nowadays I write D, x86-64 asm, BASH occasionally and am dipping my toe into AWK and a lot of complex iOS Shortcuts programs for my iPad. I want to learn some ARM AAarch64 asm soon.

Fear not, when I referred to help with maths I was thinking more in terms of the underlying algorithms and equations, rather than with PIC assembly implementations.

PIC is an acquired taste. If interested, this is the device in my breadboarded prototype, the data sheet includes the instruction set, and bits of example assembly here and there.    It’s quite old really, there are undoubtably newer options, but I know my way around that device family and it has all the peripherals I need for this project.

http://ww1.microchip.com/downloads/en/DeviceDoc/40001729C.pdf
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: New project, A Clock
« Reply #22 on: November 23, 2020, 01:31:34 AM »

No, we understand one another, I just meant maths equals maths, although I am extremely rusty. Many thanks for that link, just what I wanted.
Logged

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: New project, A Clock
« Reply #23 on: November 24, 2020, 11:26:06 PM »

I have just noticed, RS are now selling my chosen PIC16LF1709, for around 30p each, even for low volumes.  Wow, for a device with Op Amps, ADC, DAC, PWMs and much more.  That’s another reason I like PICs.   ???

Meanwhile, progress continues.  Nothing much to demonstrate but I have accurate timer code (+/-10ppm)  working, based on a 32.768kHz watch crystal.    :)

@Weaver (+others?), I feel I should warn in advance...  If I get as far as building a real device, I might as well build a dozen or so, that’s how parts pricing works these days.   So, I might be on the scrounge for folks at the other extremities of the country, to try it out for me, and report back.

Feel free to start thinking of reasons to decline, but your payment would be retained ownership of a gadget that you probably do not already own. :D
Logged

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: New project, A Clock
« Reply #24 on: November 25, 2020, 12:16:54 AM »

So, I might be on the scrounge for folks at the other extremities of the country, to try it out for me, and report back.

You know where you are located in the UK but, when considered from the viewpoint of other members, your location is an unknown. Hence it is somewhat difficult for members to decide whether to volunteer . . .
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: New project, A Clock
« Reply #25 on: November 25, 2020, 12:57:12 AM »

@7LM Count me in, provided Mrs Weaver approves, haven’t asked her yet because she’s asleep. It might not work properly here because of the mountains, particularly Beinn nan Càrn which is adjacent to the house (we are on the slope of it) to the west, which cuts off an hour or so of daylight in the evening, and the amount depends on the time of year; as the sun goes further south in Winter the time loss due to the mountain’s profile reduces, and in June the amount of loss is a maximum approximately.
Logged

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: New project, A Clock
« Reply #26 on: November 25, 2020, 12:58:06 AM »

You know where you are located in the UK but, when considered from the viewpoint of other members, your location is an unknown. Hence it is somewhat difficult for members to decide whether to volunteer . . .

South.  But with a Scottish accent. 

Latitude expressed as a precision towards the upper end of my expectations of accuracy for the device
Note that I don’t, as a rule, respond to PMs.   If anybody would like to volunteer, best to do so in thread.

Note also that this is hypothetical, I may never succeed in producing a device suitable for widespread deployment. :'(




Admin - latitude figures removed at request of OP
« Last Edit: February 02, 2021, 07:10:32 PM by kitz »
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: New project, A Clock
« Reply #27 on: November 25, 2020, 01:19:21 AM »

I am at latitude/longitude: 57.2239, -5.8295 according to https://www.doogal.co.uk/LatLong.php
Logged

sevenlayermuddle

  • Helpful
  • Addicted Kitizen
  • *
  • Posts: 5369
Re: New project, A Clock
« Reply #28 on: November 25, 2020, 12:02:49 PM »

It might not work properly here because of the mountains, particularly Beinn nan Càrn which is adjacent to the house (we are on the slope of it) to the west, which cuts off an hour or so of daylight in the evening, and the amount depends on the time of year; as the sun goes further south in Winter the time loss due to the mountain’s profile reduces, and in June the amount of loss is a maximum approximately.

That's the sort of challenge I'll need to think about solving.

The first thing I aim to do with the breadboarded version is simply get it to continuously display the actual output voltage of the sensor as measured by the ADC .  That'll allow me to take some notes around sunset and sunrise, maybe sketch out some graphs and gain insight into how it is affected by weather, tree-shade, and the likes.  I've also have a few different LEDs to try, each with different lens patterns, as well as some additional fresnel lenses I can stick over the LED to see if it helps.

Then, unless I give up at that point (which is possible), I can start to think about what kind of smoothing algorithms might work best, allowing genuine events to dominate.
Logged

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: New project, A Clock
« Reply #29 on: November 25, 2020, 03:44:31 PM »

I wonder if the sensor would only need to have an unobstructed view in a southerly direction?  I.e. On the internal ledge of a south facing window.  :-\
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.
Pages: 1 [2] 3 4 ... 6