Arduino research 17/05/2018

LDR - LED circuit

Today I’ve been looking at how to build the various Arduino circuits for the Space Rocks, and at some examples of relevant projects.

I made some basic sensor experiments with a Light-dependent resistor, ultimately using this code from the Make: Getting Started with Arduino book.

// Example 06b: Blink LED at a rate specified by the
// value of the analogue input

# define LED 9 // the pin for the LED

int val = 0; // variable used to store the value
 // coming from the sensor

void setup() {
 // put your setup code here, to run once:

pinMode(LED, OUTPUT); // LED is as an output

// note Analogue pins are
 // automatically set as inputs

void loop() {
 // put your main code here, to run repeatedly:

val = analogRead(0); // read the value from the sensor

analogWrite(LED, val/4); // turn the LED on at
 // the brightness set
 // by the sensor

delay(10); // stop the program for some time


And this circuit:

LDR - LED circuit diagram
LDR – LED circuit diagram
LDR - LED circuit
LDR – LED circuit

Also stumbled upon How to Build an Arduino synthesizer with Mozzi library

The Mozzi library looks super-useful for sound generation:

Currently your Arduino can only beep like a microwave oven. Mozzi brings your Arduino to life by allowing it to produce much more complex and interesting growls, sweeps and chorusing atmospherics. These sounds can be quickly and easily constructed from familiar synthesis units like oscillators, delays, filters and envelopes.

You can use Mozzi to generate algorithmic music for an installation or performance, or make interactive sonifications of sensors, on a small, modular and super cheap Arduino, without the need for additional shields, message passing or external synths.

Note to self to also check out the Mozzi examples gallery.