Forum >Replies by robert
userhead robert
Replies (20)
  • You Reply: Hey Shruti,
    I will try to answer your questions one by one. We can ship to India no problem! The DFR0548 can support a maximum of 9 sensors which connect to the microbits pins P0, P1, P2, P8, P12, P13, P14,P15,16. It is not necessary to use the PH2.0-3P connector, however it is recommended because of its easy plug and play and cable management features. Fast ranging implies the ability of the sensor to quickly send out ultransonic signals and then retreive the information back to get a reading, essentially this means the sensor has a very fast response time to get a measurement. As for your zero output, could you kindly post a picture of your connection setup and the code you are using for the Analog Ultrasonic sensor so we can debug that further.
    Some applications for the driver expansion board and ultrasonic sensor include making obstacle avoiding cars, a mobile distance measuring system, or include more even more sensors and begin creating an autonomous vehicle. There really is no limit to what you can do, you just have to think of a fun project! You can check out the DFRobot blog for inspiration as well.
  • You Reply: Hey Daniel,
    Can you email with pictures of your setup and the code file you are using. Since you are experiencing a series of difficulties we need some more information to further diagnose the problem. In the email could you provide just a quick summary of the issues you are now running into and the relevant output of the serial monitor, as well as a photo of your setup and the code. Thanks for your patience.
  • You Reply: Hey,
    Can you test that the battery is outputting a stable 6V. The Roemo V2 has a voltage input range between 6v-23V for external power (batteries in your case). Since you are right at the minimum level I assume the issue is related to not supplying enough power from your batteries.
  • You Reply: For a quick fix, this is what I recommend you to use:
    I'd make your http_cmd around 200 characters long as well.
    Code: Select all
      char latiString[12];
      char longiString[12];
      dtostrf(lati, 2, 2, latiString);  
      dtostrf(longi, 2, 2, longiString);
      sprintf(http_cmd, "POST submit.php HTTP/1.0 \r\nContent-Type: application/x-www-form-urlencoded \r\nUser-Agent: Mozilla/5.0 \r\n\r\nx=%s y=%s ",latiString,latiString);
      Serial.println(http_cmd); 
  • You Reply: Hey Daniel,
    One of the issues is you are declaring an array of 100 characters for your http_cmd varaible, however when you sprintf to it you are overflowing it (you are adding more than 100 characters to the variable). Additionally, %f is not supported for sprintf in the Arduino Library. Therefore you would need to use dtostrf(). Would you like to message on Skype or another platform so I can get realtime feedback to help you. I've seen you've had some trouble for a bit and would like to help you out as soon as possible!
  • You Reply: Yeah no problem at all. Let me know if any progress was made. If not I can look at it again and explore some other avenues.
  • You Reply: Hey,
    You can check out the product datasheet here:
    http://image.dfrobot.com/image/data/SEN ... -6000A.pdf
    Under the section 7.8 Three-Axis MEMS Accelerometer with 16-bit ADCs and Signal Conditioning you can find the relative information you are looking for.

    For the more technical approach please take a look here:
    http://image.dfrobot.com/image/data/SEN ... -6000A.pdf
    Under the 2. Accelerometer Hardware Self-Test: Relative Method

    You can check out our product page here https://www.dfrobot.com/product-880.html that uses the MPU6050 chip. The library contains two examples, one for just raw data and one linked to processing sketch with interpolated data.
  • You Reply: Hey Daniel,
    I am currently reviewing the library and testing it here. Could try a small change for me and connect using the following code with no username and password fields
    Code: Select all
     
    delay(3000);
    while(!sim808.join(F("internet"))) {
          Serial.println("Sim808 join network error");
          delay(2000);
      }
    And then just to confirm could you send us a screenshot of your serial output.
  • You Reply: After reviewing your code I noticed there are a problems with how you handle your string arrays. Firstly your code logic induced serious memory overhead where it did not need to. But more importantly, there are some bigger problems. You can not redelcare the http_command in the same scope which you do in the second method. Instead you should just set all of its values in memory to zero and then concatenate the parts you would like. I suggest the start to your looks like this:
    Code: Select all
    //-----------------------------//---Test data------//----------------- 
    //char http_cmd[] = "GET /datos.json?Latitud=9.678&longitud=15&ano=2019&mes=7&dia=20&hora=10&segundos=14 HTTP/1.1\r\nHost: d3n5q9vmna3dck.cloudfront.net\r\n\r\n";
      Serial.println(" IN HERE 2222222222!");
    
     //This will set http_cmd to just lat and long and year
     char http_cmd[300]="GET /datos.json?Latitude=";
     char host[80]="HTTP/1.1\r\nHost: d3n5q9vmna3dck.cloudfront.net\r\n\r\n"; 
     strcat(http_cmd,lat);
     strcat(http_cmd,"&Longitud=");
     strcat(http_cmd,lon);
     strcat(http_cmd,"&ano=");
     strcat(http_cmd,year);
    
      strcat(http_cmd," "); 
      strcat(http_cmd,host);
      Serial.println(http_cmd);
    
      //YOU SHOULD CALL A GET REQUEST HERE FOR JUST THE LAT/LONG/YEAR data
    
    
    
    
    
      //This "resets" http_cmd in memory and then assigns it MESSAGE value  
      memset(http_cmd, 0, 300);
      strcat(http_cmd,"HTTP/1.1\r\nHost: d3n5q9vmna3dck.cloudfront.net\r\n\r\n");
      strcat(http_cmd,MESSAGE);     
      strcat(http_cmd," "); 
      strcat(http_cmd,host);
    
    
    
     //YOU SHOULD CALL A GET REQUEST HERE FOR JUST THE MESSAGE value
    
  • You Reply: Hey I am looking into your code now. Could you tell me the output of your Serial.println(http_cmd); in the first method. It will help with the debugging process. Thanks,
  • You Reply: Hey Maria,
    In this case I would suggest of ToF sensor (lasers), which can be found here: https://www.dfrobot.com/product-1599.html?search=TOF . However we have not tested such devices on a platform that mimics the vibrations found on a plane. You should try to isolate and stabilize your measurement platform as much as possible to avoid outside interference.
  • You Reply: Hey Maria,
    Unfortunately the URM04 sensor is not rated at any IP rating, therefore we do not the exact specifics of its ability to resist dust. Since it is an ultrasonic sensor luminosity will not have a significant affect on the measurements unless the light source is strong enough to erode the PCB board and connections (which is quite hard). However, strong vibrations will have an affect on your sensor. The sensor works based on sending out sonic waves (which is done through vibrating a diaphragm). Therefore I do not suggest you submitting it to strong vibrations on a consistent basis.
  • You Reply: Hey Maria,
    Please refer to the user manual for the URM04 sensor to understand its communication protocol. In this manual you can get a full understanding of the communication protocol. It can be found here: http://image.dfrobot.com/image/data/SEN ... ual1.1.pdf And it will remember the address after being restarted. SUM refers to the checksum value for the sent data. The sum will take the lower two bits for the sum of all the pervious hex data values. For example, if you send the following command :
    0x55 0xaa 0x11 0x00 0x03 SUM (which reads temp BTW)
    You will add 0x55+ 0xaa+ 0x11+ 0x00+ 0x03 , which equals 0x113. Then you take the lower 2 bits of this sum, which is 13 and this is your SUM value
    Therefore your final command is
    0x55 0xaa 0x11 0x00 0x03 0x13

    As for your first question, there is no abstract data structure being sent. Instead you are merely reading direct hex values whose position corresponds to the communication protocol established. Therefore any system that you set up that can interpret RS485 communication (using your Siemens module) just needs to read the hex output. To send a command you simply send the corresponding hex command as well. You do not have to worry about abstract data structures.
  • You Reply: The first option you have is to reset the bluetooth settings on the Bluno board. To do that you have to send AT commands to your Bluno device. Please take a look at our Bluno's BLE wiki page under the "Configure the BLE through AT command" section. You can follow those steps exactly and stop after step 11. This will reset your settings to default. After this try reconnecting to your device from your phone and let us know the outcome.

    The wiki page is here: https://wiki.dfrobot.com/DFRobot_Blueto ... User_Guide
  • You Reply: Hey Maria,
    Thanks for the interest. I'll try to tackle your questions one at a time. The URM04 sensors can be connected in series up to 34 total sensors, so you should be fine there!
    As for your other questions regarding communincation, please note the URM04 sensor only uses RS485 as its communication interface. Therefore you will need a bridge to convert RS485 to TTL to communicate with your CPU. However, I did note that the linked communication module does inherently support RS485 protocol. Therefore you will not need to have a separate chip to send commands to the sensors.
    Now to communicate with individual sensors relies more on your code architecture more than the hardware. Each sensor can be assigned a unique address, and therefore to poll individual sensors you will send commands to that specific address. Therefore you first should assign 30 unique addresses for the sensors, and then store this information in an array for example. This will allow you to target specific sensors as you please.
    Please check out the product wiki and the corresponding user manual to get a full understanding of the URM04 sensor: https://wiki.dfrobot.com/URM04_V2.0__SKU_SEN0002_
    http://image.dfrobot.com/image/data/SEN ... ual1.1.pdf
  • You Reply: Hey to calculate the checksum you add all the hex values received before the last byte (the checksum byte) and then only take the last two values of that summed number. So for example,
    0x55+0xAA+0x11+0x00+0x02= 0x112 , therefore the checksum will be 12 (the last two values).
  • You Reply: Hey to calculate the checksum you add all the hex values received before the last byte (the checksum byte) and then only take the last two values of that summed number. So for example,
    0x55+0xAA+0x11+0x00+0x02= 0x112 , therefore the checksum will be 12 (the last two values).
  • You Reply: Well in that case you can completely ignore the receiving text portion. In your main loop you will continuously check if the condition is met and once it is met, you can then send the text message. Here is the psuedo code for that:

    //Hardware Setup
    //Plug shield onto your arduino uno
    //Connect Digital Pin 7 to the RX pin in the jumper cap using a cable
    //Connect Digital Pin 8 to the TX pin in the jumper cap using a second cable
    //Whatever sensor you have

    #include <SoftwareSerial.h>
    SoftwareSerial myserial(7, 8); //Define virtual serial port name as myseria,Rx is port 7, Tx is port 8
    bool contitionToSend=false;
    void setup() {
    myserial.begin(115200); //Initialize virtual serial port
    Serial.begin(115200); //Initialize Arduino default serial port
    }

    void loop(){

    //Here read your sensor or whatever you are testing your condition
    //once it is met
    //conditionToSend=true

    if(contitionToSend==true){
    //Send a text
    myserial.write("AT+CMGF=1\n");
    //Replace 5555..5 with your **
    myserial.write("AT+CMGS=\"555555555\"\n");
    myserial.write("My condition was met\n");
    myserial.write(0x1A);
    }
    }
  • You Reply: Hey,
    Unfortunately there is no SIM7600 library. However, you can use the following github link https://github.com/DFRobot/DFRobot_SIM to get an overview of how to send AT commands to your Sim module. The linked library provides a solid foundation to guide how to send and receive texts. I highly suggest you take a look at the product wiki page https://wiki.dfrobot.com/SIM7600CE-T_4G ... KU_TEL0124 . Here we have examples of sending and receiving text messages which are done using AT commands through a serial communication tool.
    I wrote some psuedo code below to help you get started synthesizing the two sources

    setup area {
    //Here do normal serial setup for your board and establish serial connection to communication with the SIM module
    Write "AT" to the SIM module serial port
    Read response and check if == "OK"
    }

    main loop area{

    //Send a text
    numbertToSendTo="555555555"
    Write "AT+CMGF=1" to SIM module serial
    Read response and check it =="OK"
    //Set the number you want to send to
    Write "AT+CMGS=" + "numberToSendTo"
    //This is where you would send the data you would like
    //You must send a hex value of 1A since this key value will send the text
    Write DataYouWantToSend +hexValue(1A)
    Read response and check it =="OK"

    //Receive a text

    //Your sim module will write to the designated serial port automatically if it receives a text
    //This is designated by a keyword CMTI "SM", num , where num is the waiting number of messages
    Read Serial and see if "+CMTI:: 'SM',1" is received
    Write "AT + CMGR=1"
    Read Serial to get the text message info
    //Format for text received is
    //+CMGR: "REC READ", "** who sent the text", "","Time it was received"
    // Then the message

    }
  • You Reply: Hey ,
    Great question. You can actually check out another users blog post who writes temperature data to their attached SD card. You can find that post here: https://www.dfrobot.com/blog-900.html
    Some key things to note is the need to use the Arduino SD library, which can be imported at the top of your file by simply writing #include <SD.h> . You then to initialize the card in the setup area, and then in your main loop you can begin writing to whatever file you choose. The basic outline of your code will look like:

    #include <SPI.h>
    #include <SD.h>

    //This chipSelect value is determined by your wiring setup (essentially where you put the chipSelect pin output to)
    const int chipSelect = 4;

    void setup() {

    Serial.begin(9600);

    Serial.print("Initializing SD card...");

    // see if the card is present and can be initialized:
    if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
    }
    Serial.println("card initialized.");
    }

    void loop() {
    // make a string for assembling the data to log:
    String dataString = "";

    //This is what data you want to write to your SD card
    dataString += (String)yourData

    // open the file. note that only one file can be open at a time,
    // so you have to close this one before opening another.
    File dataFile = SD.open("data.txt", FILE_WRITE);

    // if the file is available, write to it:
    if (dataFile) {
    dataFile.println(dataString);
    dataFile.close();
    }
    // if the file isn't open, pop up an error:
    else {
    Serial.println("error opening data.txt");
    }
    }