Example Code for Arduino-Analog Read Gyro Voltage

Last revision 2025/12/15

Read analog output voltages from the SD740 module's x, y, z axes and display the results on the serial port. Users can learn how to read analog signals, convert ADC values to voltages, and understand analog sensor outputs.

Hardware Preparation

  • Arduino board: 1 (no specific model mentioned)
  • Tri-Axis Gyro Breakout-SD740 (SKU:TEL0038): 1

Software Preparation

  • Development tool: Arduino IDE (download from Arduino Official Website)
  • Libraries: No external libraries required (uses analogRead function)

Wiring Diagram

Analog Connection

Other Preparation Work

  • Connect the analog outputs of the SD740 to Arduino's analog pins 0 (x), 1 (y), 2 (z)
  • Ensure the module is powered with 3.3V

Sample Code

/*
Gyroscope SD740
Analog output mode
Display the gyro output volts

Version 1.0  Lauren <[email protected]>

Full Scale Range (analog outputs)   °/s   - 64, 128, 256, 512 -
Operating Supply Voltage              V     2.6 - 5% - 3.3 + 5%

Analog Output Range             Vdd * 0.1       -       Vdd * 0.9
Analog Output Sensitivity       V / (°/s)      (Vdd / 2) / Full Scale
Analog Output @ 0°/s           Vdd/2 – 0.05    -       Vdd/2 + 0.05
Analog Output Resolution bit    10

Full scale range is factory defined. Please contact SensorDynamics for setting different ranges. Maximum full scale
factor is 4096°/s
Bandwidth is factory defined. Please contact SensorDynamics for setting different ranges. Maximum bandwidth is
150Hz
*/


void setup(){

  Serial.begin(57600);

}

void loop(){

  float voltX,voltY,voltZ;

  voltX = analogRead(0) * 5.0 / 1024.0;
  voltY = analogRead(1) * 5.0 / 1024.0;
  voltZ = analogRead(2) * 5.0 / 1024.0;

  Serial.print("x: ");
  Serial.print(voltX,5);
  Serial.print(" v\ty: ");
  Serial.print(voltY,5);
  Serial.print(" v\tz: ");
  Serial.print(voltZ,5);
  Serial.println(" v\t Reference: 3.3v");

  delay(50);

}

Result

The serial port (baud rate 57600) outputs the x, y, z analog voltages in the format "x: [value] v y: [value] v z: [value] v Reference: 3.3v".

Additional Information

  • Warning: Please only use 3.3V to supply power to the Gyroscope.
  • Analog output sensitivity is calculated as (Vdd / 2) / Full Scale; Vdd is the supply voltage (3.3V).

Was this article helpful?

TOP