The next step is to add to the test code, the code to read the MQ135 that already had the week 13 input device.
In addition to reading the CO2 sensor I want the leds that I have implemented in my microcontroller to light showing that the air inside our homes is healthy or harmful to our health, so if you turn on the LEDs means:
Blue LED - means CO2 is less than 800ppm and it is good for health
Yellow LED - means CO2 is less than 800ppm and greater than 1200ppm and you have to be careful about health
Red LED - means CO2 is greater than 1200ppm and is harmful to health
The final code I sent was:
The code is correct. But I came across a problem! Again the processing memory of attiny44 was not enough to run a code that included the bluetooth, 3 leds, and the analog sensor reading.
For this reason I was forced to reduce the code, and I decided to make the calculations to calculate the ppm sent by the co2 sensor directly in the APP INVENTOR, thus reducing the required code processing to attiny44.
And it worked!
I wanted to make a graph in APP to present the data of the CO2 gas sensor.
I followed one more tutorial that I found that explains how to make a graphic:
MITappInventor- Make a Graph
App inventor on the phone
To connect the app with your phone you need to install an application on the mobile phone.
See how it is done here:
MITappInventor - Connect your Phone or Tablet over WiFi
Or download here!
It is necessary to have bluetooth in your mobile phone and to pair it with the bluetooth to which the microcontroller is connected, through the menu to connect the bluetooth that we created in the APP. See next figure.
The final aspect of my application looks like this: see figure on the side.
The video below shows the connection of my microcontroller, with the sensor and the bluettoh, and the LEDs to be connected according to the value shown in the application chart.
Our halite contains a large percentage of co2 so when blowing into the sensor, the values increase.