LDR project

On this section we can make an Arduino challenge with the MKR1000 microcontroller. We are making a circuit, in which an RGB led and a speaker , turn on or sound at a frequency, according to the lighting valuesof the LDR

For the project we need :

circuit 1 :

Regarding the structure of the physical circuit, it consists of an LDR photoresistor (light dependent resistor) connected to a 5V current through the positive pole i connected to a simple resistor through the negative pole, closing this part of the circuit at input A0 (an input specialized in receiving values and signals from an analog input, in this case the brightness level). On the other hand we have three resistors connected to outputs 9, 10 and 11 (which are analogWrite type pins based on creating and sending defined values, in this case the colors red, green and blue), which in turn are connected to the different legs of the RGB LED, leaving the longest (common cathode) to return the current to the GND ground. Finally, we have a small loudspeaker connected by the positive pole to the -6 input (which will modify its tone through frequency) and connected by the negative pole to the GND ground, in order to give the circuit more security.