Mute by default?
-
- Posts: 1
- Joined: Mon Aug 12, 2013 7:35 pm
Mute by default?
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!)
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?
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.
Jeff Keyzer
http://mightyohm.com
http://mightyohm.com
-
- Posts: 8
- Joined: Fri Jan 17, 2014 3:51 am
Re: Mute by default?
Great minds think alike, I just did this:
https://github.com/JChristensen/geiger
https://github.com/JChristensen/geiger
Last edited by JChristensen on Fri Apr 18, 2014 12:22 pm, edited 4 times in total.
Re: Mute by default?
Cool! Thanks for sharing your code - I like how you are using EEPROM to store the beep setting!
Jeff Keyzer
http://mightyohm.com
http://mightyohm.com
-
- Posts: 8
- Joined: Fri Jan 17, 2014 3:51 am
Re: Mute by default?
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
Feel free to use the code if you think it's a feature that folks will appreciate.
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
Feel free to use the code if you think it's a feature that folks will appreciate.
Re: Mute by default?
Cool, thanks!
I haven't played with the 4313 yet but it sounds great!
I haven't played with the 4313 yet but it sounds great!
Jeff Keyzer
http://mightyohm.com
http://mightyohm.com
-
- Posts: 8
- Joined: Fri Jan 17, 2014 3:51 am
Re: Mute by default?
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... (It worked without EEMEM but just due to dumb luck.)mightyohm wrote:Cool! Thanks for sharing your code - I like how you are using EEPROM to store the beep setting!
-
- Posts: 8
- Joined: Fri Jan 17, 2014 3:51 am
Re: Mute by default?
Guess it wasn't your turn to watch me. Someone has to keep me honest!mightyohm wrote:Whoops! Thanks for posting the fix!
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