Skip to content

Instantly share code, notes, and snippets.

@timpulver
timpulver / arduino_processing_analog_audio_file.md
Last active November 28, 2017 19:24
How to trigger an audio file with an analog sensor using Processing and Arduino

Keywords: Arduino, Processing, Serial, Communication, Analog, Sensor, Distance, Pressure, Prototyping, Minim, Audio, MP3, Play, Audio File
Author: Tim Pulver
Last update: 2015-12-07

Wiring

In this example we are using an analog distance sensor (Sharp 2Y0A02). The setup will be very similar when you are using another sort of analog sensor (e.g. an analog pressure sensor). Make sure to know the right pin order. What mostly works here is to google for the part you want to use (e.g. pressure sensor) together with the keyword arduino, so e.g. arduino pressure sensor. You will then find some images showing how to wire the sensor up. In all cases you need to connect one wire to 5V on the Arduino (red here), one to GND / Ground (black here) and one to an analog pin – in this case A0 (yellow / white / green wire).

Distance Sensor Hookup Image

@zzzunaaa
zzzunaaa / arduino_processing_analog_audio_file.md
Created May 11, 2016 17:02 — forked from timpulver/arduino_processing_analog_audio_file.md
How to trigger an audio file with an analog sensor using Processing and Arduino

Keywords: Arduino, Processing, Serial, Communication, Analog, Sensor, Distance, Pressure, Prototyping, Minim, Audio, MP3, Play, Audio File
Author: Tim Pulver
Last update: 2015-12-07

Wiring

In this example we are using an analog distance sensor (Sharp 2Y0A02). The setup will be very similar when you are using another sort of analog sensor (e.g. an analog pressure sensor). Make sure to know the right pin order. What mostly works here is to google for the part you want to use (e.g. pressure sensor) together with the keyword arduino, so e.g. arduino pressure sensor. You will then find some images showing how to wire the sensor up. In all cases you need to connect one wire to 5V on the Arduino (red here), one to GND / Ground (black here) and one to an analog pin – in this case A0 (yellow / white / green wire).

Distance Sensor Hookup Image