More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Discussion specific to the intelligent brick, sensors, motors, and more.
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by floppi »

I use one PCF8591 for this :
With one input on the nxt, I wanted to have more than one sensor.
I build a circuit with
- 2 microphones with the LM357 IC ( robot is able to detect where does the sound come from ).
- 2 photoresistors ( robot will be able to detect where is the lighter source )

Then I will add a PCF8574 to
- drive 6 output ( motors with external power supply or simply led ).
- read a thermistor with the last two lines ( time to charge a capacitor with a thermistor in serial ) one output will give power to charge the capacitor and one input to detect full charge.

The aim is to create a robot (Dog?) wich will be the most realistic, and react with the environnement.

Image

The only doubt I have ? Will the nxt have enough power to drive this with other classical sensor plugged and motors ?
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by mattallen37 »

Looks pretty cool! Want to post the schematic?

The NXT can supply about 180 ma to the sensors and motor encoders. Stock sensors use from 0 (touch sensor) to about 16 (light sensor with LED on) ma each. NXT motor encoders use 9-12 ma each. Usually I figure it's safe to draw 100ma, use 3 motors, and maybe 1 or 2 other sensors. 180ma - (12ma * 3 motors) - (16.3ma * 3 light sensors with LEDs) = 95.1ma left over, and that's assuming you are using three light sensors with LEDs on, and all three motors are plugged in.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by floppi »

The schematics...

The first part about PCF8591 is taken from the book : Extreme nxt

http://www.amazon.com/Extreme-NXT-Exten ... 1430224533

I want to respect the work from the author and i wonder if i can publish the schematic ?

About the other part ( mic with LM357), here is the schematic :

http://lowvoltage.files.wordpress.com/2 ... =604&h=260


Today I bought a new PCF8591 to add more input, i have a PIR sensor, motion sensor would be cool !

If the nxt Brick can not supply enough power, i will add external batteries (9V?), but I dont think it will be necessary those Ic do not need power.
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by floppi »

I finally decided to post the entire schematic, ( nxt wires, PCF8591, LM357, photoresistor, microphone ).
I think I have added many more thing to the original schematic so i can publish it.
I put the link to the book which help me, it's enough ?
( I very recommand this book to everyone who want to build home made sensor !!! )

But, this take time to build the all schematic, and the final settings are not already done.

I will post the schematic when all is ok.

PS : with the 8574 : trying to read a charging time of a capacitor in serial with a thermistor is not possible ! To have a logic 0 on the input pin of the 8574, the output must be plugged to the ground. Leaving the output like "not connected" ( this is the case with this system ) will result in a read of a 1 logic.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by mattallen37 »

I look forward to seeing it :)
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by floppi »

ok, I abandonned the idea of motion sensor from scratch..
Unable to make it work.

So i bought a motion sensor at 18$, this motion sensor was in two parts : the detector which works on 3*1.5V battery ( exactly what I want :) ) and a second part to be plugged on a power socket to make sound when remote sensor detect something.
I separate in two the first part, the motion sensor and the remote.
I have a perfectly workable motion sensor.
( and a bonus, a remote control wich make sound... what about pluging it on the nxt for a different project ?)

SO here is my objectives :

2 * PCF8591P :
- 2 * thermoresistor
- 2 * photoresistor
- 1 * motion sensor
- 2 * mic
- 1 analog input available for ????

1 * PCF 8574 for driving 8 output ( or 8 input like 8 touch sensor !!!! )

all that on a single input of the nxt :mrgreen:

project should be done within 1 weeks.
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by floppi »

mattallen37 wrote:
The NXT can supply about 180 ma to the sensors and motor encoders. Stock sensors use from 0 (touch sensor) to about 16 (light sensor with LED on) ma each. NXT motor encoders use 9-12 ma each. Usually I figure it's safe to draw 100ma, use 3 motors, and maybe 1 or 2 other sensors. 180ma - (12ma * 3 motors) - (16.3ma * 3 light sensors with LEDs) = 95.1ma left over, and that's assuming you are using three light sensors with LEDs on, and all three motors are plugged in.
At this stage :

- 2 * PCF8591P
- 2 * photoresistor on first PCF8591
- 2 * thermistor on first PCF8591
- 2 mic with LM357 opamp on second PCF8591

Overall current use : 5 mA !!!!!! :o :o
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by floppi »

I just found what to do with the last remaining analog input !

I saw on the net that foam used to protect computer memories ( ram ) in packages are conductive foam, resistive value varies when you press it or just touch it !!
Add an op amp and let's go !!
Tested and it works, this will go on the head of the robot to detect petting !
floppi
Posts: 48
Joined: 25 Jul 2012, 22:55

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by floppi »

Here are the schematics of first version ( 2 mic, 2 photoresistance, 2 thermistance ).

Image

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 :

Image

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/
Last edited by floppi on 17 Sep 2012, 08:47, edited 2 times in total.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: More sensors on 1 in (2 mic, 2 photoresistor) and soon more

Post by mattallen37 »

Cool! Thanks for sharing!
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests