|
Forum Index : Microcontroller and PC projects : Audible Alarm For MM170
| Author | Message | ||||
| Andrew_G Guru Joined: 18/10/2016 Location: AustraliaPosts: 903 |
Hi, My BBQ Probe (see here) is progressing well with the probe temperature and timers being shown on a MM170 LCD BackPack. I flash the screen red as the probe approaches the set temperature etc. What I am lacking is an audible alarm. Do any of you have any tried "solutions"? (this will have other applications too). (And yes I know the MM+ can do better). Preferably loud enough and low enough frequency for my aged hearing (and even with adjustable frequency and volume? - either in the circuit or via setup on the LCD). I have tried fixed frequency buzzers (with a trimpot to adjust volume - too high a frequency for my ears) and allegedly PWM controllable ones for Arduino (much too quiet). Many thanks, Andrew |
||||
| BrianP Senior Member Joined: 30/03/2017 Location: AustraliaPosts: 292 |
You need to cycle through a range of frequency - like police / ambo sirens. You also need an amp to boost the PWM - there are heaps of very small single board / chip possibilities out there, 5-12v powered. You could then use this to drive a piezo sounder thingy - some of these are really loud (you need a passive one, not one of the fixed frequency ones). Also there are small single board police siren emulators - just feed them the volts & away they go. Jaycar or Altronics should have them. Although letting the micro do the PWM would let you choose the best range that suits. B |
||||
| Andrew_G Guru Joined: 18/10/2016 Location: AustraliaPosts: 903 |
Brian, Many thanks! I paid my local Jaycar shop a visit and settled on. It is a magic little amplifier that does the trick for me. I also bought a number of passive buzzers to play with and this speaker . Now I can now use the PWM command to get notes etc. All buzzers/speaker are loud enough for an alarm. I might add a trim-pot for volume control. I'd make the following comments about the amplifier: - it is stereo (I only need one channel) - it is really small and inexpensive ~Au$5 - its pinouts are spaced for cable connections, not pins/headers, but I was able to cheat and force the ones I needed to standard headers for breadboard etc. - it has a pin "SW" for "Switch" which, when grounded, turns the amplifier off - I'll use that with touch control for "Mute". Cheers, Andrew |
||||
| Andrew_G Guru Joined: 18/10/2016 Location: AustraliaPosts: 903 |
Hi, I've spent an hour or so playing with alarm sounds on my MM170. (The dog doesn't like the high pitched ones.) Here is what I have so far (80:20 rule). '. '. For I = 1 to 50 'Just a loop so you get the idea TimerOld = Timer PWM 2, 300, 10 'PWM 2 (is Pin # 26), Frequency, DutyCycle Do:Loop While Timer < TimerOld + 500 '500 is the duration of the "note" in mS TimerOld = Timer PWM 2, 600, 10 Do:Loop While Timer < TimerOld + 500 Next I PWM 2, STOP 'Otherwise it keeps playing the last "note" '. '. Do any of you have any snippets to suggest? Is there a "Library" of MM sounds or even ditties? (I'm really looking for a bit of friendly competition here . . .) Cheers, Andrew Edited 2019-11-11 15:07 by Andrew_G |
||||
| twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1769 |
I'm using "bird" and "siren" for a small piezo buzzer: Option explicit Dim T1 'temperature from a DS18B20 Dim j 'loop counter const threshold=22 Do TEMPR START 3, 3 T1= TEMPR(3) Print T1 If T1 <threshold Then For j = 1 To 5 bird 'or siren Next j PWM 2, STOP Print "L" Pause 2000 EndIf Loop Sub bird Local integer f1,f2 For f1 = 440 To 3000 Step 200 PWM 2,f1,50 Pause 10 Next f1 For f2 = f1 To 440 Step -200 PWM 2,f2,50 Pause 10 Next f2 End Sub Sub siren Local integer f1,f2 For f1 = 440 To 3000 Step 20 PWM 2,f1,50 Pause 10 Next f1 For f2 = f1 To 440 Step -20 PWM 2,f2,50 Pause 10 Next f2 End Sub ‚My name is Ozymandias, king of kings Look on my works, ye Mighty, and despair!‘ Nothing beside remains. Round the decay Of that colossal wreck, boundless and bare The lone and ... |
||||
| Andrew_G Guru Joined: 18/10/2016 Location: AustraliaPosts: 903 |
Thanks Twofingers, Very good - I will pinch them if I may?? OK Shedders - any other snippets? Your code also helped me understand: - PAUSE actually does pause the execution (I put "PRINT TIMER" before and after and then in a second test removed the Pause - sounded very different). From my reading of the manual I expected the "tone" to not stop but to continue until the next "PWM" command (eg as occurs with a ^C). Hence my clumsy workaround of " Do:Loop While Timer < TimerOld + 500". I'll change to PAUSE from now on. - I don't need a trimpot for adjusting volume - just alter the dutycycle parameter! - TEMPR START to set the precision of the DS18B20 reading (I have, without thinking, been using the default - OK for some applications but not all). Thanks again, Andrew Edited 2019-11-12 11:58 by Andrew_G |
||||
| twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1769 |
Hi Andrew, sure, it is posted for that. I hope, you will get more code snippets. Michael ‚My name is Ozymandias, king of kings Look on my works, ye Mighty, and despair!‘ Nothing beside remains. Round the decay Of that colossal wreck, boundless and bare The lone and ... |
||||
| Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1694 |
You might like to have a look at this post for some sounds. Bill Edit: Another approach could be to write a routine that imitates the Maximite SOUND or TONE commands and pinch some sounds from Maximite games? Edited 2019-11-13 10:34 by Turbo46 Keep safe. Live long and prosper. |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |