Higher concentrations of CO2 inside will make you sleepy and have an impact on your wellbeing. During the current pandemic higher CO2 concentrations inside are also a pretty good indication for higher levels of aerosol and as such a higher risk for infection. The 'CO2 Ampel' (CO2 traffic light) will give you a visual representation of the current situation and remind you to open windows to keep you happy and healthy.
You can always get help by contacting us. The fastet way is probably our maxtrix chat channel, but you can always use our mailing list or any other contact methods found at [https://www.un-hack-bar.de/kontakt/] (https://www.un-hack-bar.de/kontakt/).
## Parts list
Have a list of all the parts necessary. We added an aliexpress link for convenience, but feel free to use other sources. The prices will vary among shops and we don't update the links.
* compile the firmware with ```esphome co2sensor.yaml run```
* You may have to hold the boot button on your esp32, until fw upload starts.
### Option 2: Custom firmware written in C++ with platform.io
* Clone the git repository [https://git.unhb.de/smash/ebk-unhb-co2ampel](https://git.unhb.de/smash/ebk-unhb-co2ampel)
* Use platform.io to compile / flash the firmware to the ESP32.
## Setup
* The sensor needs to be calibrated to measure acurately. This will happen automatically if the sensor is acrive at least 24 hours. The lowest measurement in this time will serve as a baseline of 400 ppm. It is advised to keep the sensor on power for at least 24 hours, at least once a month.
* Place the sensor in your room, keep it away from direct exposure of breath (give it at least 1-2m distance to humans or other co2 sources to get the average co2 level of the room)
* When there is a freifunk wifi around there is nothing to do for you, same when you defined your own wifi via secrets.yaml.
* Else just wait a bit and the sensor will spawn an wifi without a password. connect with your phone and choose to login or open http://192.168.4.1 in a browser to enter your wifi credentials
* When everything is done, the default config will send the sensor readings back to the project where you can view online graphs (see grafana)
there is a quick setup on [here](http://co2.cyber23.de:3000/d/1axlpIdGk/co2?orgId=1&refresh=10s&var-co2name=smash_wohnzimmer&from=now-2d&to=now) your sensor should apper in the list on the left as soon it is connected via wifi.
If your ws2812 don't work on 3.3V power (most will do) you can try to use 5V instead. There are plenty different ws2812 builds so ymmv... if the leds don't work with 5V try to add a pullup resistor to your data line and a diode towards D4 to raise your high level while protecting your GPIO (https://forum.arduino.cc/index.php?topic=578735.msg3941756#msg3941756)
either way it might be a good idea to have a capacitor between VCC and GND. my prototype worked without any of these, but from time to time some LEDs just randomly turn on and the lights flicker slightly when the sensor takes a measurement.