Post a new topicPost a reply Page 1 of 1   [ 8 posts ]
Author Message
 Post subject: Maxbotix HRXL7360 Sensor
PostPosted: Mon Aug 13, 2012 4:38 pm 

Joined: Wed Jul 25, 2012 5:40 pm
Posts: 5
Hello,

I am having trouble getting a new Maxbotix HRXL7360 (1mm resolution, outdoor rated) sensor to work on a Smart Metering board. I would imagine it should behave the same as the other maxbotix sensors, though it doesn't have it's own type defined in the API. Is it acceptable to simply use the EZ0 as the type, or is there a different function that I should be using to control it? The board will reset before blinking the LEDs at line 106, though the board doesn't reset when the smart metering board isn't plugged in. Any ideas?

Code:
/*
 *  ----- wasp_start_program_full_900_v2------
 *
 *  Explanation:
 *
 *  Waspmote starting program for XBee 900 module. This program
 *  initializes the XBee module, prepares the frame to send and every
 *  second it sends it.
 * 
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version:                0.2
 *  Design:                 David Gascon
 *  Implementation:         Marcos Yarza, Alberto Bielsa, Yuri Carmona
 */


packetXBee* paq_sent;
int8_t state=0;
long previous=0;
char aux[200];
char* macHigh="          ";
char* macLow="           ";
int aux_1 = 0;
int aux_2 = 0;

#define key_access "LIBELIUM"

uint8_t direccion[8]={0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF};

void setup(){

  // Store key access in EEPROM
  for(int i=0;i<8;i++){
    Utils.writeEEPROM(i+107,key_access[i]);
  }

  RTC.ON();
  SensorSmartv20.setBoardMode(SENS_ON);
 
  XBee.setMode(XBEE_ON);
  XBee.begin(9600);
  delay(1000);
  XBee.print("+++");
  delay(2000);
  XBee.println("ATBD5,AP2,WR,CN");
  delay(150);
 
  XBee.setMode(XBEE_OFF);
  XBee.close();
   
  Utils.setLED(LED0, LED_ON);
  Utils.setLED(LED1, LED_ON);
  delay(5000);
  Utils.setLED(LED0, LED_OFF);
  Utils.setLED(LED1, LED_OFF);
  for (int i=0;i<24;i++){
    Utils.blinkLEDs(125);
  }
 
  // Inits the XBee 900 library
  xbeeDM.init(XBEE_900,FREQ900M,NORMAL);
 
  // Powers XBee
  xbeeDM.ON();
 
  // Get the XBee MAC address

  delay(500);
 
  int counter = 0; 
  while(xbeeDM.getOwnMac()==1&&counter<4){
    xbeeDM.getOwnMac();
    counter++;
  }
 
  Utils.hex2str(xbeeDM.sourceMacHigh,macHigh,4);
  Utils.hex2str(xbeeDM.sourceMacLow,macLow,4);
 

}

void loop(){
 
  SensorSmartv20.setSensorMode(SENS_ON, SENS_SMART_US_3V3);
  Utils.setLED(LED0,LED_ON);
  delay(125);
  Utils.setLED(LED0,LED_OFF);

  float value_ultrasound = 0;
  Utils.setLED(LED1,LED_ON);
  delay(125);
  Utils.setLED(LED1,LED_OFF);
 
  value_ultrasound= SensorSmartv20.readValue(SENS_SMART_US_3V3, SENS_US_EZ0);
  Utils.setLED(LED1,LED_ON);
 
  SensorSmartv20.setSensorMode(SENS_OFF, SENS_SMART_US_3V3);
  Utils.setLED(LED0,LED_ON); 
  delay(500);
  Utils.setLED(LED0,LED_OFF);
  Utils.setLED(LED1,LED_OFF); 
 
  char voltage[7];
  Utils.float2String(value_ultrasound, voltage, 4);
 
  sprintf(aux,"-mac:%s%s -v:%s -temp:%d -bat: %d%c%c%c%c ",macHigh,macLow,voltage,(int)RTC.getTemperature(),PWR.getBatteryLevel(),'%','\r','\n','\n');
  Utils.blinkLEDs(125);
  delay(125);
  Utils.blinkLEDs(125);
 
  paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee));
  paq_sent->mode=BROADCAST;
  paq_sent->MY_known=0;
  paq_sent->packetID=0x52;
  paq_sent->opt=0;
  xbeeDM.hops=0;
  xbeeDM.setOriginParams(paq_sent,MAC_TYPE);
  xbeeDM.setDestinationParams(paq_sent, direccion, aux, MAC_TYPE, DATA_ABSOLUTE);
  xbeeDM.sendXBee(paq_sent);
 
  free(paq_sent);
  paq_sent = NULL;
 
  delay(1000);
}


Top
 Profile  
 
 Post subject: Re: Maxbotix HRXL7360 Sensor
PostPosted: Tue Aug 14, 2012 12:01 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
Hi nvalinski,

I'm afraid we have no experience with this specific sensor, so we cannot be very helpful regarding its integration, but I'd say EZ0 conversion won't fit, you'll have to perform a raw reading of the sensor and write your own conversion function.

Regarding the reset, did you connect a charged battery when performing your tests?

Regards.


Top
 Profile  
 
 Post subject: Re: Maxbotix HRXL7360 Sensor
PostPosted: Tue Aug 14, 2012 3:00 pm 

Joined: Wed Jul 25, 2012 5:40 pm
Posts: 5
It is fully charged... what would be the function to do a raw reading?


Top
 Profile  
 
 Post subject: Re: Maxbotix HRXL7360 Sensor
PostPosted: Fri Aug 17, 2012 9:35 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
Hi nvalinski,

could you please add some USB.print messages in order to debug at which exact line is your mote reseting?

Regards.


Top
 Profile  
 
 Post subject: Re: Maxbotix HRXL7360 Sensor
PostPosted: Mon Aug 27, 2012 4:49 pm 

Joined: Wed Jul 25, 2012 5:40 pm
Posts: 5
Based on the LED blinks, it is resetting after line 103 and not reaching line 106... does that help at all?


Top
 Profile  
 
 Post subject: Re: Maxbotix HRXL7360 Sensor
PostPosted: Wed Aug 29, 2012 10:27 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
nvalinski,

Please turn on sensor board before turning ON RTC, and it is a good idea to add small delays to let supply lines become stabilized.

Regards


Top
 Profile  
 
 Post subject: Re: Maxbotix HRXL7360 Sensor
PostPosted: Wed Aug 29, 2012 5:07 pm 

Joined: Wed Jul 25, 2012 5:40 pm
Posts: 5
I've made some modifications, though now it appears as though it is stopping at turning the actual sensor on (line 103). I've attached the code below:

Code:
/*
 *  ----- wasp_start_program_full_900_v2------
 *
 *  Explanation:
 *
 *  Waspmote starting program for XBee 900 module. This program
 *  initializes the XBee module, prepares the frame to send and every
 *  second it sends it.
 * 
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version:                0.2
 *  Design:                 David Gascon
 *  Implementation:         Marcos Yarza, Alberto Bielsa, Yuri Carmona
 */


packetXBee* paq_sent;
int8_t state=0;
long previous=0;
char aux[200];
char* macHigh="          ";
char* macLow="           ";
int aux_1 = 0;
int aux_2 = 0;

#define key_access "LIBELIUM"

uint8_t direccion[8]={0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF};

void setup(){

  // Store key access in EEPROM
  for(int i=0;i<8;i++){
    Utils.writeEEPROM(i+107,key_access[i]);
  }

  SensorSmartv20.setBoardMode(SENS_ON);
  RTC.ON();
 
  XBee.setMode(XBEE_ON);
  XBee.begin(9600);
  delay(1000);
  XBee.print("+++");
  delay(2000);
  XBee.println("ATBD5,AP2,WR,CN");
  delay(150);
 
  XBee.setMode(XBEE_OFF);
  XBee.close();
   
  Utils.setLED(LED0, LED_ON);
  Utils.setLED(LED1, LED_ON);
  delay(5000);
  Utils.setLED(LED0, LED_OFF);
  Utils.setLED(LED1, LED_OFF);
  for (int i=0;i<24;i++){
    Utils.blinkLEDs(125);
  }
 
  // Inits the XBee 900 library
  xbeeDM.init(XBEE_900,FREQ900M,NORMAL);
 
  // Powers XBee
  xbeeDM.ON();
 
  // Get the XBee MAC address

  delay(500);
 
  int counter = 0; 
  while(xbeeDM.getOwnMac()==1&&counter<4){
    xbeeDM.getOwnMac();
    counter++;
  }
 
  Utils.hex2str(xbeeDM.sourceMacHigh,macHigh,4);
  Utils.hex2str(xbeeDM.sourceMacLow,macLow,4);
 

}

void loop(){
  USB.println("Start Loop");
  delay(50);
 
  SensorSmartv20.setSensorMode(SENS_ON, SENS_SMART_US_3V3);
  USB.println("Sensor On");
  delay(50);

  float value_ultrasound = 0;
  USB.println("Float Established");
  delay(50);
 
  value_ultrasound= SensorSmartv20.readValue(SENS_SMART_US_3V3, SENS_US_EZ0);
  USB.println("Reading OK"); 
 
  SensorSmartv20.setSensorMode(SENS_OFF, SENS_SMART_US_3V3);
  USB.println("Sensor Off");
  delay(50);
 
  char voltage[7];
  Utils.float2String(value_ultrasound, voltage, 4);
  USB.println("Float to String");
 
  sprintf(aux,"-mac:%s%s -v:%s -temp:%d -bat: %d%c%c%c%c ",macHigh,macLow,voltage,(int)RTC.getTemperature(),PWR.getBatteryLevel(),'%','\r','\n','\n');
  Utils.blinkLEDs(125);
  delay(125);
  Utils.blinkLEDs(125);
 
  paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee));
  paq_sent->mode=BROADCAST;
  paq_sent->MY_known=0;
  paq_sent->packetID=0x52;
  paq_sent->opt=0;
  xbeeDM.hops=0;
  xbeeDM.setOriginParams(paq_sent,MAC_TYPE);
  xbeeDM.setDestinationParams(paq_sent, direccion, aux, MAC_TYPE, DATA_ABSOLUTE);
  xbeeDM.sendXBee(paq_sent);
 
  free(paq_sent);
  paq_sent = NULL;
 
  USB.println("Data Sent");
 
  delay(1000);
}


Any thoughts?


Top
 Profile  
 
 Post subject: Re: Maxbotix HRXL7360 Sensor
PostPosted: Thu Aug 30, 2012 9:33 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
nvalinski,

After the conversation we have had, it seems you may be interested in a special support service or a customized engineering service.

As you will know, we are Wireless Sensor Networks hardware manufacturers. On addition to that, we provide with a complete software system to control our hardware and comprehensive documentation. We are committed to support the clients in the development process through the forum, but we cannot implement the final solution for each project.

Some clients just do not want to implement the software for their projects and prefer us to do it for them, or maybe they find it complicated. In these cases we offer special services like:
1. a number of one-to-one support hours with one engineer on our online e-learning platform. You can have direct line with one of our experts and if you like we can access your desktop in a remote way.
2. general training courses which are a great introduction to our systems.
3. specific training course, focusing on the features and modules you need to handle.
4. customized engineering: you can let us know the list of tasks your system needs to work out, and our R&D Dept. can develop all the project for you.


Please visit this area regarding training: http://www.libelium.com/products/training
and this one about custom engineering: http://www.libelium.com/products/services

Do not hesitate to ask any questions you may have.

Best regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 8 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use