I've got to interface an AlphaSense CO2 sensor (manual included as attachment) with an Uno using USB. I'm stuck and can't seem to find any examples or information on the internet. Does anybody have any experience with this? Does arduino even support doing this type of thing?
The AlphaSense CO2 sensor is connected to a software serial port on the Uno using a FTDI TTL 232R 5V cable, the same one used for the mini. Using an oscilloscope I confirmed that a signal was being sent out but couldn't find anything coming in. I double then triple checked the connections, still nothing.
I'm pretty sure the port settings are correct since I first connected with Matlab then copied those settings into my sketch.
Here is my sketch
#include <SoftwareSerial.h>
SoftwareSerial AlphaSense(3, 4); // RX, TX
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while (!Serial) {
// wait for serial port to connect
}
AlphaSense.begin(19200);
}
void loop() {
// put your main code here, to run repeatedly:
AlphaSense.print("N"); //N for concentration, T for temperature, V for lamp voltage
AlphaSense.print('\r'); //Carriage return
delay(20);
char ppm[10];
int i = 0;
while (AlphaSense.available()) {
Serial.println(AlphaSense.read());
i++;
}
Serial.println(ppm);
delay(500);
}
Here is my Matlab code
s=serial('COM41') %setting port
set(s,'BaudRate',19200); %setting baud rate to 19200
set(s,'Terminator','CR') %setting terminator to CR / ASCII 13 / '\r'
fprintf(s,'N') %asking for CO2 concentration
fgetl(s) %recieving input data
Is there anything I should try to fix this problem?