Input devices

This week I tried to get an understanding of the differences in between digital and analog sensors. I started with designing a mini Arduino-like board where I attached a sensors: it's a digital temperature sensor I then designed a simple interfaces in Processing to visualize the results. Eventually I also build a stand alone board.

In this assignment i learned a lot about programming. This was absolutly new for me, that's why I did it in windows following the help of my collegueLambert RULINDANA here in Fablab. I choose the Digital temperature sensor, because is simple and i'm planning to use it in the final project and other future products. The first thing before programming is to weld the superficial components and be sure to do all so perfect as you can.

after connecting everything uploaded the code

//RESET | pin 1 pin 8| 5V

// 3/A3 | pin 2 pin 7| 2/A1

// 4/A2 | pin 3 pin 6| 1/PWM

// GND | pin 4 pin 5| 0/PWM

// for SoftwareSerial you must set up as internal clock // to free up physical pins 2 and 3.

// This will flash an LED on physical pin 6, read the analog value on pin 7, and send the

// analog value to the Serial Monitor for display.

#include "SoftwareSerial.h"


const int sensor = A1; // this is physical pin 7, connect wire as sensor

const int Rx = 3; // this is physical pin 2

const int Tx = 4; // this is physical pin 3

SoftwareSerial mySerial(Rx, Tx);

int val = 0; // variable to store sensor readings

void setup()

{


pinMode(Rx, INPUT);

pinMode(Tx, OUTPUT);

mySerial.begin(9600); // send serial data at 9600 bits/sec

}

void loop()

{

val = analogRead(sensor); // read the sensor
mySerial.print("sensor value is:      ");
mySerial.println(val); // send the value to Serial Monitor, 



delay(500);

}

and test the code bu approching soldering iron on my sensor

here there is the value i got at defferent temperature