Interaction Beyond Screens (Part 3)

Third week came with its own set of challenges. Designing the circuit and making it work with the right codes is a big challenge in itself but an interesting one!

We started iterating the circuit design and finally came up with the initial design.

Initial Design:

But when we presented the design to our mentor he said we should nail it one step at a time. So we decided to break down the whole circuit in 3 versions. And decided that we will work on the first version of the design in this studio.

The Circuit for version 1:

The first thing after this was to check the readings of the accelerometer. The code used for testing is below:

// these constants describe the pins. They won't change:
const int groundpin = 18; // analog input pin 4 -- ground
const int powerpin = 19; // analog input pin 5 -- voltage
const int xpin = A0; // x-axis of the accelerometer
const int ypin = A1; // y-axis
const int zpin = A2; // z-axis (only on 3-axis models)

void setup() {
// initialize the serial communications:

// Provide ground and power by using the analog inputs as normal
// digital pins. This makes it possible to directly connect the
// breakout board to the Arduino. If you use the normal 5V and
// GND pins on the Arduino, you can remove these lines.
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);

void loop() {
// print the sensor values:
// print a tab between values:
// print a tab between values:
// delay before next reading:

The next challenge was to play music once user moves or starts walking ( movement is tracked by accelerometer).

To be continued…