This project is an interactive art installation that combines IoT sensors, real-time data streaming, generative visualizations, and AI-driven feedback.
Environmental parameters such as light, temperature, humidity, and motion are captured by an ESP32 microcontroller and transformed into both visual art (pygame) and data dashboards (Grafana + InfluxDB).
User feedback is collected via a Telegram bot, and an AI model learns which sensor values are most appreciated, tuning the art generation accordingly.
-
ESP32 with Sensors
- PIR (motion) sensor
- DHT11 (temperature + humidity) sensor
- LDR (light sensor)
Publishes sensor data to MQTT topics.
-
MQTT Broker (Mosquitto)
Acts as the communication backbone between ESP32, the data proxy, and the art engine. -
Data Proxy (Python)
Subscribes to MQTT topics, unifies sensor and motion data, and pushes into InfluxDB. -
InfluxDB
Time-series database storing all sensor values and ratings. -
Grafana
Dashboard for real-time visualization and historical data analysis. -
Generative Art Engine (Python + Pygame)
Subscribes to MQTT and generates evolving visual patterns in real-time, optionally tuned by AI. -
Telegram Bot
Allows users to rate the current visual and sends ratings to the backend. -
Visual Rating API (Python + Flask)
Provides endpoints for fetching the latest visual and storing ratings in InfluxDB. -
AI Model Training Workflow (Python, scikit-learn)
Extracts sensor-rating pairs from InfluxDB, trains a model to predict ratings, and saves the model for use in art generation.
Follow these steps to run the entire project:
sudo apt update
sudo apt install -y mosquitto mosquitto-clients
mosquitto -vOpen a new terminal:
mosquitto_sub -t "smartart/sensor"Publish a test message from another terminal:
mosquitto_pub -t "smartart/sensor" -m '{"light":300,"temperature":22,"humidity":50}'- Upload the ESP32 sketch from Arduino IDE or
arduino-cli. - Adjust your IP in the arduino script, it can be seen with the command
ip addr - Connect to the ESP32 WiFi,
SmartWallArt_Config - Open your browser at http://192.168.4.1
- Press Configure WiFi
- Chose the network on wich you want the ESP32 to operate
- Connect your PC on thesame network
This sends sensor readings to MQTT topics:
smartart/sensorsmartart/motion
To check status and messages from the ESP32:
- Open Arduino IDE
- Open Serial Monitor
- Set baud to
115200
sudo apt install -y influxdb
influxdinfluxInside the shell:
CREATE DATABASE smartart;
USE smartart;pip install -r requirements.txtpython3 data_proxy/data_proxy.pypython3 data_proxy/visual_rating_api.pySet your bot token and API URL:
export BOT_TOKEN=your_telegram_bot_token
export VISUAL_API_URL=http://localhost:5050
python3 telegram/tg_bot.pypython3 ai_rating_model/train_rating_model.pycd actuator
python3 static_art_generator.pypython3 forecasting/forecast_data.pyThis will forecast sensor values (temperature, humidity, light) using ARIMA and plot the results.
sudo apt install -y grafana
sudo systemctl start grafana-server
sudo systemctl enable grafana-serverOpen in browser: http://localhost:3000
(default login: admin / admin)
Configure InfluxDB as data source → smartart database.
This project is a fusion of IoT, generative art, and AI feedback.
While sensors measure environmental conditions in real-time, the data is both stored for analysis and transformed into evolving visuals that respond dynamically to human presence and the environment.
User ratings are collected via Telegram, and an AI model learns which sensor values are most appreciated, tuning the art generation to maximize engagement and aesthetic value.
- Ratings are linked to the sensor data that generated each visual.
- The AI model is trained to predict ratings from sensor values.
- The art engine can use the model to bias or blend sensor data toward more appreciated values, while remaining responsive to the environment.
actuator/— Art generation scripts (static and dynamic)ai_rating_model/— AI model training and savingdata_proxy/— Data proxy, rating APIesp32/— ESP32 microcontroller codeforecasting/— Sensor data forecasting scriptstelegram/— Telegram bot for ratingsrequirements.txt— Python dependenciesReport.pdf— Complete project report, refer to this for further insights and explanations.