Comments (29)
I'm also trying different PWM values for the -17dB low signal. Tried higher and it definitely bombs out earlier. Now trying lower than 6...
from wwvb.
Try changing:
if ((wwvb_tx.mm() % 10 == 9) & wwvb_tx.is_active())
To:
if ((wwvb_tx.mm() == 59) & wwvb_tx.is_active())
This will sync it once an hour. The drift will be about 15ms over that time, so should be negligible.
The other option is a change in wwvb modulation, which i really don't want to do. It would involve amplitude modulation instead of pulse width modulation, hence more componentry.
from wwvb.
Did the change and retested various PWM low values. The Casio is still not happy with it, the desk clock works fine with up to a PWM low of 10 then fails after that. Tried the default 6 a few times and also 4, 5. No joy with the Casio watch.
It would be good to find someone else with WWVB clocks or watches to try some testing.
from wwvb.
Appreciate the amazing work on this project... I've been trying with a Japanese Casio Lineage LCW-M170TD-7AJF with no luck (https://www.amazon.com/gp/product/B00IK5YZR6/ref=oh_aui_detailpage_o07_s00?ie=UTF8&psc=1). My dso0201 nano scope says ~60.07 kHz with slight fluctuations, not sure how accurate it is though, but seems like the watch is really sensitive to an accurate signal. Depending on when I start a manual sync on the watch, it may try for about two minutes, or bomb out before one, and always results in an error. I'm following and hope you make a breakthrough, and maybe in the end that means some amp. mod. components. I live in Hawaii, so it's not just a bad WWVB signal, it's NO WWVB signal :-(. Thanks again for your efforts...
from wwvb.
@ntmmfts @mr-sneezy
This project is currently on the back burner, i had been waiting for parts to arrive to continue testing (which have since arrived). Ill get back on to this shortly (time permitting).
The code (below) is capable of generating a 60.150kHz or 60.606kHz carrier, so if @ntmmfts is measuring 60.06kHz then its better than expected!
#if (F_CPU == 16000000)
ICR1 = 133; // Set PWM to 60kHz (16MHz / (2*133)) = 60150Hz
// Yes, its 133 and not 132 because the compare is double sided : 0->133->132->1
PWM_HIGH = 66; // ~50% duty cycle
PWM_LOW = 6; // ~5% duty cycle
#elif (F_CPU == 8000000)
ICR1 = 67; // Set PWM to 60.6kHz (8MHz / (2*66)) = 60606Hz
PWM_HIGH = 33; // ~50% duty cycle
PWM_LOW = 3; // ~5% duty cycle
#endif
The timing of the modulation signal is max 10Hz, so much easier to get right.
Im thinking that one of three things are to blame.
- I suck, and have stuffed something up. Very probable, but it is working with the BALDR clock (@mr-sneezy youtube vid) so it must be close
- My internal 60kHz signal isnt close enough - i need to modulate an external oscillator
- PWM is not good enough for quality clocks, i need to do AM
TODO:
- modify the code to just output the digital modulation signal (in progress.... slowly....)
- modulate a 60kHz carrier by this signal using an adder op-amp circuit (hopefully this is close enough?)
2.1. if 2 works : test it with an internal 60kHz carrier - this minimises components.
2.2. if 2 doesnt work: try it with a proper AM circuit =spice simulation, pain and more componentry
from wwvb.
@ntmmfts
Strangely enough that is exactly the same Casio Lineage that I have, but mines the black face version. Symptom is the same, the watch clearly detects a signal and starts to sync but then gives up after about two minutes, sometimes less I think. The same code and 'antenna' coil work fine with the BALDR desk clock though. So we're very close, but not quite there. It would be good to hear if somebody with a different Casio or perhaps a different watch altogether like Citizen could try it out. The antenna coil is fairly easy, a bit of hookup wire driven via a resistor or a LED as a current limiter will be OK for a test at close range (20-40cm).
from wwvb.
Update!?
I was going to create an opamp adder with one side of a lm358 (for AM) so i thought to use the other side as a 60kHz astable multivibrator. The maths for the circuit is tricky to tune, i couldnt get the damn thing to work - FAILED.
So i tried an astable 555 timer circuit. I couldnt get it to start unless i used a 1nF cap for C. The problem with this is that it's not very robust and its damn hard to tune as the cap tolerance and board capacitance vary so much. It should need Ra= 2k, Rb=11k. I settled for Ra=2k, Rb=10k pot. The 60kHz is very unstable - very temperature dependant, scrap that - FAILED.
Next i tried using parts of the wwvb to generate a 60kHz carrier - FAILED, then SUCCESS! Long story short, i think the bootloader and Arduino framework i use for the Attiny85 override some timer values so the wwvb library doesn't work for the tiny. It does with the internal 64MHz PLL, but in a recentish attempt to consolidate code i made it dependent on the 16 or 8MHz clock. Easily fixed, but motivation & time to roll it back into wwvb is low at this stage.
Tomorrow (?) ill design the op amp adder and see how i go. If it works with this setup then the next step is generating (and tuning) the 60kHz carrier and <10Hz modulation signal using the nano/micro.
Wish me luck!
from wwvb.
I wish you luck :)
And help of course.
My spare time for coding is split between the ESP8266 battery monitor (which is morphing into a weather station :) and also the Honda OBD to ODBII converter...
from wwvb.
thanks for your efforts! looking forward to see where things go... ~jay.
from wwvb.
I've uploaded my latest updates. The modulation output hack for wwvb only works for 16MHz, only tested against the nano.
Im using an attiny85 barebones for the 60kHz carrier. Funnily enough it should only need 132 for the compare register for 60kHz but i had to increase this when i tested it on the programmer. Then put it on a breadboard and its 57.4kHz. I can't win :)
See the fritzing diagram for the opamp circuit, but it doesn't work yet. I need to spend a bit more time on it.
from wwvb.
Yes nice set of diagrams :)
from wwvb.
Well i designed the adder circuit. Then realised it's not going to work for a single rail opamp. I then designed and tested a non inverting adder, and realised i want to add the carrier with the ook version of the carrier instead of the modulation pulse and the carrier. I added a 2n5484 and voila, working circuit.. At the cost of 2 components and 5 resisters. First of all i simulated it and it worked as expected.
Then @mr-sneezy points out that all i need is a voltage divider into a unity gain buffer. 'high' state i set the arduino pin floating, 'low' state i ground the positive input through a resistor to create the voltage divider. 1 component and 2 resistors - same output. So that's what ill try next. Just need to update the wwvb code to output the modulation pulse as i described above.
Stay tuned..
from wwvb.
Just a short note. The lm358 i use needs to be powered by 6.5V minimum as at worst it can output the rail voltage - 1.5V.
I was pretty happy with myself when i implemented a voltage multiplier off of the 60kHz signal, and it worked... But the desk clock is not playing dice - so its a timing issue. It needs more debugging, and probably calibration. I plan to get a stable 60kHz signal out, and use timer2 PWM at 1Hz for the modulation signal - and tune that setup as it should be most stable (less ISR calls).
@ntmmfts - what Arduino are you running? I work mainly on the nano, and if this works i may not bother calibrating for the micro/leonardo. I would really like to move this project to an esp8266 and use ntp for timing rather than gps, so would use my time learning up on that.
from wwvb.
Sorry, was distracted by my job for a while! I'm using a nano. Question, what exact model lm358 did you use? Thanks again!!
from wwvb.
Yeah you and me both!
At the moment I'm trying to get my esp8266 controlled xmas tree lights flashing to music 😄
Unfortunately i still don't have it working for the casio watch, i need to calibrate it and run another test using the AM circuit. I really hope i dont have to do proper AM as ill need to use a negative supply. IF (big if) i need to go down this path ill use a 555 circuit like this http://www.electronicecircuits.com/electronic-circuits/555-negative-voltage-power-supply-circuit. This would be a pain..
Lm358n or lm358p - same chip, different manufacturer. This looks like a good buy - 50pcs for $2 http://s.aliexpress.com/YJryqQrA .
You can also get 10pcs for $1 on ali
from wwvb.
thanks! and good luck with the tree and Merry Christmas 😀
from wwvb.
You too!
from wwvb.
Just a heads up - im back on task.
Im in the process of rewriting this project to utilise the Arduino Time library, @JChristensen Timezone library.and my own PWM library. I will support wwvb at 60kHz and jjy at 40kHz and 60kHz.
Watch this space.
from wwvb.
Sounds like a man possessed :)
from wwvb.
whilst thats pretty cool, I'm using an esp8266 locking with NTP, a timezone shift to fake US timezones in australia and a stupidly small 60.000kHz osc from Microchip (yay samples!)
it would be great to handle different clock systems and something like the Digispark would do the job..
from wwvb.
@baradhili - what wwvb watch/clock are you using? Also what antenna?
One of the reasons to moving to Time and Timezone is that its easier (its already coded, examples are available) to use different sync methods such as ntp and gps, also daylight savings time is automatically accounted for.
The only thing that would be nice is to auto detect what timezone you are in - it would require either gps distance to the closest timezone (there are 39 worldwide), or i believe weather underground returns tz and tz offset.
from wwvb.
from wwvb.
Stupid booleans taking up 8bits... Having issues with my struct, but im getting close to gettting a first version working.
There is too much to change here, so ill be starting up a new library and abandoning this one.
Ill keep everyone informed of the change - but this is no longer maintained :(
from wwvb.
Mark it sounds like baradhili has a US market clock like my desk clock. If so he'll only have the US time zones available on it.
from wwvb.
"and a stupidly small 60.000kHz osc from Microchip (yay samples!)"
What's the part number of that osc ?
from wwvb.
from wwvb.
Holy crap, just found this app and it synced my Casio Lineage LCW-M170TD-7AJF on the very first try! No bullshit, it actually works. My Casio hasn't synced since it left Japan brand new a year ago - even after several trips to the mainland where it failed - and now this app, wow. Clock Wave, https://cw.rzapps.com. I will never give up on the aruino project though, not after all this effort, lol.
from wwvb.
Great yes, but it doesn't work on most of the other phones in the world (Android) and will wake me up at night when the watch expects it's next update...
from wwvb.
Okay im closing this down. It is an acknowledged bug, and should be fixed in the new wwvb_jjy library
from wwvb.
Related Issues (10)
- No output with nano HOT 1
- AD9850 DDS as a RF generator HOT 13
- Timing issue HOT 2
- No issue. First successful time set for me on a WWVB clock ! HOT 4
- Hours not correct on minimum.ino HOT 2
- Too many big words Charlie HOT 7
- Nearly there but... HOT 15
- Thanks, this works perfectly for me HOT 4
- Running on 3V logic HOT 27
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wwvb.