How to use the GPIO-Pins of the PIC32 for reading temperature?
Hello,
I'm quite new to OpenBCI and I'm using the Cyton board for my bachelor's thesis.
So far, everything works fine and now I'd like to add the possibility to measure temperature as well. My approach is to use a Cypress PSoC 1 evaluation kit for working with the temperature sensor and then add its values to the data stream from the Cyton to my laptop.
I guess I have to modify the firmware and the GUI so the temperature data is transmitted together with the data from the electrodes.
I have searched this forum and the learning section of the OpenBCI website, but I have found no information on this matter.
Basically I'm asking myself two questions:
Is it possible to use the GPIO-Pins of the PIC32 for digital communication between the boards (e.g. UART or I²C)?
If yes, which parts of the firmware and the GUI need to be modified and where can I find the source code of the firmware?
Thank you for your help, I appreciate it very much.
I'm quite new to OpenBCI and I'm using the Cyton board for my bachelor's thesis.
So far, everything works fine and now I'd like to add the possibility to measure temperature as well. My approach is to use a Cypress PSoC 1 evaluation kit for working with the temperature sensor and then add its values to the data stream from the Cyton to my laptop.
I guess I have to modify the firmware and the GUI so the temperature data is transmitted together with the data from the electrodes.
I have searched this forum and the learning section of the OpenBCI website, but I have found no information on this matter.
Basically I'm asking myself two questions:
Is it possible to use the GPIO-Pins of the PIC32 for digital communication between the boards (e.g. UART or I²C)?
If yes, which parts of the firmware and the GUI need to be modified and where can I find the source code of the firmware?
Thank you for your help, I appreciate it very much.
Comments
I already used this search functions, but I'm afraid I don't see the wood for the trees.
Anyway, I'll have a look at the firmware. If I'm not thinking in the wrong direction, it should be possible to use the Serial1 connection to integrate the temperature data into the data stream from the board.
Do you know by any chance which part of the GUI receives the data? This needs to modified as well so I can see if the data is received.
I have a LM35 analog temperature sensor at hand, which produces a voltage output from -1V to 6V. Unfortunately I have found no specifications or instructions for the analog display widget. Do you know the voltage range the analog pins can tolerate?
Although I'm quite experienced with programming, I haven't used Processing yet and I know that it can take a while to understand someone else's code. Since I haven't that much time left for my thesis, I have to ask directly instead of trying to figure it out myself. I hope you don't get the feeling I'd try to pass my work on to you.
Is it possible to clone the analog read widget, make it a temperature widget which directly transforms the analog voltage into the temperature value and add it to the other widgets? If yes, which file of the GUI has to be modified to add this temperature widget?
I connected my temperature sensor to GND, VDD , and D12 on the J3 connection of the Cyton board. The 3.3V are well within the input specifications for the LM35 and it produces an output voltage of 96mV, but in the analog read plot the values lie between -150 and -200. I suppose the unit of the analog read widget is mV, but I found no information confirming that.
I don't think the reason is the connection between the sensor and the board. Although it is not as good as a soldered connection, I don't think that it is too loose to produce a reading that is that far away from the value it is supposed to read.
I have the feeling that the solution to this is quite simple, but I have no idea how to get reasonable values from the analog read widget.
I'll try to check the analog widget with other voltages.
What I'm looking for is some documentation on that widget. There are a few questions that even the source code cannot answer. What is the unit of the value the widget shows in the GUI? Why is this value negative when I apply a positive voltage? And why does the voltage I apply on the input pin and the value in the GUI seem to be completely uncorrelated?
Is there in the depths of the OpenBCI website or GitHub some explanation for this widget?
I applied 0V and 3.3V on the D12 input pin to get the range of the readout, but the widget does not seem to notice. The values fluctuate roughly between -150 and -200, no matter which voltage is applied to the input pin.
Is it possible to somehow contact AJ Keller, who wrote the code for the widget?
Or is it possible that I have to change the board mode first? If yes, how do I do that? Perhaps I missed that part, but again, I found no information on that topic.
Yes, I already pressed the "Turn Analog Read On" and I tested the other pins, with no better result than the D12 pin.
I'll contact him via mail and keep this post updated.
My exchange is coming to an end soon, so there's not much time left to try things. Luckily my thesis could still be finished, my supervisor suggested to describe the approach in theory instead of showing a working result. I'll try to get the board running again as long as I still have access to it, however, I guess there won't be any more helpful result on using the Analog Read widget or the GPIO-Pins for serial communication for this forum entry.
Thank you for all your help.
My idea seemed simple: Take a temperature sensor which provides an analog voltage, read that via the widget and calculate the temperature. Unfortunately that did not work. I tried the Pulse Sensor Widget, too, with equally no result.