Once in a very long while, a project comes along that combines art and technology in a way that comes together exactly perfectly, innocently, beautifully.
It inspires people around the world, frees us from our worries, cures what ails us, reduces our carbon footprint and frees up hard drive storage space.
This is not that kind of project.
Instead, I admit this project may become a bad influence on young impressionable individuals. You've been warned.
Of course, it's entirely possible that you've already viewed the other videos before reading this warning. Serves you right. There's a reason this blog post was written in this exact order. It was to save your innocent eyes. But oooh noooo, you HAD to read and view it out of order. Let this be a lesson to you.
So now, without further delay, I introduce to you:
Fartybot! The tricksy friendly naughty farty robot!
We all have one in our family, or at least in our circle of friends (and if you don't, it's probably you!) - that dirty tricky uncle who asks us politely to "pull my finger", and then you know what happens next if you fall for that trick!
So, with the help of my dear artsy wife SuperArtGirl, we have immortalized this concept into... a robot!
Look at how happy he is - you can totally see how his eyes light up!
By now you probably already see the problem.
This is what happens when technology is used for all the wrong reasons.
I'm not sure if I should reveal how this was all put together, lest I be even more of a bad influence to the world.
But I fear it may already be too late, so I may as well continue. As they say in the old country... what's a fart after you have already sh*t yourself?
The concept of course revolves around a beautiful piece of robot art my wife created. And I turned it into something... else.
Honestly though, she may look innocent but she's just as much to blame for all this
SuperArtGirl took a little wooden dollar store trinket box and made this beautiful and innocent looking robot, using random parts and her excellent artistic skills.
Isn't he cute? And so innocent looking?
His head is made up of an old pocket binoculars, the feet are gears adorned with some aluminum foil and wire to make shoelaces.
She made custom hands with sculpting clay, which allowed her to embed a little pushbutton switch into the finger. Told you she wasn't completely without guilt in all this
Did you notice the wording on that gauge?
Now for the techy parts...
At the heart of the robot we have a standard Arduino Uno. It controls a little soundboard (DY-SV5W) that plays sounds from an SD card.
I attached an old speaker to the robot's... ahem... back side.
At startup this little robot introduces himself.
The eyes are little LEDs that I soldered up to some stiff wire and tucked inside of the binoculars. They light up whenever Fartybot speaks.
On his left shoulder we put an SR505 PIR sensor, which triggers a random "pull my finger" sound clip.
I haven't found these PIR sensors to be super reliable, but maybe I just got a bad set or maybe I am missing something in the way I hooked it up. For this project it works well enough, as it does seem to detect motion often enough, and once in a while it just randomly blurts things out.
And, of course, there is a switch in the finger which plays a random fart sound clip.
The heart is spring loaded. His intentions are good.
Here is a more detailed tour, provided by your tour guide, SuperArtGirl:
Getting ready to assemble all the techy pieces into the robot's chest:
Here's a closeup of how the parts were placed into the robot's chest:
The soundboard is quite interesting in how it works. You simply have to provide 5v power, and then touch the contacts to make it play a sound file from the SD card.
The sounds on the SD card are numbered 00001.mp3 and counting up to, in my case, 00009.mp3. By connecting a pin to ground, it will play the associated sound from the file. This little board also directly powers the speaker with no extra hardware required!
This is a picture of some early sound testing:
I ran into problems when I tried to have the Arduino control the sound board though - it seems to need more than just the draw an Arduino pin can handle in order to produce a nice sound. Directly connecting an Arduino pin to the soundboard pin made for very scratchy terrible sounds. I solved this issue by using some transistors in between - I soldered those directly onto the little soundboard to keep things compact.
The red block with white microswitches is to set the soundboard mode. I set it to the mode that allows me to provide a binary number type of input to the board, so I could get away with just 4 transistors instead of needing 8 - one for each pin.
Using the 4 transistor controlled connections allows for 16 sounds - more than enough for this project.
I added an introductory sound, a few "pull my finger" sounds, and a handful of fart sounds. Having multiple sound effects makes it a bit more random and interesting.
I created the "pull my finger" sound effects by having a computer generated voice read some text. The fart sounds were from a free opensource sound effect website.
Here is the Arduino source code:
/* * FartyBot * * Uses DY-SV5W sound board * * Binary setup uses Operating Mode "I/O Integrated Mode 0" * Set red microswitch block = 0-0-0 * * This interprets the pins by converting from binary to select a sound file. * * Binary selection pins are: D12, D11, D10, D9 * This gives access to 15 sounds (4 bits = 16 combinations, but all 0's is off) * This can be expanded by using all 8 pins to get 255 sounds, but I wanted to keep the circuit small. * * All sound pins on the board are active LOW => temporary touch to ground to start a sound. * BUT, from Arduino we need to use a transistor to avoid scratchy audio, which flips the signal to being active HIGH * I'm using an NPN transistor commonly seen in Arduino examples: PN2222a * * Operation: * * At startup, plays introduction sound * When button pressed, plays random fart sound * When motion detected, plays random pull-finger sound * * Motion detection should wait 10 seconds before resetting. * */ #define SOUND_OFF LOW #define SOUND_ON HIGH #define BUTTON 4 #define MOTION_SENSOR 3 #define EYES_LIGHTS 13 // Map sound board IO pins to Arduino digital pins #define IO0 12 #define IO1 11 #define IO2 10 #define IO3 9 #define SOUND_PINS_COUNT 4 int SOUND_PINS[SOUND_PINS_COUNT] = {IO0, IO1, IO2, IO3}; // define the sounds by their sound number #define ALL_SOUNDS_COUNT 9 int ALL_SOUNDS[ALL_SOUNDS_COUNT] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; // , 10, 11, 12, 13, 14, 15}; #define INTRO_SOUND 9 #define PULLFINGER_SOUNDS_COUNT 3 int PULLFINGER_SOUNDS[PULLFINGER_SOUNDS_COUNT] = {6, 7, 8}; #define FART_SOUNDS_COUNT 5 int FART_SOUNDS[FART_SOUNDS_COUNT] = {1, 2, 3, 4, 5}; int prevMotionRead = HIGH; void setup() { pinMode(BUTTON, INPUT_PULLUP); pinMode(MOTION_SENSOR, INPUT); digitalWrite(MOTION_SENSOR, LOW); pinMode(EYES_LIGHTS, OUTPUT); randomSeed(analogRead(0)); // uses random noise on A0 to help the random() function be more truly random // set up the sounds pins for output for (int i=0; i < SOUND_PINS_COUNT; i++) { pinMode(SOUND_PINS[i], OUTPUT); } // turn off all the sound pins turnOffAllSounds(); delay(500); eyesOn(); playIntroSound(); eyesOff(); } void loop() { int buttonRead = digitalRead(BUTTON); if (buttonRead == LOW) { playFartSound(); //playAllSounds(); } int motionRead = digitalRead(MOTION_SENSOR); if (motionRead != prevMotionRead) { prevMotionRead = motionRead; if (motionRead == HIGH) { eyesOn(); playPullFingerSound(); } else { eyesOff(); } } delay(200); } void eyesOn() { digitalWrite(EYES_LIGHTS, HIGH); } void eyesOff() { digitalWrite(EYES_LIGHTS, LOW); } void playIntroSound() { eyesOn(); playSoundNumber(INTRO_SOUND); delay(3000); eyesOff(); } void playPullFingerSound() { eyesOn(); playSoundNumber(PULLFINGER_SOUNDS[random(PULLFINGER_SOUNDS_COUNT)]); delay(3000); eyesOff(); } void playFartSound() { eyesOn(); playSoundNumber(FART_SOUNDS[random(FART_SOUNDS_COUNT)]); delay(1000); eyesOff(); } void playAllSounds() { for (int i=0; i < ALL_SOUNDS_COUNT; i++) { playSoundNumber(ALL_SOUNDS[i]); delay(2500); } } void playSoundNumber(int soundNumber) { outputBinarySound(soundNumber); delay(300); turnOffAllSounds(); } void outputBinarySound(int soundNumber) { for (int i=0; i<SOUND_PINS_COUNT; i++) { if (soundNumber%2) digitalWrite(SOUND_PINS[i], SOUND_ON); else digitalWrite(SOUND_PINS[i], SOUND_OFF); soundNumber/=2; } } void turnOffAllSounds() { for (int i=0; i < SOUND_PINS_COUNT; i++) { digitalWrite(SOUND_PINS[i], SOUND_OFF); } }
This really was a fun project to work on!
What made it even more enjoyable is that it was a team effort with my wife, who is always able to make these projects come to life so much better
Take care, be kind, and stay safe!
-Nico
Top Comments