This project is part of my Measuring Techniques and Systems class at the University of Jyväskylä last December 2023 during my Erasmus Mundus RADMEP program. This was a group project with Nico and Ale where I was mostly responsible for the design, characterization, and signal transfer/acquisition.
To achieve this project, the following materials were used:
- (2) Arduino UNO
- (2) 525-nm/Green LEDs
- (2) Adafruit 161 Photoresistors
- Resistors (470 Ω, 12 kΩ, 20 kΩ)
- Connector wires
- Analog Discover 2
Below is the schematic of the transmitter (in red) and receiver (in blue) circuits, both of which contain Arduino UNO microcontrollers to handle signal transfer and acquisition. This schematic was created from this website here.
The basic operation involves an LED turning ON and OFF whose blinking sequence depends on the selected number from 0-255. The chosen number of bits is 8, which is enough to cover the entire range. To inform the receiver side of an incoming signal, additional LED-photoresistor pair was added.
The next step was to identify which is signal is ON or OFF, and this would depend on the photoresistor response to the 525-nm LED used. Below is the schematic of the photoresistor response to LED blinking in a dark environment:
where Vout was measured. Below is the photoresistor response to different resistors values with the LED having a 0.1-s interval between successive blinks:
The 20 kΩ-resistor was later on chosen for the circuit. Zooming in to the photoresistor respose at 20 kΩ:
The red dashed line was set to be the boundary above which bit is considered ON and OFF otherwise. The green dashed lines correspond to the ideal LED blinking response; however, the transition from light to dark was not as abrupt as the inverse transition. If the sampling rate was chosen to be identical to that of the green dashed lines, then it would not reliably recover the information because there are originally ON bits that are considered OFF by the photoresistor. To address this, smaller transfer rate was implemented on the transmitter side.
These were the final details of the setup:
- Device should be in a black box
- Transmitter LED to receiver photoresistor distance: 0.5 cm
- Transfer rate: 0.6 bit/s (1.5 s per bit)
- Data transmission limited only to numbers from 0-255
- pyFirmata used to control Arduino UNO pins in Python
Below is the actual image of the project circuitry:
Requirements The following libraries should be installed beforehand:
Transmitter
pyarduino_comm.py: Code that interfaces Python and Arduino. Also handles the conversion into an 8-bit binary number, the LED for initiating and terminating communication, and the transmitter LED blinking.transmitter.py: Code that runs the UI interface allowing to select the number from 0-255 to be sent to the receiver side. Usespyarduino_comm.py.
Receiver
receiver.ino: Arduino code for signal acquisition.
LED data transmission
Software interface using Tkinter
Creating circuit diagrams





