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.