Input Devices
Group assignments
- probe an input device's analog levels and digital signals
 
My group assignments
Individual Assignments
- measure something: add a sensor to a microcontroller board that you have designed and read it
 
Have you answered these questions?
- Linked to the group assignment page.
 - Documented what you learned from interfacing an input device(s) to your microcontroller and optionally, how the physical property relates to the measured results.
 - Documented your design and fabrication process or linked to the board you made in a previous assignment.
 - Explained the programming process(es) you used.
 - Explained any problems you encountered and how you fixed them.
 - Included original design files and source code.
 - Included a ‘hero shot’ of your board.
 
PC working environment
- PC: MacBook Pro(16-inch,2019)
 - OS: Sonoma 14.7.2
 - Terminal: zsh
 
hero shot
I made my own original board and tried the Step response that I tried in group assignment.

hero video
- Serial Plotter
 
- Oscilloscopes
 
Step response
What is step response
The step-response is a sensor that is made with two sheets of copper, separated from each other by a porous insulating material. It can be used to calculate the value of force, weight, resistance…
1.Board design
This time, I made my own board, albeit a simple one, based on Adrian's STEP RESPONSE I made the board myself, though it is simple.
- Schematic
 

- PCB
 

- Board
 

2.Connection
I create my own component by Copper Foil Tape. In between, I used a sponge recommended by Adrian at Global Open time.

- Done

 
3.programming
Board : XIAO ESP32S3(made in week8)
- Pin out ESP32S3
 

- Original board (week8:PCB)
 

This time I used the program below with the Arduino IDE.
- select board
 
tool > Board > esp32 > XIAO_ESP32S3
- select tool
 
tool > port > /dev/cu.usbmodem14201
//tx_rx03  Robert Hart Mar 2019.
//https://roberthart56.github.io/SCFAB/SC_lab/Sensors/tx_rx_sensors/index.html
//Modified by Adrián Torres Omaña
//Fab Academy 2023 - Fab Lab León
//Step Response TX, RX
//Fab-Xiao
//  Program to use transmit-receive across space between two conductors.
//  One conductor attached to digital pin, another to analog pin.
//
//  This program has a function "tx_rx() which returns the value in a long integer.
//
//  Optionally, two resistors (1 MOhm or greater) can be placed between 5V and GND, with
//  the signal connected between them so that the steady-state voltage is 2.5 Volts.
//
//  Signal varies with electric field coupling between conductors, and can
//  be used to measure many things related to position, overlap, and intervening material
//  between the two conductors.
//
long result;   //variable for the result of the tx_rx measurement.
int analog_pin = A4; //  GPIO 27 of the XIA0 RP2040 or ESP32-C3 pin A4
int tx_pin = D5;  //     GPIO 28 of the XIAO RP2040 or ESP32-C3 pin D5
void setup() {
pinMode(tx_pin,OUTPUT);      //Pin 2 provides the voltage step
Serial.begin(115200);
}
long tx_rx(){         //Function to execute rx_tx algorithm and return a value
                      //that depends on coupling of two electrodes.
                      //Value returned is a long integer.
  int read_high;
  int read_low;
  int diff;
  long int sum;
  int N_samples = 100;    //Number of samples to take.  Larger number slows it down, but reduces scatter.
  sum = 0;
  for (int i = 0; i < N_samples; i++){
   digitalWrite(tx_pin,HIGH);              //Step the voltage high on conductor 1.
   read_high = analogRead(analog_pin);        //Measure response of conductor 2.
   delayMicroseconds(100);            //Delay to reach steady state.
   digitalWrite(tx_pin,LOW);               //Step the voltage to zero on conductor 1.
   read_low = analogRead(analog_pin);         //Measure response of conductor 2.
   diff = read_high - read_low;       //desired answer is the difference between high and low.
 sum += diff;                       //Sums up N_samples of these measurements.
 }
  return sum;
}                         //End of tx_rx function.
void loop() {
result = tx_rx();
result = map(result, 17000, 23000, 0, 64);  //I recommend mapping the values of the two copper plates, it will depend on their size
Serial.println(result);
delay(100);
}
This code is used by changing the reference code to the pin number you used.
4.Result
4.0 Observation with Serial Plotter
- tool > Serial Plotter
 
In group assignment we used an acrylic board and a non-slip mat, but the sponge we used this time was more responsive. I felt that the sponge I used this time was more responsive.
5.Oscilloscopes
See west-harima_week6 for how to use and set up the probe.
time:5.0ms voltage:43.5mv
data file
impressions
- It was interesting to observe with Serial Plotter!
 - At first I was designing Kicad by myself, but it was difficult. Then the instructor helped me.