Page 1 of 1

Mute by default?

Posted: Mon Aug 12, 2013 7:54 pm
by MathPirate
Is there a way to mute the speaker by default, or maybe a quick hack to install an on/off switch for the beeper?
Right now, I have the Geiger counter running 24/7 (Using the USB power hack someone posted here a while back), attached to a Raspberry Pi, and constantly recording the background radiation level in my living room. Normally I have it muted so that the 20 or so beeps a minute all day every day don't drive me insane. Thing is, whenever there's a power outage, the speaker gets unmuted when the power comes back on. I'd like to be able to either flip the default, so that it's muted on power up and I have to press the button to get sound, or install some sort of on/off switch for the buzzer, rather than the momentary switch that loses state on a reset. I'm sure I could probably just short a wire across the speaker contacts or something like that to bypass the speaker, but I'd rather not permanently disable the speaker if that's possible. (Never know when I might want to show the system off to someone geeky enough to appreciate it!)

Re: Mute by default?

Posted: Thu Aug 15, 2013 8:36 pm
by mightyohm
It would be easy to do this in firmware, if you have access to an AVR programmer and are interested in learning how to program AVR microcontrollers! But a much more simple fix might be to put a switch in series with the speaker.

Re: Mute by default?

Posted: Sat Jan 25, 2014 2:58 pm
by JChristensen
Great minds think alike, I just did this:
https://github.com/JChristensen/geiger

Re: Mute by default?

Posted: Sat Jan 25, 2014 4:17 pm
by mightyohm
Cool! Thanks for sharing your code - I like how you are using EEPROM to store the beep setting!

Re: Mute by default?

Posted: Sun Jan 26, 2014 4:25 am
by JChristensen
I really had to laugh, I had completed the change probably not 15 minutes before I saw this thread!

I have it running on an ATtiny4313. I wanted to have a backup MCU on hand, and checking prices at Mouser, ATtiny2313V-10PU was $2.73 and ATtiny4313-PU was $1.54. The '4313 is capable of low-voltage operation like the '2313V, but also has 20MHz ability plus twice the memory. Couldn't see a downside there :D

Feel free to use the code if you think it's a feature that folks will appreciate.

Re: Mute by default?

Posted: Wed Jan 29, 2014 11:13 pm
by mightyohm
Cool, thanks!

I haven't played with the 4313 yet but it sounds great!

Re: Mute by default?

Posted: Thu Apr 17, 2014 5:19 pm
by JChristensen
mightyohm wrote:Cool! Thanks for sharing your code - I like how you are using EEPROM to store the beep setting!
Except I did it wrong. Just went to make the change to my second GC and realized that I'd left off the EEMEM attribute. The code above is fixed now. How embarrassing... :oops: (It worked without EEMEM but just due to dumb luck.)

Re: Mute by default?

Posted: Thu Apr 17, 2014 8:25 pm
by mightyohm
Whoops! Thanks for posting the fix!

Re: Mute by default?

Posted: Fri Apr 18, 2014 12:30 pm
by JChristensen
mightyohm wrote:Whoops! Thanks for posting the fix!
Guess it wasn't your turn to watch me. Someone has to keep me honest!

I made a couple more minor tweaks. I changed the name of the flag variable from nobeep to beep because constructs like if (!nobeep) make me crazy (remember I'm the guy that forgot EEMEM).

I also initialized the flag to 0xFF, so that programming the EEPROM on new factory chips is not required.

Finally, I posted the code to GitHub and replaced the code above with the link.
https://github.com/JChristensen/geiger

Re: Mute by default?

Posted: Sat May 03, 2014 3:16 pm
by mightyohm
Cool! Thanks for sharing the link!