Go Down

Topic: Grove - Multichannel Gas Sensor + mkr wan 1300 or mkr wifi 1010 (Read 347 times) previous topic - next topic

ivars_p

Hey everyone! I have this problem that with the mkr arduinos and multichanel gas sensor - When i upload the grove library example for this sensor, the serial monitor shows nothing at all...I dont know whats the deal with that...:/ can anyone help?

I am using:

1)library - https://github.com/Seeed-Studio/Mutichannel_Gas_Sensor

2)arduino - 1)https://store.arduino.cc/mkr-wan-1300;
                 2)https://store.arduino.cc/arduino-mkr-wifi-1010

3)sensor - http://wiki.seeedstudio.com/Grove-Multichannel_Gas_Sensor/

4)sketch - ReadSensorValue_Grove - from the library

5)pins - scl -> scl
            sda - >sda
            vcc -> vcc(~3.3)
            gnd -> gnd

*Scanning for addresses works and I have found the right address 0x10;
*The sensor works ok with other boards like nodeMcu and Arduino uno on 3.3v and 5v, I can change the sensors address but it doesnt change anything...




pylon

Quote
*Scanning for addresses works and I have found the right address 0x10;
According to the library examples, the default address is 0x04. So why do you think everything is OK if you get 0x10?

Have you change the Serial object to USBSerial in the example code (as I guess you connected your PC by the internal USB connection and not using an USB2Serial adapter on the hardware serial interface)?

ivars_p

Yea I have changed the address to 0x10...so that should be ok, even when I put it back to 0x04 it doesnt work... ahmm...

Yes the arduino is connected through the main usb port on the device... Can you please give me an example what should I change in the code...as I understand I have to replace Serial - with - USBSerial, but it doesnt recognize USBSerial :/

pert

USBSerial is only a thing on the Zero-type SAMD boards. On the MKR boards, the USB CDC port is named Serial, so the example is correct as written.

Please add the following line to the top of the setup function in the example sketch:
Code: [Select]
while(!Serial) {}
then upload the example to your MKR WAN 1300.

This will cause the operation of the program to wait at that line until you open the Serial Monitor. So hopefully at the very least you should see "power on!" printed.

ivars_p

This will cause the operation of the program to wait at that line until you open the Serial Monitor. So hopefully at the very least you should see "power on!" printed.
Yes that is exactly what happens...there is a "power on" in the serial monitor and thats all.

pert

OK, at least this tells us that serial communication is working correctly.

ivars_p

I connected the gnd and vcc of the sensor to mkr wan 1300 and the scl sda to arduino uno, ran the example on the uno and everything works on the arduino uno side so the power is not the problem...then I switched it up, gnd and vcc on the uno and scl sda on mkr, on the mkr side still nothing...

Than i tried to connect another grove sensor that uses the scl and sda connection to the mkr wan using the same wires and everything, just switching out the sensor and everything works :/

Go Up