Skip to content

symdeb/Arduino-Light-Player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARDUINO LIGHT DFPLAYER

This was a small project for some students in Industrial Design class for Installation Art.

The sensor is a variable resistor called a photo-resistor or LDR.
The resistor value will change with the amount of light. A high amount of light and the LDR resistance will decrease so that the voltage over the fixed resistor will increase and thus the voltage over the fixed resisitor will increase. The voltage changes from 0 to 5V. Arduino has 6 analog to digital convertors (ADC). The voltage value can be read on pin A0 and the value range from from 0 to 1023

We read the value of the ADC, and then play a diferent sound file.

The sound files are played using an DFPlayer. Using the serial port from the arduino, commands can be send to the DFplayer For example "play" and "stop". After starting the play, we must wait a few seconds for the audio to complete.

The files must be named 0001.mp3 to 0005.mp3 and placed in a subfolder on the SD card. The SD card must be FAT formatted.

The code sets a target value with a range in which the target lies. When the value is within the target range 0003.mp3 file will be played back.

The usage of the files are as follows:

  • 0001.mp3 far away
  • 0002.mp3 stil far away
  • 0003.mp3 just right
  • 0004.mp3 to close
  • 0005.mp3 very close

Updating MP3 files can be done using the USB connector.

  1. Set the switch is set in "ON" position
  2. Connect a computer is to the DFPlayer USB connector
  3. Connect powerto the Arduino
  4. The dfplayer will act an an USB drive and files can be moved from the PC to the dfplayer.
  5. Disconnect the usb connectors
  6. Set the switch to "OFF"
  7. Power on the Arduino. ** List of materials **
  • uno - Arduino Uno
  • speaker - 2W or more speaker (3W recommended)
  • dfplayer - DFplayer Mini
  • usb - USB type B connector
  • switch - Mini Push Button Switch Latching type - DPDT
  • Some resistors
  • sensor - LDR photo resistor

About

Plays a different sound based on light intensity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published