SzymonZieba
New member
Hi all,
I have been working with the Teensy 3.2 for around a week now and have come into a rather unusual problem.
My Setup is as follows:
There are some additional items connected to the Teensy, however half are turned off by the time the program attempts to read the Grove, and the other half are analog sensors drawing very little current.
Key part of the code is here:
When I have a usb plugged into the Teensy's usb port, the I2C communication with the Gas Sensor works fine, having no issues getting a response. However, when I disconnect the usb, the I2C stops working. Watching on an oscilloscope we have seen two different events, one where a message was sent along the SDA line, but no response was made and one where no message was sent period. We have no idea what is going on. We are using the Multichannel Gas Sensor library practically as is, commenting out any Serial prints.
Does anyone have a suggestion on what may be going wrong?
I have been working with the Teensy 3.2 for around a week now and have come into a rather unusual problem.
My Setup is as follows:
- Teensy 3.2 with Vin/Vusb pads cut
- Grove Multichannel Gas Sensor connected to pins 18 & 19 as appropriate
- LiPo Battery
- 3.3V Buck Boost Regulator
- 4.7kohm Resistors for pull-up
There are some additional items connected to the Teensy, however half are turned off by the time the program attempts to read the Grove, and the other half are analog sensors drawing very little current.
Key part of the code is here:
gas.powerOn() and gas.begin are used in setup and loop functions.void readGrove() {
//Declare Variable
fTob c;
int timeout = 0;
delay(100);
c.f = gas.measure_CO();
//while(c.f < 0) {
//timeout++;
c.f = gas.measure_CO();
//if (timeout > 20) {
//break;
//}
//}
//Serial.println(c.f);
message[6] = c.bin[3];
message[7] = c.bin[2];
delay(100);
c.f = gas.measure_NO2();
uint8_t t = c.f*100;
message[8] = t;
gas.powerOff();
}
When I have a usb plugged into the Teensy's usb port, the I2C communication with the Gas Sensor works fine, having no issues getting a response. However, when I disconnect the usb, the I2C stops working. Watching on an oscilloscope we have seen two different events, one where a message was sent along the SDA line, but no response was made and one where no message was sent period. We have no idea what is going on. We are using the Multichannel Gas Sensor library practically as is, commenting out any Serial prints.
Does anyone have a suggestion on what may be going wrong?