TTS Weather Broadcast
I usually decide whether to bring anumbrella based on the weather conditions before going out. I used to make wrong decisions because the weather was changeable in the past two weeks,it was sunny when I went out that I didn’t bring an umbrella, and unfortunately it rained when came I back. I have a mind that making a player to broadcast the weather forecast when I go out.
Supplies
Hardware:
- MakePython ESP32
you can get it from this link:
https://www.makerfabs.com/makepython-esp32.html
- MakePython Audio
you can get it from this link:
https://www.makerfabs.com/makepython-audio.html
- USB cable
- PIR Motion Sensor Module
https://www.makerfabs.com/pir-motion-sensor-module.html
- Audio
Software:
- Arduino IDE
Connection
connect two boards according to the pins. Power the board with USB cable. the sensor pin connections:
GND --- GND VCC --- 5V OUT --- Pin 15
The sensor module has two adjustment buttons, one is to adjusting the delay before firing, the other is adjusting the sensitivity, which needs to be adjusted before use.
Programming Environment
- ESP32 Support
Follow the Installation Instructions to add ESP32 support if you are not yet do it:
https://github.com/espressif/arduino-esp32
- Install library
- Adafruit SSD1306 and dependent libraries.
- ArduinoJson libraries
- Install zip library : ESP32-audioI2S ("Audio.h")
Code
You can get the code from here:
https://github.com/Makerfabs/Project_TTS-Weather-Broadcast
(Please use the code of gray branch)
- Setting the WIFI password
//WIFI const char *ssid = "************"; const char *password = "************";
- Getting the weather API
String weather_request()<br>
You can look for a fee or free API interface on Google, that limits individual users with a number of free API interface most of time.
- Showing weather
void lcd_weather(String cond_txt, String tmp, String hum, String wind_dir)
- Setting the weather icon
void draw_weather(int a)
- Weather broadcast
audio.connecttospeech(text, "en")<br>
Case
- Materials: cardboard (packing box), cutter, pencil
- Fold the cardboard into a suitable size carton, Draw the outline on the cardboard and cut it.
- Put the assembled board into the carton and fix it with tape or filling sponge.
- Decorate carton: Draw and write on the surface of the carton.
- Please place the player where you will pass before going out to ensure that the sensor can sense.