Introduction: Robot Vacuum That Feels Pain! ( Attiny85 + DFplayer Mini )
I recently got a robot vacuum (AT Mouse SP8000) and I call her Dustine, get it. DUSTY-INE.
I see her bumping into stuff and I wish she had a personality like how a real person would react when they bump into stuff. Like say Ouch, and Dammit, and maybe a swear word here and there. So I taught why not make that happen, So I did.
Full project video:
- Digispark Attiny85 - https://amzn.to/3fHpXkm
- DFPlayer - https://amzn.to/3mfVH2z or
- https://amzn.to/36dQ1jP (with speaker)
- 1K Resistors - https://amzn.to/2V91xXF
- < 32GB SD Card - https://amzn.to/3mhvSiH (cheaper the better)
- ProtoBoard - https://amzn.to/2JnjBdK
- Speaker - https://amzn.to/3ljeA3c
- Jumpers- https://amzn.to/3fPMyLF
- Arduino UNO - https://amzn.to/33oSmqF
- Arduino Nano - https://amzn.to/2JoTyCV
- BreadBoard - https://amzn.to/3fQDLJy
- Amplifier - https://amzn.to/2Ve4tlE
- Solder Iron
- Dremel - https://amzn.to/3miCNbf
This post contains affiliate links, which help support my channel.
If you purchase through one of my links, I may earn a small commission; at no extra cost to you.
Step 1: Testing DF Player Mini
Now the main component of this project will be this DFplayer mini, which can play mp3s from a memory card. This device is stand-alone meaning it doesn't need an Arduino or anything to make it work. But I think I want to control it via a microcontroller for added effects. According to the DF player datasheet, we are going to need a speaker that is under 3 watts unless we want to use an amplifier.
I am using the Arduino uno only for 5v power here and I connected it and the speaker like in this diagram above.
I then formatted a 4GB micro SD card I had to FAT32 and loaded it with some meme sound effects I sometimes use in my videos. Using a jumper wire, I connected on one end to ground, and I can touch anyone of the IO pins to play the next or previous track.
I find the audio quality is decent and very audible. It isn't something you would add to your entertainment system but it is perfect for this project.
Step 2: DF Player Mini With Arduino
The next step was to try and get this to work on the Arduino uno and control it over UART. To do this I am using the DF Robot DF Player Mini library for Arduino.
From here I loaded the GetStarted example to the UNO. If you don't know anything about Arduino you check out my Arduino playlist to get started.
The code uses software serial and plays the next song every 3 seconds. Note you should also adjust the volume here if you find the volume to too soft.
myDFPlayer.volume(30); //Set volume value. From 0 to 30
The circuit diagram is above for this test. Notice you are going to need a 1km resistor on the transmit line.
I am happy how well this is working so its time to see what is going on inside of Robot vacuum.
Step 3: Inside the Robot Vacuum
Now what I am about to do will void any warranty she has so if anyone does this do it at their own risk.
I first took out her bin and all the screws at the bottom.
I took out the battery which had a hidden screw underneath it.
The front bump also needed to be taken out being careful of any wires or connectors.
Then it was easy to lift the top off, disconnecting the motor, and touch button.
This reviled the madness that is inside of a robot vacuum. I mean it was a lot. and am pretty she is simpler than other robot vacuums on the market.
Step 4: Digispark Attiny85
After looking inside the vacuum, I found the Arduino uno and nano to be a bit big for inside of the vacuum not to mention an overkill.
I turned to the Digispark attiny85 I had which has 5 GPIOs and is small. This device is a bit tricky to use as you need to update your drivers and add digispark to your Arduino board library but once done you can do a lot with this little device.
Attiny85 Drivers + Arduino: https://github.com/LilyGO/DigiSpark-ATtiny85-drive...
The real reason for using a microcontroller in the project is to allow multiple trigger mechanisms and also to give us randomised playback. So it doesn't become repetitive and predictable. So I wrote a code that uses the Arduino random function to randomly pick a track when the robot bounces into something and triggers the switch.
Arduino random function: https://www.arduino.cc/reference/en/language/funct...
My Code: https://github.com/justbarran/Robot-vacuum-that-says-Ouch-
The vacuum has 3.3v pull up resistors on the signal line and this goes to ground when the bumper is pressed. So all we need to do is check for when the pin goes low.
I designed this test circuit to simulate what is going on inside of the vacuum and uploaded the code.
By pressing the button the code randomly picks a track to be played.
Step 5: Protoboard
I used a small piece of PCB protoboard to solder everything together following this diagram.
I spliced the wired on the vacuum and solders wires for power as well.
I powered up the vacuum for a quick test.
Step 6: Finishing
Originally I tried to use the vacuum's internal speaker for this project and ended up damaging the audio circuit so I recommend using a separate speaker. I found a great place at the back of the vacuum for the speaker which after a bit of grinding with the Dremel fit nice and snug next to the vacuum's exhaust.
Using my Dremel and a series of bits I carved a hole at the side of the vacuum. This wasn't pretty but it would allow me to access the SD card and change the audio tracks easily after I put her back together. I used a glue gun and standoffs to secure the circuit board in a level position.
After putting the vacuum back up I Made a list of things I wanted it to say and used a text to speech tool that also allows me to download as an mp3. I updated the sd card after with the new audio.
son of a biscuit
kiss my ***
someone call AAA
who put this here
you got to be kidding
me piece of s***
Step 7: Done
And I must say, I wasn't disappointed.
I think a future update would be a celebrity voice pack, let me know in the comments what you would like to hear.
Participated in the
Battery Powered Contest