meta data for this page
LamaPLC: 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
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
| Pin | Function | Connection Type |
|---|---|---|
| +5V | Power Supply | (3.3V/5V) Power Input |
| GND | Ground | Common Ground |
| OUT | Analog Output | Analog Pin (e.g., A0) |
| CS | Chip Select | SPI Interface |
| MIS | Master In Slave Out | SPI Interface |
| SCK | Serial Clock | SPI 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.
Option 1: Arduino Analog Wiring (Recommended for simplicity)
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 Pin | Arduino Pin | Note |
|---|---|---|
| VCC | 5V | Power supply |
| GND | GND | Common ground |
| OUT | A0 | Analog Input 0 |
| Back Jack | Electrodes | Plug 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 Pin | Arduino UNO Pin | Arduino Mega Pin |
|---|---|---|
| VCC | 5V | 5V |
| GND | GND | GND |
| CS | D10 | D53 |
| SCK | D13 | D52 |
| MIS | D12 | D50 |
| Back Jack | Electrodes | Plug 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
| Page | Date | Tags |
|---|---|---|
| 2024/11/15 21:58 | bus, communication, spi, basic, arduino, ssi, sdi, miso, sdo | |
| 2026/02/13 20:41 | cjmcu-3901, cjmcu, pmw3901, pmw-3901, optical flow, sensor, pixart, spi, communication, arduino, code, pmw3901mb-txqt | |
| 2026/02/13 23:02 | cjmcu, cjmcu-6701, acs758, acs-758, galvanic skin response, gsr, electrodermal activity, eda, spi, communication, arduino, code, sensor, healthcare | |
| 2025/11/21 23:07 | esp8266, esp32, esp32-c2, esp32-c3, esp32-c5, esp32-c6, esp32-c61, esp32-h2, esp32-s2, esp32-s3, esp32-p4, espressif systems, communication, ethernet, ip, wi-fi, thread, zigbee, matter, homekit, bluetooth, mqtt, adc, spi, uart, i2c, i2s, rmt, pwm, usb, usb otg, twai | |
| 2026/02/11 18:09 | ak8963, gy-9250, mpu-9250, 9-axis, motion detection, magnetometer, communication, i c, i2c, spi | |
| 2025/12/10 17:07 | max31865, rtd, pt 100, pt 1000, temperature, spi, platinum, arduino, adafruit | |
| 2025/12/04 00:34 | communication, i2c, mcp23017, mcp23s17, spi, i o expander, serial, cjmcu-2317, cjmcu |
This page has been accessed for: Today: 1, Until now: 2
