Go Down

Topic: multiple maxbotix LVEZ on one UNO? (Read 14981 times) previous topic - next topic


I am making a miniature imitating a room with a door. I searched how to connect the  sensor's pw to the digital output of Arduino but I didn't succeed. If I won't do a daisy chaining what type shall I pick? I am trying to figure the schematic out so I can start with the source code.


So I've connected the sensors to analog output. First sensor GND to GND +5v to +5v and Analog to A0.Second sensor Gnd to Gnd +5v to digital pin 5 and analog to A1. I've made a source code but only one sensor detects motion. I am having problem with making them detect motion only when a person is in the room (when sensor 1 detects and after that sensor 2 detcts motion). here is the source code
#define senzor_1 0  //// pinul analogic 0
#define senzor_2 1
int Val_1;
int Val_2;
int Buzz = 8; // pinul 8 la care este conectat

void setup()
  pinMode(Buzz, OUTPUT);

void loop()
  Serial.print("Senzor 1 :");
  Serial.print("Senzor 2 :");

  if((Val_1 < 12) || (Val_2 < 12))
    tone (7,524,250);


You need to divide Val_1 and Val_2 by 2 in order to get inches. If you want centimeters, you have to then multiply that result by 2.54.

Also your sensors are almost certainly interfering with each other. Can't you just use one sensor? If not you need to daisy chain them or learn how to trigger them. There are instructions on how to trigger them earlier in this thread.

Go Up