Panel Cookies
Digital Magic 8 Ball

Help me by sharing this post


PREVIOUS PART       NEXT TUTORIAL

Next part is to connect the DFplayer. But first make sure you download the mp3 files form the previous part and copy those to the SD card. Then insert the SD card into the DFplayer. Solder the speaker to the player and wires for 5V, GND, TX and RX to the DFplayer. Remember to add those 1K resistors for Tx and Rx pins. Then you can glue the speaker on the top part of the ball, just on top of the IMU module. And the DFplayer with the PCB on the side of that. Now we have to merge both parts.

Arduino 3D printed magic ball DIY



Make all the connections to the Arduino. Then go below and download the code and uplaod it to the Arduino. Then you can glue the Arduino inside the case as well. Now we can close the case but give it a tes one more time. If it works, add some glue to both parts and join the parts together. make sure the 8 shape on top os paralel with the OLED screen below, otherwise that would be strange... Is time to paint the ball.


Arduino 3D printed magic ball DIY

Add tape on all the parts can't be painted. Then I use some matte black spray paint and cover the entire ball. Let it a few hours for the paint to dry. Then remove the tape and we have our magic 8 ball. Use a black permanent sharpy to correct small errors.


Arduino digital magic ball with sounds

Go to the next part and downlaod the code. Uplaod it to the Arduino. See the example video below. I hope you like it. That's pretty much all with this tutorial. If you wnat any other detail, leave a comment on our forum.








PART 4 - Code

Ok, the code is not that difficult. Download it from the link below. You will also need the library for the OLED screen adn the DF player. So downlaod that from the links below as well and install them to the Arduino IDE. We read the angle adn if is around 180 degrees we send a random answer and audio. If we get back to around 360 degrees we reset the code and wait for a new question. Download the code from below.


if(the_answer == 4)
  {
    play_sounds(6); 
    display.setCursor(0,90-a);
    display.println("  AS I");
    display.println(" SEE IT");
    display.println("  YES!"); 
  }  


Help me by sharing this post












yt_link
insta_link
fb_link
twitter_link

Magic 8 ball
page 2/2



ADVERTISERS



PCBWAY PCB service





Curso Arduino Online nivel bajo