It’s about 5 am… it’s nice and quiet I wake up.. get a cup of coffee, and putter around in whatever my current project is. At some point the birds start chirping and then it’s the day.
Author: Stephanos Blog
Why do we have so many time zones?
What a pain they are. Sure it’s nice to have your local time, and it’s convenient for lunch to be at 12:00, but seriously in our connected age, we’re constantly having to convert time zones… Say something like “I’ll do a facebook live at 1pm” and someone will ask “I’m in pakistan, what time is that?”
So also repeatedly as an on and off HAM radio operator, I’m constantly torn between local time and UTC. International radio stations use UTC, a lot of HAM support uses UTC….
Now years ago, I gave up AM/PM time and switched every device I use to 24 hour format… It’s second nature to me now, but yes… I do a rapid mental conversion to AM/PM time whenever I have to relate to something on a schedule, like TV listings, or just talking to “normal” people about when to meet.
So today on my RaspberryPI that is dedicated to satellite reception, I switched it’s time zone into UTC. Why? Because satellites know no time zone, they are on UTC… and many satellite predictors out there use UTC… Sure some use your local time, which now is inconvenient…, but for the most part, when I get a prediction a sat is going to make a pass starting at 02:53UTC, I can tell my raspberry PI to do something at 2:53UTC, without having to do the dumb mental conversion to local time.
A benefit of switching to UTC… if I talk to someone in London, I’ll be naturally be using their local time zone.
So the question is, how far should this go? Like should I switch my phone to UTC? Is that even possible?
Get Weather Satellite Photos onto your Raspberry PI?
I’ve had a side track for a couple days… I did some work on the solar tracker project and got stuck waiting for parts, and so took a look at YouTube and since I am also into Ham Radio, YouTube suggested a video on how to receive photos from weather satellites.
Ok wow. I already had all the components I needed… A Raspberry PI, an SDR USB dongle (software defined radio), an antenna.
Basically with the right software installed, and some internet access, you can tune the SDR to a NOAA satellites downlink frequency, wait for it to fly overhead, and record the audio received. From there you can give that audio file to a program that decodes the tones in the audio into a photograph.
There’s also software that automates the process so all you have to do is configure things and sit back while your Raspberry PI collects images from satellites as they fly overhead.
I’m not giving details on how to do this.. there’s so many ways to accomplish the task, and fortunately many websites and videos explaining how to do things.
Here is a link to the video that got me started.
I enjoy that some people enjoy
What I enjoy about writing is that some people enjoy what I write.
Added a Beeper to the Barn Door Tracker
Not that there will ever be a clear night in my area again.. I’ve continued to refine the barn door tracker.
So as I said in my last post.. the tracker will home itself now upon power up or reset. The process takes about a minute — mostly because the stepper won’t go more than 10rpm, and in the final homing stage I go 2rpm so I approach the home click slowly.
Well other than looking at the gears to see what direction they are spinning, which seems difficult if it’s dark out, also considering everything is in black plastic, I decided to put some audio feedback in the system. Now it beeps out beep codes telling me what it’s up to.
To do that I bought one of these, Fielect Active Buzzer Modules:
Click the image if you’d like to check it out on Amazon. If you decide to buy one too, and use that link it will help support this blog.
Now it came with no instructions, just labels on the pins, vcc, i/o, gnd. and some printing on the bottom saying it has a low trigger. Oh, and the buzzer itself has a sticky label on it that says “Remove after washing”… uhm… washing? At any rate, it seemed logical to remove the sticker since it covers up the sound hole of the buzzer.
So my assumption is, if I put a logic low on the i/o pin it will beep, and a logic 1, it should be silent. and I connected up power to 5 volts.. hey because I have a pin header where I can get 5 volts, and not where I can get 3.3volts.
Well that’s not gonna work… the ESP32 logic level 1 is 3.3 volts. Apparently that’s not high enough to convince the transistor on the unit to see logic level 1. So no matter what digital output, LOW, or HIGH I put out, it just constantly beeps. And it beeps loudly.
OK, so I’m lazy, I could unplug all the leads to the ESP32 for the tracker, solder on a pin header where I can get 3.3 volts to supply the beeper, and re-wire everything. What a mess.
So it was time for some hacking. Normally in Arduino land, you say “pinMode(PIN, OUTPUT). Then digitalWrite(PIN, HIGH) puts out 3.3 volts), and digitalWrite(PIN, LOW) puts out 0 volts.
But if you say pinMode(PIN, OUTPUT_OPEN_DRAIN) it does something else… digitalWrite(PIN, HIGH) floats the pin (in other words like no connection), and digitalWrite(PIN, LOW) grounds the pin.
Now that works. I can turn the beep on and off. But yes.. it is a total hack, that avoids taking things apart and getting out the soldering iron.
I did verify, using a different ESP32 I have which has 3.3v on a pin header, and the beeper works as expected. Configuring it as just OUTPUT, and sending out a LOW turns makes it beep, sending out a HIGH turns off the beep.
I’ve seen people online try to use Arduino tone() with these things, and yes that will make it put out different frequency tones, but an active buzzer is not supposed to be used that way.
Here is some code demonstrating both switching the beeper on and of — for a little blip of time, and then using tone.
// pins -- beeper vcc to 3.3v, gnd to gnd, i/o to io26
#define BEEP_PIN 26
void setup() {
pinMode(BEEP_PIN, OUTPUT);
digitalWrite(BEEP_PIN, HIGH);
}
void loop() {
digitalWrite(BEEP_PIN, LOW);
delay(2);
digitalWrite(BEEP_PIN, HIGH);
delay(1000);
tone(BEEP_PIN, 400, 500);
delay(1000);
}
Overall, I’d say I like this buzzer. It works exactly as expected.
NEO-6M GPS Module, My Impressions
To start off, this will be a type of review of a product I bought on Amazon, I have to state that I have no connection at all with the seller, or manufacturer, my only connection is that I’ve included an Amazon affiliate link in this post, so if you buy one from that link I’d get some monetary benefit. I bought one with my own money.
Overall, I like it very much. But I have a couple negatives.
The positives is that it is quite easy to set up. You will have to solder on the supplied 5 pin header in order to connect to it via the UART, and to get access to the PPS signal. The UART connection is just like any other GPS module, and I was able to substitute it in to my Raspberry PI time server, in place of the original module (Which I was borrowing from one of my ham radios), very easily.
It takes a few minutes to get the first fix (and by the way, it needs to be near a window). but after that it gets a fix within seconds, since it has an onboard battery to keep it’s memory of the last satellites it heard.
I like it because it is really small as you can see in the picture, and came with a patch antenna, and it is inexpensive at $10.99 (at time of writing this).
One more plus is it must not draw much power. My Raspberry PI 2 is pretty marginal on available power for peripherals.. but I’ve checked and got no power drops or throttling while using it.
Now the down sides. Though it has a micro-usb connector on it, and if you look at the traces on the board it is wired to provide data on USB, I could not figure out how to get USB going with it and my Raspberry PI. A downside being there are no instructions, and also no web articles about how to make that work. Why no web articles? Well probably because everyone is using the UART connection, not USB.
The patch antenna was a little tricky to install. Probably mostly because of my bad close vision, but with magnification, it became clear how the connector connects.
Also twice now, upon power up, yes it gets a fix, yes it gets accurate time (My main purpose for it), but no, it has a completely wrong location. What I’ve found is just power cycling it, and it will get a good location. I can’t explain it, but it’s possible mine is not getting a good signal all the time, I have it in a sun room, that has 3 walls of all windows. I haven’t dug in to why it is doing this, but I do know it has nothing to do with antenna placement, since once I power cycled it without moving it at all, and the problem went away.
I definitely will buy it again for any other time keeping applications, and I may buy one just to play with.
Click the image to check it out on Amazon, if you buy through that link it will helps support this blog.
Home made clocks and NTP
I have made a couple digital clocks with ESP32 microcontrollers and LED displays.
One is just a basic 7 segment digital clock to keep in the bedroom. Another one is one with a LED dot display that displays the current time and a weather forecast.
Oh.. in order to provide a weather forecast, I have an outdoor ESP32 that measures temperature, air pressure and humidity.
Anyways, those and other ESP32 projects I’ve built need a source of accurate time. Sure you can manually set an ESP32’s time, and it will remain accurate for a good amount of time, but I wanted clocks that number 1 set themselves, and number 2 do the daylight savings time change over automatically.
So fortunately there is an NTP library available for ESP32’s and all you need to do is have them use a network time server to get and maintain their time.
Well since I was going to be playing a lot with these clocks as I developed them, and you end up rebooting them many times an hour. I figured I’d run a local NTP time server on my home’s file server raspberry PI. That way, since that machine hardly ever reboots, it would not be banging on a network time server so much.
That works great, but I also got interested in having my own, non network dependent time standard to set my clocks from. Now you can get modules that use radio to get a signal from WWV, but that’s not too reliable. I have an analog, so-called atomic clock, hanging up in my living room and occasionally it fails to do the DST switch over without help.
Well another source of accurate time is GPS. I built a GPS module for one of my ham radios to use as a time standard, so I figured why not also use GPS for setting the clock on the R PI server?
Fortunately I’m not the first one to do this and there is a lot of support and instruction for setting up a gps module as a time source to make a stratum zero NTP server.
And that’s what I did, for about 10 dollars I bought a newer pre-made GPS module (Much smaller than the one I built) and attached it to an old R-PI 2B that I had no other use for.
And wow, with a little fussing, it is now sitting there as my stratum zero time server. Then I configured my home file server’s NTP server to sync to that, and/or one of NIST’s network time servers.
Now, my primary NTP server, the one all my devices talk to, is kind of fail safe. It uses GPS time from my new server, and also uses the NIST server’s time in it’s calculations if it is available. If my new server goes down (like when I’m playing with things), it seamlessly switches to just using the NIST server. If my Internet connection goes down, it just uses my new server. If both go down, well then for that period of time, the file server’s system clock will drift and my digital clocks may also then drift a bit.. but those are the breaks, once at least one server is back, time will sync up to reality again.
If you are interested in playing with making a GPS based NTP server yourself, here are a couple links I found helpful: link1 talks about setting up an NTP server with GPS time, link2 is a basic guide for just getting GPS working on an R-PI.
The Weather
We don’t have any deadly weather. We don’t have droughts. No wide spread floods. We don’t have heat waves. It never get too cold. About twice a year there is a snow storm and a couple times a year it gets windy. oh and no earth quakes to speak of.
And because of the climate, the trees turn beautiful colors in the fall.
In case of an emergency….
Create an emergency preparedness plan.
Prepare:
Buy chocolate
Plan:
Eat the chocolate
Too Many People Say “the”
I feel we should eliminate the definite article, and opt for confusion. That’s it the last time I say “the”. Oops there it was again, I said “the” twice,…. oops. It will take a while to get the hang of it… oops again.
Here is a scenario: A friend is with you in a store holding an apple next to a display of apples. You say “I want apple”.. they say “which apple my apple or that apple”, you respond “I want apple”. Your friend throws apples at you.