Closed mr-sneezy closed 7 years ago
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...
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.
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.
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...
@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.
TODO:
@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).
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!
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...
thanks for your efforts! looking forward to see where things go... ~jay.
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.
Yes nice set of diagrams :)
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..
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.
Sorry, was distracted by my job for a while! I'm using a nano. Question, what exact model lm358 did you use? Thanks again!!
Yeah you and me both! At the moment I'm trying to get my esp8266 controlled xmas tree lights flashing to music :smile:
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
thanks! and good luck with the tree and Merry Christmas 😀
You too!
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.
Sounds like a man possessed :)
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..
@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.
actually I'm using some US "radio clocks" in my house..
On Friday, 24 March 2017, 4:38, Mark Cooke <notifications@github.com> wrote:
@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.— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
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 :(
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.
"and a stupidly small 60.000kHz osc from Microchip (yay samples!)" What's the part number of that osc ?
a DSC6183CE2A-060K000
On Saturday, 25 March 2017, 20:03, Martin <notifications@github.com> wrote:
"and a stupidly small 60.000kHz osc from Microchip (yay samples!)" What's the part number of that osc ?— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
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.
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...
Okay im closing this down. It is an acknowledged bug, and should be fixed in the new wwvb_jjy library
I'm finding that the Casio watch is listening to the WWVB for longer than 9 minutes without making a time update. I'd like to try 19 minutes between re-sync with GPS time and see if it works then.
Can we do re-sync at 0, 20, 40 minutes and TX start at 1, 21, 41 ?? MS
// Note // * wwvb time is synced and wwvb transmission is started when minutes = 0,10,20,30,40 or 50 // * wwvb transmission is stopped when minutes = 9,19,29,39,49 or 59 // // In other words, wwvb will transmit for 9 minutes, then turn off and sync for a minute // if ((wwvb_tx.mm() % 10 == 9) & wwvb_tx.is_active())