Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: RN41-XV Bluetooth Module and Arduino FIO V3 on: March 27, 2013, 01:49:48 pm
Hi, i usually use serial to usb module and connect the device directly to the computer for settings, afterwards i use the BlueTerm app on android galaxy s2 as a Bluetooth monitor device. but you can use any serial software on pc such as x-ctu, both module and software can be found here
2  Using Arduino / Networking, Protocols, and Devices / Re: RN41-XV Bluetooth Module and Arduino FIO V3 on: March 24, 2013, 08:49:30 am
After i have spent quite a while trying to work with the module (RN42) here is how i worked it out ( i needed to configure the module to serial instead of HID):
I used the XBee Explorer Dongle to connect it to the computer with the x-ctu software, the tutorial for it found on the dongle page.
after connecting to the device with a baud rate set to 115200,
you can enter command mode writing

to set to device to serial interface mode write


tutorials that helped:

Hope it helps,
3  Community / Exhibition / Gallery / Re: My Self Balancing robot -Mini Bot Full documentation on: January 24, 2013, 08:03:28 am
I managed to download the PDF from google docs.

Cool project...and thanks for taking the time to document it.

Can it spin around on two wheels?

It would be neat if the robot could stand up all by itself (4->2 wheels).

There are two video`s the in the second i show a control from an android and there its rotates on two and can stand up by approaching a wall.
4  Community / Exhibition / Gallery / Re: My Self Balancing robot -Mini Bot Full documentation on: January 17, 2013, 01:31:37 pm
added a link to the documentation, hope it works
5  Community / Exhibition / Gallery / My Self Balancing robot -Mini Bot Full documentation on: January 17, 2013, 09:25:11 am
Attached the full documentation of my small self balancing robot with codes included.
Share, Build and have fun.

Will be glad for feedback.

// Links to some video`s of the robot:

added a link to the file if the download fails
6  Using Arduino / Sensors / Re: 3 axes accel MMA7361 as Tilt meter on: October 10, 2012, 02:52:15 am
Hi, i have done the same project using simulink with low pass filters.
I have attached a PDF explaining pretty good the math and principles.
look at eq. 37,38
7  Using Arduino / Programming Questions / Re: Interfacing Arduino with Simulink and embedded M Code on: October 09, 2012, 04:39:05 pm
Hi, I am using an ultrasonic sensor HC-SR04 which has the ping pin separated but i wasn`t able to time the returned echo or even pinging the sensor. (in simulink) how did you manage that?
if your issue is only in separating the pins you can try connecting 2 pins to the ping pin. one to read and one to ping. and add a resistor to the read pin so it won`t short circuit and burn (if it has no internal resistors, i`m not sure at that).

In addition as a fellow matlab user do you have an idea how to read sensors using I2C protocol via simulink?
8  Using Arduino / Project Guidance / Re: feasibility question: turning dc motor to servo? on: October 09, 2012, 02:29:01 pm
Hi, just wanted to add some comment not directly connected to the issue.
i have been working with an industrial robotic arm for some time now. The industrial solution for your issue is by having a high ratio gear motor with high friction. the added friction coupled with a high gear ratio (1:100) improves the precision and reduces the gravity pull effect. in addition you need a high freq control loop to keep the arm well position and in high control. additionally it is common to add a low voltage break. meaning that if your power is cut out your breaks jump in.
hop it helped.
9  Using Arduino / Interfacing w/ Software on the Computer / Re: Serial Monitor (programming in Matlab) on: October 09, 2012, 01:51:15 pm
It is pretty easy interfacing with matlab via the serial, i have tinker with it and its great but remember that matlab isn`t that fast so if you send data to fast your matlab won`t keep up with the streaming and you will see a delay in the data.
the serial interface is basically 2 pins, Rx and Tx ( receive and transmit) with which you send data using bits. all you need to set is the bound rate on both sides and the format of the transmitting data. the arduino will send the data via the serial each time you perform serial.print
i add the files i have used.
10  Using Arduino / Sensors / Re: HC-SR04 for underwater use on: June 30, 2012, 12:27:09 pm
Hi, I was thinking about a similar project, using the sensor as it is won`t work for sure. (or 99%) my plan was to create a custom sonar sensor using the famous piezzo drum discs, but it require some additional circuits and complicated signal processing so i have dropped the idea for now. what is may be possible but haven`t got to it yet and probably not in the close future, is to disamble the hc-sr04 sensor and use its board and actuators separately. sinking the transmitter/receiver as they are underwater (will be damaged by corosion but as long as it is not sea water shouldn't short circuit).

another option is just to buy a waterproof sonar seen one on ebay for 15$

anyway take in count that underwater the speed of sound is different and has different decay, so results will differ (don`t remember numbers).

hope you will have some results to share smiley
good luck.
11  Using Arduino / Sensors / Re: Read 2 HC-SR04 on: June 30, 2012, 10:39:17 am
Changed the code so the returned signal measured in a function. (easier to view)
Attached code for whoever wants to use and modify.
12  Using Arduino / Sensors / Read 2 HC-SR04 on: June 30, 2012, 08:10:56 am
Hi I am trying to read 2 ultrasonic sensors together, so i have used the pulsein function and modified it in my code to read both sensor,it works but the problem is that i`m not sure if the code is correct because i haven't understood the "// cache the port and bit of the pin in order to speed up the pulse width measuring loop"
and just multiplied it to work for 2 sensors, if someone can explain that to me, will be grateful.
attached is the code:
 My attempt for multiple sensors read 29/06/2012
#include "wiring_private.h"
#include "pins_arduino.h"

//define HC-SR04 pins
#define trigPin 22
#define echoPin1 24
#define echoPin2 26

void setup() {
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin1, INPUT);
  pinMode(echoPin2, INPUT);

  //main program
 void loop() {
  //define parameters
  int duration[2], distance[2];
  // send out a ping
  digitalWrite(trigPin, LOW);
  digitalWrite(trigPin, HIGH);
  digitalWrite(trigPin, LOW);
  // measure the returned signal.
  /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH
 * or LOW, the type of pulse to measure.  Works on pulses from 2-3 microseconds
 * to 3 minutes in length, but must be called at least a few dozen microseconds
 * before the start of the pulse. */
        // cache the port and bit of the pin in order to speed up the
   // pulse width measuring loop and achieve finer resolution.  calling
   // digitalRead() instead yields much coarser resolution.
        uint8_t state=HIGH;
        unsigned long timeout=5000;
        uint8_t bit1 = digitalPinToBitMask(echoPin1);
        uint8_t bit2 = digitalPinToBitMask(echoPin2);
   uint8_t port1 = digitalPinToPort(echoPin1);
        uint8_t port2 = digitalPinToPort(echoPin2);
   uint8_t stateMask1 = (state ? bit1 : 0);
        uint8_t stateMask2 = (state ? bit2 : 0);

   unsigned long width[2] ={0, 0}; // keep initialization out of time critical area
   // convert the timeout from microseconds to a number of times through
   // the initial loop; it takes 16 clock cycles per iteration.
   unsigned long numloops = 0;
   unsigned long maxloops = microsecondsToClockCycles(timeout) / 16;
   // wait for any previous pulse to end
   while ((((*portInputRegister(port1) & bit1) == stateMask1) || ((*portInputRegister(port2) & bit2) == stateMask2)) && (numloops< maxloops))
   // wait for the pulse to start
   while (((((*portInputRegister(port1) & bit1) != stateMask1) || ((*portInputRegister(port2) & bit2) != stateMask2))&& (numloops< maxloops)) && (numloops< maxloops))

   // wait for the pulse to stop
   while (((((*portInputRegister(port1) & bit1) == stateMask1) || ((*portInputRegister(port2) & bit2) == stateMask2))) && (numloops< maxloops)){
                if ((*portInputRegister(port1) & bit1) == stateMask1)
                if ((*portInputRegister(port2) & bit2) == stateMask2)

    Serial.print(" - ");

//   // convert the reading to microseconds. The loop has been determined
//   // to be 20 clock cycles long and have about 16 clocks between the edge
//   // and the start of the loop. There will be some error introduced by
//   // the interrupt handlers.
//   duration[0]=clockCyclesToMicroseconds(width[0] * 21 + 16);
//  // convert to distance and display
//  distance[0] = (duration[0]/2) / 29.1;
//  if (distance[0] >= 100 || distance[0] <= 0){
//    Serial.println("Out of range");
//  }
//  else {
//    Serial.print(distance[0]);
//    Serial.println(" cm");
//  }
Pages: [1]