---
title: "Weather Prediction Electric Cushion"
url: "https://maker.wiznet.io/Alan/projects/weather-prediction-electric-cushion/"
markdown_url: "https://maker.wiznet.io/Alan/projects/weather-prediction-electric-cushion/md"
type: "WCC: WIZnet Created Content"
author: "Alan"
author_url: "https://maker.wiznet.io/Alan/"
original_author: "Alan"
published: "2023-07-07"
language: "en"
hardware: ["Raspberry Pi Pico", "WIZnet W5100S"]
likes: 2
views: 1527
comments: 1
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Weather Prediction Electric Cushion

> Raspberry pi Pico + W5100S / Chat GPT + Web Crawling

Original author: Alan

## Components

- **Raspberry Pi Pico** x 1 ([docs](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html))
- **WIZnet W5100S** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5100S))
- Software: **Adafruit Circuitpython** ([docs](https://docs.circuitpython.org/en/latest/README.html))
- Software: **MicroPython** ([docs](http://micropython.org/))

## Article

## **Story**

My butt was always cold.What if AI always sets my butt to the right temperature.I'll be able to concentrate on my work without having to wear it on my butt.

**Hardware**

![W5100S PoE](https://hackster.imgix.net/uploads/attachments/1609147/image_Fgmg4NuMGk.png?auto=compress%2Cformat&w=740&h=555&fit=max)

W5100S PoE

The main board is the Raspberry Pi Pico. I used the [W5100S PoE board](https://www.hackster.io/alan43/wiznet-w5100s-raspberry-pi-pico-poe-c8971c) that we worked on for Ethernet communication. The PoE board can receive up to 10 W of power.

![](https://hackster.imgix.net/uploads/attachments/1609144/image_AJKAsbw8TZ.png?auto=compress%2Cformat&w=740&h=555&fit=max)

I used FET to send 10W of output to resistance. It's not a big power, so I brought a nearby FET and used it. As you can see, we also have damping resistance.

![](https://hackster.imgix.net/uploads/attachments/1609146/image_RYCP49ym18.png?auto=compress%2Cformat&w=740&h=555&fit=max)

First of all, we tested by connecting 4 20 ohm resistors in parallel.When I printed out 5W, I found that the resistance was very hot.

![](https://hackster.imgix.net/uploads/attachments/1609150/image_XKUtiZUGef.png?auto=compress%2Cformat&w=740&h=555&fit=max)

Now it's the sitting mat's turn. At first, I was going to repair the cushion and put resistance in it. But the cushion didn't give up his belly so easily.

![](https://hackster.imgix.net/uploads/attachments/1609152/image_KknwXRWlQt.png?auto=compress%2Cformat&w=740&h=555&fit=max)

Eventually, I put the resistance on the chair, and I put the cushion on it.

**Firmware**

![](https://hackster.imgix.net/uploads/attachments/1609154/image_Yn40HOcIWs.png?auto=compress%2Cformat&w=740&h=555&fit=max)

[Picasso Painting](https://www.hackster.io/alan43/wow-enjoy-the-current-weather-with-picasso-s-painting-1e01f4)

The basics are as shown in the project below.

In this project, you only need to get the expected weather information through Web Crawling.

![](https://hackster.imgix.net/uploads/attachments/1609160/image_67iJchGwIO.png?auto=compress%2Cformat&w=740&h=555&fit=max)

[Chat GPT API + Youtube Comment + Weather](https://www.hackster.io/alan43/chat-gpt-api-youtube-comment-weather-2e03bb)

The firmware was taken from the project above.

### **Web Crawling**

GPT does not currently support real-time data services. So I decided to read it on Naver as WebCrawling.It started implementing in a Python environment that is relatively light and easy to implement.

```plaintext
from bs4 import BeautifulSoup
def getweather() :
    html = requests.get('http://search.naver.com/search.naver?query=수내+날씨')
    soup = BeautifulSoup(html.text, 'html.parser')
    global weather
    weather = ''

    address = "Bundang Sunae"
    weather += address + '*'

    weather_data = soup.find('div', {'class': 'weather_info'})

    # Current Temperature
    temperature = (str(weather_data.find('div', {'class': 'temperature_text'}).text.strip()[5:])[:-1])
    weather += temperature + '*'

    # Weather Status
    weatherStatus = weather_data.find('span', {'class': 'weather before_slash'}).text

    if weatherStatus == '맑음':
        weatherPrint = 'Sunny'
    elif '흐림':
        weatherPrint = 'Cloud'

    weather += weatherPrint
```

WebCrawling can be done simply with a package called BeautifulSoup.

![](https://hackster.imgix.net/uploads/attachments/1609155/88621678977274686.png?auto=compress%2Cformat&w=740&h=555&fit=max)

&lt;Screen that appears when searching for weather in the water on the Naver site>

Let me deal with Crawling briefly.

![](https://hackster.imgix.net/uploads/attachments/1609156/4658631678977356747.png?auto=compress%2Cformat&w=740&h=555&fit=max)

In the script, temperature was read from temperature_text.

![](https://hackster.imgix.net/uploads/attachments/1609157/4317691678977361944.png?auto=compress%2Cformat&w=740&h=555&fit=max)

And weather was read in the span class of weather before_slash.

![](https://hackster.imgix.net/uploads/attachments/1609158/5503511678977398417.png?auto=compress%2Cformat&w=740&h=555&fit=max)

I want to read it in English, but I couldn't find it, so I just hardcoded it...And when you run this, it will look like the following.

![](https://hackster.imgix.net/uploads/attachments/1609159/356171678977848199.png?auto=compress%2Cformat&w=740&h=555&fit=max)

It outputs temperature and weather like this.

**Operating**

![](https://hackster.imgix.net/uploads/attachments/1609164/image_Hmm37huQeD.png?auto=compress%2Cformat&w=740&h=555&fit=max)

The temperature does not rise under very hot temperatures.

![](https://hackster.imgix.net/uploads/attachments/1609165/image_mbOHC4UupE.png?auto=compress%2Cformat&w=740&h=555&fit=max)

Moderate spring weather? The temperature goes up a little bit. Actually, I think it'll be hot if it goes up to here. I need to fix it!

![](https://hackster.imgix.net/uploads/attachments/1609171/image_QQSVEBMGOX.png?auto=compress%2Cformat&w=740&h=555&fit=max)

I set it to very cold weather. The temperature rises to 65.7 degrees. My butt will be warm!

![](https://hackster.imgix.net/uploads/attachments/1609175/image_ZtF5DeQP1B.png?auto=compress%2Cformat&w=740&h=555&fit=max)

It's getting colder... The picture explains the weather outside. It looks so cold!

![](https://hackster.imgix.net/uploads/attachments/1609176/image_ZvoIGbGpn8.png?auto=compress%2Cformat&w=740&h=555&fit=max)

There's a problem! Even if it gets colder, it should be moderately hot! If it snows a lot, my butt will burn!

### **Review**

![](https://hackster.imgix.net/uploads/attachments/1609177/image_cUDqxsztVt.png?auto=compress%2Cformat&w=740&h=555&fit=max)

I'm using it well, but our company has a heater... If it's cold outside and the office is hot, there's a problem..

For the burning butt

Thanks

---

Source: https://maker.wiznet.io/Alan/projects/weather-prediction-electric-cushion/
