LamaPLC: CJMCU-6701: Biosensor for measuring Galvanic Skin Response (GSR) with SPI communication

CJMCU-6701: Biosensor for measuring Galvanic Skin Response (GSR) with SPI communication The CJMCU-6701 is a specialized biosensor module used for measuring Galvanic Skin Response (GSR), also known as Electrodermal Activity (EDA). Unlike the ACS758 current sensors, this module measures skin conductance to infer emotional or physiological arousal, such as stress or excitement.

Key Features

  • Dual Interface: Supports both Analog (direct voltage output) and SPI communication for versatile integration.
  • Built-in ADC: Features a precise 12-bit Analog-to-Digital Converter for digital processing.
  • Voltage Support: Compatible with both 3.3V and 5V power supplies.
  • Form Factor: Compact design often including a 3.5mm headphone jack or pads for connecting skin electrodes.

Skin electrodes for modul

CJMCU-6701: Biosensor for measuring Galvanic Skin Response (GSR) with SPI communication The CJMCU-6701 GSR module typically pairs with finger-strap electrodes that connect via a 3.5mm jack on the backside of the board. These electrodes measure the ion flow from sweat gland activity on the skin surface.

Types of Compatible Electrodes

  • Velcro Finger Straps (Most Common): Reusable straps with metal or conductive fabric contact pads. They are typically worn on the index and middle fingers.
  • Ag/AgCl (Silver-Silver Chloride) Electrodes: Used for high-precision or research-grade measurements. These can be disposable snap-on pads or reusable cup electrodes that provide a very stable electrical interface.
  • Conductive Dry Pads: Simple metal plates often found in DIY kits. These are durable but more sensitive to movement noise than gelled or velcro options.

Electrode Placement & Maintenance

  • Optimal Sites: The fingertips or palms are the most responsive areas because they have the highest density of eccrine sweat glands.
  • Skin Prep: For best results, the skin should be clean but not scrubbed with alcohol, as overly dry skin can lower the baseline conductance.
  • Contact Pressure: Velcro straps should be snug but not tight. Too much pressure can restrict blood flow, while too little causes erratic “spikes” in your data.

Pinout

CJMCU-6701: Biosensor for measuring Galvanic Skin Response (GSR) with SPI communication

PinFunctionConnection Type
+5VPower Supply(3.3V/5V) Power Input
GNDGroundCommon Ground
OUTAnalog OutputAnalog Pin (e.g., A0)
CSChip SelectSPI Interface
MISMaster In Slave OutSPI Interface
SCKSerial ClockSPI Interface

Backside Port Functions

  • 3.5mm Audio Jack (Standard): The primary port for connecting the GSR electrode cable. It allows for a secure, plug-and-play connection to the finger electrodes.
  • Solder Pads (Alternative): Some versions of the board feature labeled pads on the back (GSR) for users who want to bypass the headphone jack and solder electrode wires directly to the PCB for a more permanent or compact installation.
  • Potentiometer Access: While the adjustment screw is on the front, the solder points for the Sensitivity Calibration Potentiometer are visible on the back. This component adjusts the baseline output voltage to accommodate different skin types.

This is the easiest way to get started. You only need three wires for data/power and the electrode cable plugged into the back.

CJMCU-6701 PinArduino PinNote
VCC5VPower supply
GNDGNDCommon ground
OUTA0Analog Input 0
Back JackElectrodesPlug in electrode cable

This code reads the raw sensor value and performs basic averaging to filter out noise common in biosignals.

const int gsrPin = A0;   // Sensor OUT connected to A0
int sensorValue = 0;
int gsrAverage = 0;
 
void setup() {
  Serial.begin(9600);    // Initialize Serial Monitor
}
 
void loop() {
  long sum = 0;
 
  // Take 10 samples and average them to reduce noise
  for(int i = 0; i < 10; i++) {
    sensorValue = analogRead(gsrPin);
    sum += sensorValue;
    delay(5);
  }
 
  gsrAverage = sum / 10;
 
  // Print the raw average value (0-1023)
  Serial.print("GSR Raw Value: ");
  Serial.println(gsrAverage);
 
  // Optional: Convert to Voltage
  float voltage = gsrAverage * (5.0 / 1023.0);
  Serial.print("Voltage: ");
  Serial.println(voltage, 2);
 
  delay(100); 
}

Option 2: Arduino SPI Wiring (For better noise immunity/precision)

Using SPI uses four data lines but provides a direct digital reading, bypassing the Arduino's built-in ADC for potentially cleaner data.

CJMCU-6701 PinArduino UNO PinArduino Mega Pin
VCC5V5V
GNDGNDGND
CSD10D53
SCKD13D52
MISD12D50
Back JackElectrodesPlug in electrode cable

In this CJMCU-6701, there is no MOSI pin because the onboard ADC (often a Microchip MCP3201) is read-only. It doesn't need instructions from the Arduino; it simply “spits out” data when clocked.

This sketch uses the standard Arduino SPI Library to read the 12-bit digital value.

#include <SPI.h>
 
const int csPin = 10; // Chip Select pin
 
void setup() {
  Serial.begin(9600);
  pinMode(csPin, OUTPUT);
  digitalWrite(csPin, HIGH); // Ensure sensor is disabled initially
 
  // Initialize SPI: Speed 1MHz, MSB first, SPI Mode 0
  SPI.begin();
}
 
void loop() {
  // Start SPI transaction
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
  digitalWrite(csPin, LOW); // Select the sensor
 
  // Read 2 bytes (16 bits total) from the sensor
  // Since it's read-only, we send 0x00 to provide clock pulses
  byte highByte = SPI.transfer(0x00);
  byte lowByte = SPI.transfer(0x00);
 
  digitalWrite(csPin, HIGH); // Deselect the sensor
  SPI.endTransaction();
 
  // Combine bytes and extract 12-bit value
  // MCP3201 format: 2 leading zero bits, 1 null bit, then 12 data bits, 1 extra bit
  int rawValue = ((highByte & 0x1F) << 7) | (lowByte >> 1);
 
  Serial.print("GSR Digital Value: ");
  Serial.println(rawValue);
 
  delay(200); // Sample rate adjustment
}

SPI topics on lamaPLC


This page has been accessed for: Today: 1, Until now: 2