Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Suggestion for Mini Camera on: March 07, 2013, 09:18:17 am
Hi all,
I have been working on project, which are study people moving patterns in pedestrian. I want to capture the image in real-time (about every 5 minutes delay) with arduino + jpeg camera and furthermore will be upload it in my twitter. Now, I have arduino and ethernet shield, for the camera I need suggestion from you guys, which camera is suitable for my project that can directly upload to the internet without connected to the PC first.
Any suggestions will be appreciates.
Thanks
2  Using Arduino / Sensors / Re: I2C bus on multiple BH1750 sensor on: February 11, 2013, 12:17:34 am
Hi Ken,
Thanks, I will check that..
3  Using Arduino / Sensors / Re: I2C bus on multiple BH1750 sensor on: February 10, 2013, 06:50:35 pm
Thanks Grumpy_Mike,
I run the code above and nothing happen in serial monitor. I used this connection:
Vcc - 5v
Gnd - Gnd
SCL - 10K - Pin 5
SDA - 10K - Pin 4
ADD - 100 ohm - Gnd


This my present code:
#include <Wire.h> //BH1750 IIC Mode
#include <math.h>
int Sen1 = 0x23; //setting i2c address
int Sen2 = 0x5C;

byte buff[2];

void setup()
{
  Wire.begin();
  Serial.begin(57600);//init Serial baud rate
}

void loop()
{
  uint16_t val1=0, val2=0;
  
  BH1750_Init(Sen1);
  delay(200);

  if(2==BH1750_Read(Sen1))
  {
    val1=((buff[0]<<8 )|buff[1])/1.2;
    Serial.print(val1,DEC);    
    Serial.println("[lx]");
  }
  delay(200);
  
  BH1750_Init(Sen2);
  delay(200);

  if(2==BH1750_Read(Sen2))
  {
    val2=((buff[0]<<8 )|buff[1])/1.2;
    Serial.print(val2,DEC);    
    Serial.println("[lx]");
  }
  delay(200);
}

int BH1750_Read(int address) //
{
  int i=0;
  Wire.beginTransmission(address);
  Wire.requestFrom(address, 2);
  while(Wire.available()) //
  {
    buff = Wire.read();  // receive one byte
    i++;
  }
  Wire.endTransmission();  
  return i;
}

void BH1750_Init(int address)
{
  Wire.beginTransmission(address);
  Wire.write(0x10);//1 lux resolution 120ms
  Wire.endTransmission();
}

4  Using Arduino / Project Guidance / Re: Arduino UNO - Automated windows blinds on: February 10, 2013, 08:44:22 am
Hi zoomkat,
Thanks for share, that's a nice project, I like the part where you put a little Vaseline for lubricants.
Actually I'm currently struggling in writing code used Wire.h, I put that on a new topic in here: http://arduino.cc/forum/index.php/topic,148007.0.html
5  Using Arduino / Sensors / Re: I2C bus on multiple BH1750 sensor on: February 10, 2013, 06:16:41 am
Hi afremont,
Thanks for respond, still can't works. I think the problem is in my code.
Sorry for my poor writing skills, but I will try to make it work.

This my present code:
Code:
#include <Wire.h> //BH1750 IIC Mode
#include <math.h>
int Sen1 = 0x23; //setting i2c address
int Sen2 = 0x5C;

byte buff[2];

void setup()
{
  Wire.begin();
  Serial.begin(57600);//init Serail band rate
}

void loop()
{
  int i;
  uint16_t val1=0, val2=0;
 
  BH1750_Init(Sen1);
  delay(200);

  if(2==BH1750_Read(Sen1))
  {
    val1=((buff[0]<<8)|buff[1])/1.2;
    Serial.print(val1,DEC);     
    Serial.println("[lx]");
  }
  delay(200);
 
  if(2==BH1750_Read(Sen2))
  {
    val2=((buff[0]<<8)|buff[1])/1.2;
    Serial.print(val2,DEC);     
    Serial.println("[lx]");
  }
  delay(200);
}

int BH1750_Read(int address) //
{
  int i=0;
  Wire.beginTransmission(address);
  Wire.requestFrom(address, 2);
  while(Wire.available()) //
  {
    buff[i] = Wire.read();  // receive one byte
    i++;
  }
  Wire.endTransmission(); 
  return i;
}

void BH1750_Init(int address)
{
  Wire.beginTransmission(address);
  Wire.write(0x10);//1lx reolution 120ms
  Wire.endTransmission();
}

Btw, I'm curious how to make that inversion?
ADDR = ‘H’  ( ADDR ≧ 0.7VCC ) → “1011100“ --> 5C
ADDR = 'L'  ( ADDR ≦ 0.3VCC ) → “0100011“ --> 23

Isn't?
6  Using Arduino / Sensors / I2C bus on multiple BH1750 sensor on: February 10, 2013, 01:06:32 am
Hi all,
I'm currently working on BH1750, http://www.dfrobot.com/wiki/index.php/Light_Sensor_(SKU:SEN0097)
I don't understand, how to using it in multiple I2C address/sensor.
Please give me some input on code reference to changes the address?

Here the current code I used for 1 sensor (from DFrobot):
Code:
#include <Wire.h> //BH1750 IIC Mode
#include <math.h>
int BH1750address = 0x23; //setting i2c address
 
byte buff[2];
void setup()
{
  Wire.begin();
  Serial.begin(57600);//init Serail band rate
}
 
void loop()
{
  int i;
  uint16_t val=0;
  BH1750_Init(BH1750address);
  delay(200);
 
  if(2==BH1750_Read(BH1750address))
  {
    val=((buff[0]<<8)|buff[1])/1.2;
    Serial.print(val,DEC);    
    Serial.println("[lx]");
  }
  delay(150);
}
 
int BH1750_Read(int address) //
{
  int i=0;
  Wire.beginTransmission(address);
  Wire.requestFrom(address, 2);
  while(Wire.available()) //
  {
    buff[i] = Wire.receive();  // receive one byte
    i++;
  }
  Wire.endTransmission();  
  return i;
}
 
void BH1750_Init(int address)
{
  Wire.beginTransmission(address);
  Wire.send(0x10);//1lx reolution 120ms
  Wire.endTransmission();
}

Thanks before
7  Using Arduino / Project Guidance / Re: Arduino UNO - Automated windows blinds on: February 10, 2013, 12:15:51 am
Hi, I'm currently working on BH1750 too, http://www.dfrobot.com/wiki/index.php/Light_Sensor_(SKU:SEN0097)
I don't understand, how to using it in multiple I2C address/sensor.
Please give me some reference to change the address?

Here the current code I used for 1 sensor (from DFrobot):
Code:
#include <Wire.h> //BH1750 IIC Mode
#include <math.h>
int BH1750address = 0x23; //setting i2c address
 
byte buff[2];
void setup()
{
  Wire.begin();
  Serial.begin(57600);//init Serail band rate
}
 
void loop()
{
  int i;
  uint16_t val=0;
  BH1750_Init(BH1750address);
  delay(200);
 
  if(2==BH1750_Read(BH1750address))
  {
    val=((buff[0]<<8)|buff[1])/1.2;
    Serial.print(val,DEC);    
    Serial.println("[lx]");
  }
  delay(150);
}
 
int BH1750_Read(int address) //
{
  int i=0;
  Wire.beginTransmission(address);
  Wire.requestFrom(address, 2);
  while(Wire.available()) //
  {
    buff[i] = Wire.receive();  // receive one byte
    i++;
  }
  Wire.endTransmission();  
  return i;
}
 
void BH1750_Init(int address)
{
  Wire.beginTransmission(address);
  Wire.send(0x10);//1lx reolution 120ms
  Wire.endTransmission();
}

Thanks before
Pages: [1]