Here are the schematics of first version ( 2 mic, 2 photoresistance, 2 thermistance ).
WARNING :
R1 and R2 are used to terminate I2C bus, so if you plug two PCF8591 like here, you must plug only one time R1 and R2.
First PCF adresse : 0x90
2nd PCF adresse : 0x98
List of materials :
R1,R2 : 82k ohm
R3,R4,R5,R6 : 10k ohm ( 6 resistance for the two PCF8591 )
U1,U2 : PCF8591P
CTN1,CTN2 : thermistor 10k ohm
LDR1,LDR2 : photoresistance
Microphones :
I replace R5 with 82k ohm.
I do not plug C2 and C3
with one LM358 you can build two times this schematic,
For the second mic the pin are 7,6,5 instead of 1,2,3
Plug V_OUT to CH0 of U2, and 2nd V_OUT to CH1 of U2
Vcc is green wire of nxt
List of materials ( for 1 mic ) :
- 1 mic
- R1,R2,R3 : 10k ohm
- R4 : 1k ohm
- R5 : 82k ohm
- C1 : 10µF
- LM358 IC
NXC Example :
#define port S1 // sensor port 1
#define I2CAddr8591 0x90 // PCF8591 address
#define I2CAddr8591_2 0x98 // 2nd PCF8591 address
byte WriteBuf1[] = {I2CAddr8591, 0x04}; // write buffer
byte WriteBuf2[] = {I2CAddr8591_2, 0x04}; // write buffer
byte ReadBuf[]; // read buffer
int RdCnt=5; // read 5 bytes
task main(){
SetSensorLowspeed(port); // make port I2C
while(true){
// Write config byte and read back 5 bytes
I2CBytes(port, WriteBuf1, RdCnt, ReadBuf);
NumOut(0,LCD_LINE1,ReadBuf[1],true); // Chan 0
NumOut(0,LCD_LINE2,ReadBuf[2]); // Chan 1
NumOut(0,LCD_LINE3,ReadBuf[3]); // Chan 2
NumOut(0,LCD_LINE4,ReadBuf[4]); // Chan 3
I2CBytes(port, WriteBuf2, RdCnt, ReadBuf);
NumOut(50,LCD_LINE1,ReadBuf[1]); // Chan 0
NumOut(50,LCD_LINE2,ReadBuf[2]); // Chan 1
NumOut(50,LCD_LINE3,ReadBuf[3]); // Chan 2
NumOut(50,LCD_LINE4,ReadBuf[4]); // Chan 3
}
}
Source :
Use of LM358 :
http://lowvoltage.wordpress.com/2011/05 ... 8-mic-amp/
Use of PCF8591 :
http://www.rjmcnamara.com/2010/06/extre ... torms-nxt/