# Read EDA input data into PsychoPy and write this data in the logfile/output file generated for each task run?

**URL:** <https://discourse.psychopy.org/t/read-eda-input-data-into-psychopy-and-write-this-data-in-the-logfile-output-file-generated-for-each-task-run/3989>\
**Category:** Builder\
**Tags:** importing\
**Created:** [February 20, 2018, 4:38am UTC](https://discourse.psychopy.org/t/read-eda-input-data-into-psychopy-and-write-this-data-in-the-logfile-output-file-generated-for-each-task-run/3989 "2018-02-20T04:38:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_Barreiros](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@A\_Barreiros](https://discourse.psychopy.org/u/A_Barreiros)\
**Post date:** [February 20, 2018, 4:38am UTC](https://discourse.psychopy.org/t/read-eda-input-data-into-psychopy-and-write-this-data-in-the-logfile-output-file-generated-for-each-task-run/3989/1 "2018-02-20T04:38:58Z")

</div>

I have installed the PsychoPy v1.85.4 on my Windows 7; I am using the Builder to create my study.  
I will use this experimental protocol in an MRI study, and during the acquisitions I also want to collect Skin Conductance Response (EDA) data, with an external device. This device communicates with my computer though a Serial Port. Is it possible to synchronize this data acquisition and get Inputs from the EDA device recorded in the PsychoPy excel output? If yes, how can I do that?

Thank you for your help,

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [February 20, 2018, 8:24pm UTC](https://discourse.psychopy.org/t/read-eda-input-data-into-psychopy-and-write-this-data-in-the-logfile-output-file-generated-for-each-task-run/3989/2 "2018-02-20T20:24:09Z")

</div>

Yes, but it will take some code as per the documentation here:

[http://www.psychopy.org/api/serial.html](http://www.psychopy.org/api/serial.html)

You would insert a code component in Builder. In its “Begin Experiment” tab, you would import the serial library and create the connection to the serial port.

Then I guess in the “every frame” tab, you would read some data (i.e. once per screen refresh) and save it somewhere. If that rate of data collection (ie 60 Hz sampling for a 60 Hz display) is not fast enough, then you would need to look into the `ioHub` package, which can poll the serial port much faster. But I suspect that GSR doesn’t alter quickly enough to need a very rapid rate of sampling.
