Robot Vacuum That Feels Pain! ( Attiny85 + DFplayer Mini )

by justbarran in Circuits > Robots

5654 Views, 29 Favorites, 0 Comments

Robot Vacuum That Feels Pain! ( Attiny85 + DFplayer Mini )

033 Robot Vacuum with a dirty mouth (1).png

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:

Supplies

Extra:

Tools:

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.

Testing DF Player Mini

2020-11-24 23_27_18-Window.png
Untitled 1_1.26.1.png

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.

https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299

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.

DF Player Mini With Arduino

2020-11-25 17_27_29-RobotVacuum.fzz_ - Fritzing - [Breadboard View].png

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.

https://github.com/DFRobot/DFRobotDFPlayerMini

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.

Inside the Robot Vacuum

WhatsApp Image 2020-11-28 at 11.34.10 PM (1).jpeg
Photo 21-11-2020, 7 29 12 PM.jpg
Photo 21-11-2020, 6 50 29 PM.jpg
Photo 21-11-2020, 7 29 15 PM.jpg

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.

Digispark Attiny85

2020-11-27 00_52_06-RobotVacuum.fzz_ - Fritzing - [Breadboard View].png
WhatsApp Image 2020-11-28 at 11.37.45 PM.jpeg

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.

Protoboard

2020-11-27 00_58_43-RobotVacuum.fzz_ - Fritzing - [Breadboard View].png
Untitled_1.84.2.png
Untitled_1.84.1.png

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.

Finishing

Untitled_1.92.1.png
Untitled_1.94.1.png
Untitled_1.95.1.png

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.

https://soundoftext.com/

  • son of a biscuit

  • dammit

  • help

  • meh

  • kiss my ***

  • oh dear

  • ouch

  • s*** man

  • shoot

  • someone call AAA

  • who put this here

  • you got to be kidding

  • me piece of s***

  • oh jeesers

  • OMG

  • Darn it

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.