Inspiration
We decided to enter the Grafana Challenge because it seemed cooler than other challenges, and we were willing to learn electronic stuff.
What it does
The ESP32 board provided by the Grafana people, reads the analog value of a photoresistor. Afterwards, these values are sent to a computer using the serial port. Using a python script, we are able to read those values, and make a post request to the Grafana server with the sensor data. Once the Grafana server has received the data, we can display graphs representing that data.
How we built it
After reading the board datasheet, we set up the wires, the DOIT ESP32 DEVKIT V1 and the sensors. We first try each sensor alone to check its reliability. We struggled with the sensors, and after asking for help, we encounter that the DOIT pin scheme was wrongly labelled. Moreover, we encounter that the photoresistors pins were also incorrect. After reading the photoresistor data we noticed that the sensor was very sensible, but was good enough to work with it.
Next, we send the data to the server using the wifi module of the board. Again, we encounter problems such that the HackUpc wifi has certain configuration disable, so we could not establish a reliable connection. Even after connecting to a hotspot network, we could not establish a channel between the board and the server. In order to fix it we decided to send the data using a laptop, we made a python script that reads the sensor data through the serial port and makes post requests to the Grafana servers.
In Grafana Cloud we created a dashboard to visualize the photoresistor data during a period of time.
Challenges we ran into
Basically there were 3 major challenges:
- The board we were using had a different pin order, so we were trying to get the power from a data pin (the documentation we were looking at had the wrong pin scheme).
- The photoresistor pins were wrongly labeled. The data and ground pins were switched, spending a huge amount of time dealing with it.
- The WiFi module on the board was not working properly. Our first idea was to send the data directly from the board. As the WiFi module malfunctioned, we had to change our code. Now it's the computer, the one who posts the information to the Grafana server.
Accomplishments that we're proud of
We are really proud to annouce that we could make all this working. There were many times during the development period that we tought we wouldn't be able to accomplish it.
What we learned
The moral of the hackathon is to use quality electronic components. We spend the majority of the hackathon dealing with malfunctioned components.
What's next for Reading photoresistor data using Grafana Dashboard
In the future, we might add more sensors, like the sound receiver or the humidity/temperature sensor. With all that data we can compute various metrics that will help us evaluate the hackrooms environment.
Log in or sign up for Devpost to join the conversation.