Close
0%
0%

TARS GPT - a Hilarious AI Weather Reporter

TARS is a witty, AI-powered weather reporter with a humorous twist, updating hourly with unique, sarcastic weather forecasts for your desk!

Similar projects worth following
Meet TARS. The most humorous AI weather reporter you'll ever encounter. If you're not familiar, TARS is the highly advanced, AI-driven robot from the movie Interstellar. He's known for his witty sense of humor and great loyalty to the human characters, particularly Cooper and the crew.

To celebrate the movie's re-release in India for its 10th anniversary, I made this miniature version of TARS with that same hilarious sense of humor.
This mini-TARS is actually a weather reporter. Well, sort of. He has an OLED display on the front where he reports the current weather in his own unique way. For example, if it's scorching hot, he might say something like his circuits are frying, and if it's too cold, he might complain that his software will freeze any minute. It's all unique because he's powered by Gemini AI.


The concept is straightforward. First, we grab the weather information for our current location using the OpenWeatherMap API. Then, we send that weather data over to the Gemini API with a simple prompt, asking Gemini to summarize the weather with a bit of humor.

Once Gemini replies, we display the result on an OLED screen. And the whole thing is powered by an inexpensive ESP8266 board, called Wemos D1 Mini.

TARS Print.pdf

Print on A3 paper

Adobe Portable Document Format - 463.24 kB - 01/28/2025 at 04:38

Preview

TARS_main.ino

Main code

ino - 5.15 kB - 01/28/2025 at 04:38

Download

  • 1 × Wemos D1 mini
  • 1 × 0.96 inch oled display

  • 1
    Working with Gemini

    I first signed up on Google AI studio and got an API key. Then, I went through the documentation and wrote a simple python script to check how the API works.

    I asked Gemini for the weather for my current location. The answer tells us two things. Firstly, the output is in JSON format, and we need to extract the text from this section (see below image). Secondly, Gemini does not have access to real time information, we cannot ask it the weather. If it could, it would save us some coding effort.


    Anyway, to solve this issue, we fetch the weather from a different API called Openweathermap. I have explained how to set it up in a previous Project. Once we have the weather, we extract the temperature, humidity, and condition and send this over to Gemini.

  • 2
    Prompt engineering

    After cleaning things up a bit, I was getting some pretty good results.

    But, we still have a few kinks to work out. First off, the answer is way too long to fit on our little OLED display. Secondly, Gemini's adding some extra sentences at the beginning that we don't really need. We just want that humorous sentence. And third, it doesn't quite sound like something TARS would say.

    So, to fix this, let's go on a little side quest and do some prompt engineering. Basically, we need to be a bit more specific with Gemini about what we're looking for.

    First, let's tell it to keep the answer between 50 and 60 characters. That'll be the perfect length to fit on our OLED display. Next, we'll instruct it to imagine it's a humorous AI and describe how the weather feels. Finally, we'll tell it to reply only with the humorous sentence and nothing else.

    Here's how the prompt looks like: "You're a humorous AI robot. Describe this weather in a hilarious way. Your answer should be between 50 and 60 characters. Respond with only the humorous sentence and nothing else: {weather_data}"

    As you see in the image below, now we have a perfect response!
  • 3
    Making the body

    So, to make TARS's body, I found an awesome template on Reddit. I simply downloaded it, scaled it up just enough to fit a standard 0.96-inch OLED display, and printed it out on some nice, glossy poster paper. You can find the template PDF attached below. Make sure to print it on A3 size paper.

    Next, I carefully cut out the different sections from the template and also cut a rectangular hole where the OLED display is going to sit.


    Then, using a screwdriver, I scored along the edges to make it easier to fold, and carefully folded the paper along those lines.


View all 9 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates