%indent
* Arduino [#af771018]d [#i181010c]
- 本家参照: http://arduino.cc/en/Reference/HomePage
- 和訳参照: http://www.musashinodenpa.com/arduino/ref/
* センサー [#y2b6426f]
** 光センサー(硫化カドミウム CdS セル) [#w99d750f]
- 秋月 http://akizukidenshi.com/catalog/g/gI-00110/
- jkoba http://jkoba.net/prototyping/arduino/cds_practice.html
** コンパレータ [#y0f424aa]
|2u/chip|LM393N | \25/1chip|\12.5/unit|
|4u/chip|LM339 | \30/1chip|\ 7.5/unit|
|2u/chip|NJM2903D|\100/5chip|\10.0/unit|
|4u/chip|NJM2901N| \50/1chip|\12.5/unit|
** 6.7kΩ [#v4531e1b]
** 温度センサー(1wire-digital) [#rea30414]
- 秋月 http://akizukidenshi.com/catalog/g/gI-05276/
- http://qiita.com/hnw/items/315fad0d4b60ada10d00
- http://blog.goo.ne.jp/mkidmtr70/e/a95e8d383e4f62e58afa4e34ffdeb7b7
- http://www.ne.jp/asahi/shared/o-family/ElecRoom/AVRMCOM/DS18B20/DS18B20manual.html
*** Hard [#g79a0048]
###
int n = 0
DS18B20 sensor[0:.n]
Arduino arduino;
pin vcc = arduino.vcc
pin gnd = arduino.gnd
pin data = vcc -- R4.7kΩ
sensor[0:.n].gnd = gnd
sensor[0:.n].dq = data
sensor[0:.n].vdd = gnd // parasite power
###
*** Soft [#n4f66f98]
- https://github.com/PaulStoffregen/OneWire
- https://github.com/milesburton/Arduino-Temperature-Control-Library
###
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire(2);
DallasTemperature sensor(&oneWire);
#define N 2
void setup() {
Serial.begin(9600);
Serial.println("Begin OneWireTemprature");
sensor.begin();
delay(100);
Serial.print(" sensor.getDeviceCount ==> ");
Serial.println(sensor.getDeviceCount());
delay(100);
}
void loop() {
sensor.requestTemperatures();
Serial.print(" T ==> [");
Serial.print(sensor.getTempCByIndex(0));
for(int i = 1; i < N; i++) {
Serial.print(", ");
Serial.print(sensor.getTempCByIndex(i));
}
Serial.println("]");
delay(100);
}
###