andvolodko / digispark_oled_128x32_mh-z19b

Arduino CO2 sensor
7 stars 2 forks source link

If it is even possible #1

Closed KrasiSoft closed 4 years ago

KrasiSoft commented 4 years ago

ATTiny85 has only 6 I/O and with LCD and this sensor 4 are gone already....Do You think is possible to use the same 2 wires for the LCD[SDA and SCL]. Should be possible: You disable I2C to the LCD and read The sensor, and then the opposite operation-You use only one of the protocols on the time. This will be great improvement to the project - imagine only with 2 I/O you could control the LCD and the sensor and you will have 4 more I/O free. Will improve my project too..... Thank You!

andvolodko commented 4 years ago

Hello KrasiSoft. I2C support multiple devices. CO2 sensor uses a different protocol - UART. I think it is possible to use only one wire for PWM on a sensor and save one additional wire

KrasiSoft commented 4 years ago

Hi! I am completely aware that there are 2 different communication protocols. Read carefully what i said... Any way...I did it halfway and continue....so far i succeed to read the CO2(MH-Z19B) sensor, the temperature/humidity sensor(AM2320), the RealTimeClockRTC3231 and displaying everything on the same display(SSD1306) using ONLY 3 I/O from ATTiny85[1 for SDA 1 for SCL and 1 for Tx/Rx for the CO2 sensor], but a want to squeeze the ATTiny on the maximum. I'm trying to use the SCL-line as Tx/Rx on the same time....

andvolodko commented 4 years ago

I am not so experienced in that, but I think this is possible. Maybe some shift registers chips can help. Or even without additional soldering only by software, but maybe with the help of a raw AVR coding without Arduino libraries.

KrasiSoft commented 4 years ago

OK! Thank You!