0

Adafruit_ccs811 getting bad HW id from two newly delivered
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_ccs811 getting bad HW id from two newly delivered

by bradshawlupton on Tue Jul 06, 2021 11:32 am

in Adafruit_ccs811.cpp I am failing to get the correct HW_ID_CODE

// check that the HW id is correct. I added the 3 print statements
if (this->read8(CCS811_HW_ID) != CCS811_HW_ID_CODE) {
Serial.println("code read, then code expected ");
Serial.println(read8(CCS811_HW_ID), HEX);
Serial.println(CCS811_HW_ID_CODE, HEX);
Serial.println("false 1");
return false;
}

THIS CODE RETURNS
ERROR
10:53:12.133 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
10:53:12.198 -> ?⸮⸮⸮⸮DJ(⸮⸮⸮⸮bradshaw CCS811 test
10:53:13.804 -> CCS811,bradshaw,begin
10:53:13.904 -> code read, then code expected
10:53:13.958 -> FF
10:53:13.958 -> 81
10:53:13.958 -> false1
10:53:13.958 -> bradshaw Failed to start sensor! Please check your wiring.
10:53:17.119 ->


I have two identical adafruid ccs811 arrived 3 days ago. I am an expert solderer. the green light comes on.

I tested the circuit with an i2cscan program and it responds happily with

10:49:06.484 ->
10:49:09.877 -> starting scanports()
10:49:09.877 -> Scanning (SDA : SCL) - d1-scl : d2-sda - orig No I2C devices found
10:49:09.989 -> Scanning (SDA : SCL) - d2-sda : d1-scl - I2C device found at address 0x5A !
10:49:10.061 -> vice found at address 0x5A !
10:44:49.681 -> **********************************



out of interest I have two keestudio 5v CCS811 running great on arduino nano, but I need your 3.3 v versions for my project. Also out of interest, I have two amd2303 to add it temp and humidity and do the correction to the CO2 and VTOC when this is running.

Everything is freshly downloaded from git hub, all the source and info are in the same folder. I confirmed the cpp and .h with Serial.println code to make sure that I was using the latest freshly downloaded code.

Thank you for your help! Bradshaw at the Sandwich Mass STEM Academy where this will become part of the check the air changes per hour STEM curriculum.

the circuit runs great with the i2cscan test program, the blink test program, but gets a bad HW id from two identical brand new Adafruit_CCS811 sensors.

IT WILL NOT OPERATE WITHOUT THE WAKE PIN GROUNDED, this is contrary to the arduino 5v wiring instructions where no ground the WAKE pin appears to be required. thanks.
Attachments
Adafrit_CCS811.jpg
my circuit
Adafrit_CCS811.jpg (47.41 KiB) Viewed 218 times

bradshawlupton
 
Posts: 13
Joined: Wed Apr 11, 2018 9:55 am

Re: Adafruit_ccs811 getting bad HW id from two newly delive

by mikeysklar on Tue Jul 06, 2021 5:41 pm

Thanks for the description and trying to upload a photo. Can you send the photo up again at 800x600? I wanted to verify you were keeping everything 3.3v with the wiring. WAKE pin needs to be grounded for sure on this model.

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit_ccs811 getting bad HW id from two newly delive

by bradshawlupton on Tue Jul 06, 2021 9:29 pm

it seems to be correcty wired, the i2cscan reports the 5A expected. so sda/scl are correct, if wake is disconnected from ground it grinds to a halt until it is reconnected. thanks for looking at this.

I stuck the debugging in the cpp to see what it was upset about it is the HW_ID which is returning FF.

I tried ignoring the error, and the next text in line fails and stops everything too.

Two CCS811 both have the identical results.

It is at 3.3v. I have 5v models running on Arduino Nano, but I need the wifi upload of the esp8266 in my STEM Curriculum project. tnx.

Thanks, Bradshaw
Attachments
800x600.jpg
800x600.jpg (159.91 KiB) Viewed 200 times

bradshawlupton
 
Posts: 13
Joined: Wed Apr 11, 2018 9:55 am

Re: Adafruit_ccs811 getting bad HW id from two newly delive

by mikeysklar on Wed Jul 07, 2021 10:49 am

I think is going to come down to an ESP8266 issue which might be resolved with clock stretching.

Code: Select all | TOGGLE FULL SIZE
Wire.setClockStretchLimit()


Does your ESP8266 come with pullup resistors on the i2c pins?

There are other CCS811 that were designed to be used with the ESP8266, eg:

https://github.com/maarten-pennings/CCS811

Note there is even a way to update the firmware of the CCS811 which is kind of obscure and interesting.

I guess the takeway from this is that the CCS811 and ESP8266 will be more challenging to get going with standard libraries and examples. If you can use another controller for the WiFi side that might be a better option. Maybe ESP32?

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit_ccs811 getting bad HW id from two newly delive

by bradshawlupton on Fri Jul 09, 2021 11:53 am

I really really want (not need) to use the wemos D1 mini. I need to use the 3.3 v Adafruit ccs811.

the Adafruit libraries include clock stretching. I added to prints to make sure it was called.

void Adafruit_CCS811::_i2c_init() {
Wire.begin();
Serial.println("check ESP8266 defined");
#ifdef ESP8266
Serial.println("ESP8266 is defined");
Wire.setClockStretchLimit(500);
#endif
}


I checked that the clock stretching was being called


It is indeed called. is there a correct stretching interval? I am up to date on all Arduino IDE and libraries.


11:33:00.647 -> H!⸮⸮LB⸮c! ⸮ ⸮bradshaw CCS811 test
11:33:05.291 -> CCS811,bradshaw,begin
11:33:05.291 -> check ESP8266 defined
11:33:05.331 -> ESP8266 is defined
11:33:05.376 -> code read, then code expected
11:33:05.424 -> FF
11:33:05.424 -> 81
11:33:05.424 -> false1
11:33:05.424 -> bradshaw Failed to start sensor! Please check your wiring.
11:33:07.181 ->
11:33:07.181 -> --------------- CUT HERE FOR EXCEPTION DECODER


rank you ao much doe your help. I SO NOT WANT TO RETURN THESE CCS811, Adafruit has never let me down. they have thrown a couple of curve balls, but I have always solved them on my own

OH, I tried 4.7k resisters to 3.3v on SDA and SCL, which made no difference. (but they are cute!)

bradshawlupton
 
Posts: 13
Joined: Wed Apr 11, 2018 9:55 am

Re: Adafruit_ccs811 getting bad HW id from two newly delive

by mikeysklar on Fri Jul 09, 2021 12:59 pm

I think the next option is to test this CCS811 with another non ESP8266 controller if you have one handy (UNO, Feather, ESP32, etc).

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit_ccs811 getting bad HW id from two newly delive

by bradshawlupton on Tue Aug 03, 2021 5:21 pm

https://github.com/maarten-pennings/CCS811/issues

solved the problem, stretched the clock. Great work by Maarten!

bradshawlupton
 
Posts: 13
Joined: Wed Apr 11, 2018 9:55 am

Re: Adafruit_ccs811 getting bad HW id from two newly delive

by mikeysklar on Tue Aug 03, 2021 6:33 pm

Thank you for confirming the maarten-pennings library worked for you. I thought that would be the best route for the ESP8266.

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.