- français
- English
First Circuits
At the 5th week of the semester, we started our work on Arsenic sonification.
We learnt about Arduino and understood that it was the central element of our circuit. We found several tutorials with Arduino producing sound and most of them involved a piezo speaker.
Our first circuit was simply an Arduino and the piezo connected to each other:
We discovered how to code for different sounds and how to build melodies. (Link to the code)
Now to adapt this to the prototype, we added the Light-To-Frequency (LTF) converter to the circuit. Indeed this component is the one that gives the information about Arsenic concentration in the prototype.
How does it work ? it detects light and turns it into a square frequency :
We found on the web an example of a code using the TSL235 LTF: The Arduino is counting the number of “counts”: that is the number of times the frequency goes from one to zero. We modified this code so that over a specific threshold of counts, a different note is being played. (Link to the code)
In order to get closer to the prototype, we then tried to adapt the code for the piezo to the code of the prototype. The Arduino code previously developed used two files: Counter.cpp and Counter.hpp.
The difficult part was to understand the timing of the program: the Arduino took a specific delay for the measurement and the counting was done repeatedly. What we wanted to achieve was playing music when counting and then playing a specific music : stressful if highly concentrated in Arsenic and normal if low concentration of Arsenic. We chose some melodies found on the web.
Here is the circuit with the LTF:
And the link to the code.
The next idea was to use an Arduino shield to produce some real music.
However, this part was quite complicated to achieve therefore we continued with the Piezo Speaker to create a Music box to present at the STIL. To create the music box, we started from the same circuit and code but we added some components to add some dynamism to the prototype.