Thank you, that worked. However the sensor values are completely through the rought and I cannot modify it with the resistor as described in the GSR documentation. I think its because of the digital to analog convertion or its just an incompatibility. Anyway, this is outside the scope of this forum. Thank you for your help.
Best posts made by rmarinchev
-
RE: How to get grove pin input?
Latest posts made by rmarinchev
-
RE: How to get grove pin input?
And the seeedino is pretty straight forward. Here I have also a bluetooth module, since the seeeduino values are accurate, so I am using it as part of my prototype. The GSR sensor has a groove connector that plugs straight in the seeeduino port.
-
RE: How to get grove pin input?
The setup with the m5stack and the esp32 is as you said, just connect to 35 or 36 and read the analog input.
-
RE: How to get grove pin input?
Yes, I tried this a few weeks ago with another esp32 board. I tried it also with arduino uno and seeeduino v4.2 boards. They work fine, however the esp32 was also giving wrong readings. To be honest, I bought the m5stack because I saw it had groove port, but I am new to this and I didn't know it can only get digital readings. I tried dividing by 4 since the esp32 gets a reading of 0-4092 and the other boards give a value of 0-1023. However the esp32 is still wrong. I also tried changing the
analogReadResolution(10) analogSetWidth(10)
But still the esp32 was giving false readings and I couldn't calibrate it as shown in the tutorials for gsr sensor (by turning the resistance until I get a reading of 512 without using the sensor)
-
RE: How to get grove pin input?
Thank you, that worked. However the sensor values are completely through the rought and I cannot modify it with the resistor as described in the GSR documentation. I think its because of the digital to analog convertion or its just an incompatibility. Anyway, this is outside the scope of this forum. Thank you for your help.
-
RE: How to get grove pin input?
Hello,
Thank you for your reply. The GSR sensor is "Grove GSR Seeeduino Sensor" and in the documentation it says the output is analog. I will try connecting it to the analog pins.
-
How to get grove pin input?
Hello,
I am using m5stack basic and I have connected a GSR sensor to it with the grove connector. What I cannot seem to figure out is how to get the reading from the sensor. I tried analogRead(20), analogRead(21), analogRead(22) and many others that I found in suggestions on other threads in this forum. No luck however...
This is my code:
#include "M5Stack.h" #define INPUT_PIN 21 #define READ_RATE 400 // How often the serial link is read, in milliseconds // The setup() function runs once each time the micro-controller starts void setup() { // init lcd, serial, not init sd card M5.begin(true, false, true); pinMode(INPUT_PIN, INPUT); M5.Lcd.setTextSize(5); } // Add the main program code into the continuous loop() function void loop() { int reading = analogRead(INPUT_PIN); M5.Lcd.println(reading); Serial.println(reading); M5.update(); delay(READ_RATE); }
I apologize for the noob question. I'm new to this. Thank you in advance for even taking the time to read this thread.