This project is simply made to demonstrate the functionality of the Arduino Uno with the Python language. The project controls the Spotify app using just 3 buttons that are wired to the Arduino Uno Rev3. The Arduino communicates a few keywords (i.e. pause, forward, and back) to the Python script through the COM3 port and uses PyAutoGui's functions to pause/play track, play the previous track, and play the next track. It also has a 1602 LCD hooked up to the Arduino board to let the user know about the pause, forward, and back commands along with the song that is playing. To get a detailed view of my project, visit my GitHub @akkik04 or click here for the repository.
Click here to view a video of the project in action.
- PyAutoGUI's Documentation: I used this documentation to become familiar with the functions that the PyAutoGUI module has to offer. The PyAutoGUI module plays a crucial role in my Python script because after the signal is sent from the Arduino to the Python script, we use the functions from the PyAutoGUI module to automate interactions with the Spotify app based on the type of signal. To view the PyAutoGUI module's documentation click PyAutoGUI documentation.
- pySerial's Documentation: I used this documentation to find out how I can receive access to the serial port. The pySerial module plays a very important role in my Python script because it does the central function of receiving the signal from the buttons wired to the Arduino Uno. For this project, the communication is done through the COM3 port. To view the pySerial module's documentation click pySerial documentation.
- SwSpotify's Documentation: I used this documentation to learn more about the functions that the SwSpotify module has to offer. This module is an add-on to my project because it gets the song and artist of the currently playing music from the Spotify application without using the actual API. After getting the current tune from the module's functions, the data is communicated to the Arduino Uno through the COM3 port and outputted through the 1602 LCD. To view the SwSpotify module's documentation click SwSpotify documentation.
Arduino Script's Function: This is a part of the software for the project written in C++. This part of the software receives the crucial input from the buttons wired to the Arduino Uno. Based on the input received from the buttons, it prints a keyword onto the serial monitor which is communicated to the Python script through the COM3 port. This part of the script can now receive the song name from the python script and output it through the 1602 LCD. Click here to view the Arduino Script.
Python Script's Function: This is a part of the software for the project written in Python. This part of the software receives the keyword signals sent from the Arduino/C++ script through the COM3 port, and uses the PyAutoGUI module to automate the functions onto the Spotify app (i.e. previous track, pause track, next track). I updated this script to include a module for song detection called SwSpotify. The script can now send the song name to the Arduino through the COM3 port for display through the 1602 LCD. Click here to view the Python Script.
LCD Connections:- VSS pin to GND or '-' row of breadboard.
- VDD pin to 5V or '+' row of breadboard.
- V0 pin to GND or '-' row of breadboard.
- RS pin to Digital Pin #13.
- RW pin to GND or '-' row of breadboard.
- E pin to Digital Pin #8.
- D4 pin to Digital Pin #9.
- D5 pin to Digital Pin #10.
- D6 pin to Digital Pin #11.
- D7 pin to Digital Pin #12.
- A pin to 5V or '+' row of breadboard.
- K pin to GND or '-' row of breadboard.
- The general connections are simple connections to the '+' and '-' rows of the breadboard, button connections with resistors attached, and the main Arduino connection to your laptop. If you want to become familiarized with the general connections of an Arduino Uno R3 board, I recommend viewing this Arduino tutorial.
Comments
Please log in or sign up to comment.