Teach An ATTiny 85 To Swear

Let’s be honest here: one of the first things we all did when we came across speech synthesizers like the Speak-n-spell was to try swear words. [Alec Smecher] has taken this to heart, building a simple buzzer mechanism driven by an ATTiny 85 that swears repeatedly when you connect it. It is a rather simple project (or, as [Alec] himself says, it is “a satisfyingly minimalist build”), but it is quite nicely done.

The 8kHz speech sample (taken from Google Translate) is stored in the code, and written out to one of the PWM outputs of the ATTiny85 from a timing loop to directly drive the small speaker. So, all that is needed is the buzzer case, a small speaker, the ATTiny85, a power source and a few bits of wire. It’s a great example of a minimalist design: the ATTiny85 can just about drive the speaker directly, and can be run directly from batteries without requiring a power controller. Sometimes it pays to keep things simple, especially when it comes to swearing. 

Thanks to [Pičugins Arsenijs]  for the tip! UPDATE: post changed on 10/21 to clarify the submitter and the author.

31 thoughts on “Teach An ATTiny 85 To Swear

  1. I think that Hackaday writers should really review the submissions better. I’ve sent this in but this is not mine,this is from same blog that had that small toy TV modified to hold a SGS3 and modified the remote to be Bluetooth. My e-mail’s first sentence is “Ok, so I found this on a blog of a guy whose post was about re-making a toy television.” Not to say I’m not going to improve on this, given that I like pranks, but it’s not my project and should not be credited as such. This is the author: http://cassettepunk.com/about/

  2. Cute, but for anything more complex I’d recommend that people look at the WTV020-SD modules which cost about $3, or the version with built in flash, WT588D-16p, which requires a Windows based utility to upload the sound data. I’ve seen hints that this can be done directly somehow using Linux but don’t have complete instructions for it. These modules can have a attiny dead bugged onto them as a controller for selecting which tracks to play back. I think the limit is 512 sounds, which is more swearwords than I know. :-)

          1. Oh well I was excluding pseudozulu which I use in places where English expletives would get me in trouble. There is no limit to the number of elaborate profanities you can generate in pseudozulu. Hmmm now there is an idea, I wonder if I can fit a markov chain based pseudozulu random profanity generator in an attiny?

          2. The chain of expletives that hammered my speaker phone from an engineer after a mudslide near the Grape Vine easily met 25% of a 512 limit.

            I’m pretty sure he wanted an Earth mover. That’s what I sent him anyways. He might’ve been asking for a dump truck. I dunno.

          1. Yeah, valve logic is a bit before my time, but I do have a distant relative that helped a guy to figure out how to program this mechanical contraption he invented.

    1. You mean the trick where you write some assembly code to record sound by counting between zero crossings of an audio signal then toggling a motherboard speaker port with the same frequency data stream for playback? I did that on a 6502 CPU (Apple clone) when I was a teen. It was possibly one of the earliest spoken boot sounds for a desktop computer.

      1. That, or you can even do a PWM DAC if you flip the bits fast enough. Early Windows 3.1 machines could do it with SPEAK.DRV (I think), though it took the whole CPU over. Was an option to turn off interrupts to stop the little clicks disturbing the sound. Yeah, I know, turning them off!

        Some of the 8-bit computers did something similar, not sure how fast a 3.5MHz Z80 could dump bits to a speaker, but I’d guess a hundred KHz or so. With that sort of PWM you end up with frequency and bit-depth blurring into each other.

    1. I agree. This a ridiculous and inappropriate use of a microcontroller and speaker. What a complete and total waste of time.

      I would have attempted to write a brainfuck emulator to run brainfuck code so it could say, “brainfuck.” That would be a very interesting and educational project for the AVR.

    2. I think the author could have said the speaker is making a noise similar to the work “buck.” This would leave more to the imagination when you hear it for yourself, rather than using profanity straight out. You might hear the word “buck”, but from the article you know it might really be the other word. That way you only get hit with suggestive themes rather than a full blown profanity rating to the article.

        1. McNugget, apology accepted. I deliberately did not use the word that the device said in the post, as I am aware that people find it offensive. Personally, I think that the problem with swearing lies with the people who are offended by it, not with the word itself: it’s a perfectly good word that has been used since the 15th century.

  3. I built this and fit it inside a mint tin. I couldn’t figure out how to include a picture in this comment section, so I made this post http://bushta.net/?p=119 that has two pictures. There is a picture of the outside, and one of the guts. In that post I mention that I got the speaker from a broken laptop, the battery holder from a broken flashlight, and added a button so it wouldn’t constantly swear.
    Thank you Richard for this fun hack.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.