Home Image

 

Week 10 - Input Devices

 

This week's project involved creating a board with an input device.

I made a board with a Hall + Temperature sensors.

 

Board Design

board design

Board Milling

 

fab module

 

modela

 

Board Programing

I used the fabISP to program the board.

 

isp

 

I programed the board in Arduino and used the Software Serial Library to read the

values of the sensors.

 

Software Serial Library

Example:

#include <SoftwareSerial.h>
// Definitions
#define rxPin 1
#define txPin 0
SoftwareSerial mySerial(rxPin, txPin);
int sensorPin = 3; //ACTUALLY PIN LABELED AS "2" on the HLT tutorial
int sensorVal = -1;
boolean switchFans = 0;
// the setup routine runs once when you press reset:
void setup() {
pinMode(sensorPin, INPUT);
mySerial.begin(9600);
mySerial.println("hello world");
}
// the loop routine runs over and over asensorpingain forever:
void loop() {
sensorVal = analogRead(2);
mySerial.print("Input Val: ");
mySerial.print(sensorVal);
mySerial.println();
}