Skip to content

A small gadget that displays your Brawl Stars stats on an OLED display.

License

Notifications You must be signed in to change notification settings

gadhagod/Brawlstats-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brawlstats Monitor

A small gadget that displays your Brawl Stars stats on an OLED display.

Demo here: https://youtu.be/ptcWn6Hha5Q

Architecture

Every two minutes, an Arduino sketch is uploaded from a Raspberry Pi that displays the Brawl Stars stats retrieved from the Brawl Stars API. It's uploaded using the Arduino CLI. The file uploaded is generated by a python script that retrieves a player's stats. It's rendered using Jinja, a python templating tool. Everytime a physical button is pressed, it displays the next piece of data (trophies, brawler count, solo, duo, and team wins, xp level). The button is detected by the Arduino.

You could do this without the Arduino, using the RPi's GPIO pins. However, my pins were broken, so I had to use an Arduino. On the bright side, it's much less work and code to get it working with the Arduino, and you don't need any Wifi shields or expensive internet-access-included boards.

Cost

With all the components of this project, it costed about $22. Materials needed:

  • Arduino Uno - $7
  • Raspberry Pi - $10
  • OLED display - $4
  • Button - under $1
  • Jumpers - under $1

I was able to make this project using random components and boards found in my desk, so nothing fancy is needed.

Hardware setup

Make the following circuit on the Arduino:

pin 12 to Button +
GND to Button -

3.3/5V to OLED VCC
GND to OLED GND
SDA to OLED SDA
SCL to OLED SCL

Plug the Arduino into the Raspberry Pi's USB port.

Software setup

Run the following in your terminal:

$ git clone https://github.com/gadhagod/Brawlstats-Monitor && cd Brawlstas-Monitor && source setup.sh

This will clone the repository, create the necessary files, and install the dependencies.

Enviroment setup

Get your Brawl Stars API token from here. Create an enviroment varable called BS_TOKEN with it's value your API key. Do the same for PLAYER_TAG, which should have your in-game player tag and $ARDUINO_PORT, which is the USB port the Arduino is connected to on the RPi. You can see which port to choose using with arduino-cli board list.

$ export BS_TOKEN='token here' PLAYER_TAG='player tag here' ARDUINO_PORT='arduino port here'

Execute

For testing, you can run main.sh using just the following command:

$ source main.sh

But for permanant running:

$ nohup source main.sh &

Contributing

If you come across any problems or have a suggestion, open an issue. If you have any code to improve this, open a pull request.

About

A small gadget that displays your Brawl Stars stats on an OLED display.

Resources

License

Stars

Watchers

Forks