Show Posts
Pages: [1] 2 3
1  Using Arduino / Interfacing w/ Software on the Computer / Exchanging data between Arduino and Simulink via serial on: March 11, 2014, 12:50:21 am

I want to send 1 int from Simulink to Arduino and get it back in Simulink.
I send 1, but get back 48.
What am i doing wrong ?

nt incomingByte = 0;   // for incoming serial data
int x;

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps

void loop() {

        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte =;
                //x = incomingByte >> 32;
                x = incomingByte << 32;

                // say what you got:
                //Serial.print("I received: ");
                //Serial.println(incomingByte, DEC);

Simulink file is attached.
2  Using Arduino / Project Guidance / Re: Displaying GPS output on serial monitor on: May 09, 2012, 02:29:59 am
Hi Paul

I added the following  line in the code after line 86;//line 86
I see a bunch of strange characters on the serial monitor.

GPS shield LED glows, Switch for the shield is in the on position and the other switch is set to DLINE.
Nothing glows on the GPS module(EM406A). It just sits there.
No leds glowing/blinking. I waited about 10 minutes outside  to see if anything would start up, but no luck.
3  Using Arduino / Project Guidance / Displaying GPS output on serial monitor on: May 08, 2012, 05:50:46 am

I have the following GPS shield
and the EM406A GPS module.

I am using the Arduino-Uno with Arduino 1.0 IDE
I use the GPS test parsing sketch found here
The code is also attached to this message
I compile and upload without any problem, when i open the serial monitor it just prints out the line "Read" as given in line 104 of the sketch, but doesn't display anything else.
What am i missing? How do i tell if my GPS is transmitting anything, or whether it has got a lock?

4  Using Arduino / Project Guidance / Logging analog, digital and pwm data on: April 27, 2012, 04:42:16 am
Hi Everyone

I have been using the sketch supplied with the logger shield( and it seems to work fine.
I want to record the surface deflections on my rc aircraft. So i was planning to take a tap out of the servo potentiometers, but that would mean large wire lengths(about a meter) leading to the datashield. Is it good to transmit analog signals over this range?

I would also like to record pwm inputs from my radio and angular rates from a gyro(available as a digital signal).
I see from shieldlists that the logger shield has pins A0-A3 free. What about the digital pins, could i use them to record these values.
Wouldn't an elegant solution be to mux all these signals and send them to the logger shield?

I am an electronics noob and i need some help on this.

5  Using Arduino / Microcontrollers / Re: Compiling and uploading code without an IDE on: August 09, 2011, 07:08:27 pm

Suppose i have a custom board for an embedded application, using let's say LPC1768 or STM32F2 ARM cortex M3 series of processors.
How would i port binary.hex code onto it?
Which compilers would you recommend?

6  Using Arduino / Microcontrollers / Compiling and uploading code without an IDE on: August 09, 2011, 12:50:18 pm
Hi everyone

These are my first forays into embedded programming.
Is it possible to cross-compile the code and push it into an Arduino UNO/Mega without using the ide.
I know that it uses the avr-gcc cross-compiler, but how do i push the binaries/hex into the board.

7  Using Arduino / Networking, Protocols, and Devices / Determining Xbee frequency on: May 28, 2011, 04:06:45 am

I bought an XBee Pro 60mW Chip Antenna (with breakout board) secondhand.
How do i determine it's frequency?
Is it 900MHz or 2.4GHz?


8  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: April 13, 2011, 08:37:51 am
I am using the Ardu-Imu

R is the co-variance matrix. It should typically be the square of the standard deviation of the Gyro.
I think it should be there in the datasheet, or you could just keep things stationary and log the data for about 5 mins.
Calculate the mean and std deviation.

9  Using Arduino / Sensors / Re: Guide to gyro and accelerometer with Arduino including Kalman filtering on: April 13, 2011, 05:58:41 am
Awesome work

I am making a 3 axis rate table to measure how accurate the imu is.
I want to answer the following questions
1)For a  given set of sensors, how can i get the best possible performance from my Kalman filter in estimating angles.
2)Now that the "optimal" Kalman filter code is identified, can i achieve better performance by choosing better gyros and accelerometers.

10  Topics / Science and Measurement / Re: Encoders and Arduino on: April 13, 2011, 12:43:56 am
Looking again at page-3 of the catalog again, i am thoroughly confused.
I think i should order
S-Solid shaft
5-50mm outer dia
25-2500 pulses/revolution
V-Output form(Voltage)
B-A and B channel without Z channel
5-5mm bore dia
5-5V DC input
1-Benign operating environment
A-300mm wire
How many input and output wires will this encoder have?
My guess is inputs- (Gnd,Vin) and outputs- (A,B)
If you look at the E-series of encoders
Output voltage is given as Vin-2V or VCC-2V
So does this mean there are 3 inputs(Ground, Vin, VCC?)

What is a open collector or line-driver output?

11  Topics / Science and Measurement / Re: Encoders and Arduino on: April 12, 2011, 11:32:36 pm
I was looking at the ROE-C series, on the last page(10) of the catalogue with open collector output.

I need to choose an encoder that doesn't have many wires
I am not keen on having so many wires, as it will consume pins on the Arduino. So could you suggest some other brand/make of encoder?

Shouldn't an encoder have just 4 wires?
1 for ground
2 for power
3 for angle increment
4 for sign(direction of rotation)
12  Topics / Science and Measurement / Re: Encoders and Arduino on: April 12, 2011, 08:51:03 pm
Thanks Rugged Circuits
No. That's a surprising number. Are you sure it isn't just an "open collector" output that floats to around 2V? Do you have a part number? You can check it easily by connecting a 10k resistor from the output to +5V. If it's still 2V then it really is 2V, but my guess is you will measure 5V.
This is the encoder, i am looking at

I haven't bought it yet, so i can choose another one, if you have any suggestions.
I want to measure rotation angle precisely (for clockwise and ccw rotations).
So i would like it to output a high number of pulses per revolution.
What is the maximum number of pulses per second, that could be detected by an Arduino?

Do i need to ensure the Arduino and the encoders have a common ground?
Do i just connect the DC power source ground to the Arduino ground with a wire? Or Should i have some resistor in between?
13  Topics / Science and Measurement / Encoders and Arduino on: April 12, 2011, 12:18:39 pm

I have an encoder that takes an input of 5V.
I don't want to power the encoder using the Arduino, as i will be using 3 such encoders.
I want to power the encoders with a separate DC power supply(that will also be powering some motors).
This is were my confusion begins
1)Do i need to ensure the Arduino and the encoders have a common ground?
2)Can i power the Arduino via USB and power the encoders with an external DC power supply?
2)The encoder outputs a high of 2V. If i connect it to a digital I/O pin, will the Arduino detect it?


14  Using Arduino / Motors, Mechanics, and Power / Re: Servo motors on: March 31, 2011, 11:30:47 pm
Your description of the test method seems open-loop. There was no explanation of how to correlate the Ardu-IMU data with the turntable position / speed / orientation.  For that matter, how do you even know the instantaneous information about the turntable?  And how do you get the data from a spinning Ardu-IMU?

Sorry for not being clearer.
I have an Xbee shield that will sit on the Ardu-imu on the rotating disk, that will act as the transmitter.
Another Arduino will sit on the ground with an Xbee shield(reciever) and a Datalogger shield.
This stationary Arduino will log the encoder signal and the Ardu-imu data with time-stamps. This way i will have correlation between rpm of the rotating disk and the imu data.
Therefore as long as my encoder is accurate, i can treat it as a benchmark to evaluate the imu.

15  Using Arduino / Motors, Mechanics, and Power / Re: Servo motors on: March 31, 2011, 07:54:01 pm

Why do you say, that the test system has lower reliability than the Ardu-IMU?
Shouldn't the accuracy of the test system be determined by the least count of the encoder?
I want to also modify some of the code on the IMU and check the results, to see if it gives a more accurate result.
Won't a stepper motor have backlash error?

Unfortunately i threw away my record player about 3 yrs ago. So how do i achieve such low rpm's

Pages: [1] 2 3