Powered by Modern Robotics

0 $0.00

Cart

No products in the cart.
Shop

Cal Current Sensor

$19.95

Measure current between -12.5A and 12.5A with an accuracy of 55mV/A.

Out of stock

Join the waitlist to be emailed when this product becomes available

SKU: 45-2303 Category:

Description

To use this sensor:

  1. Determine the offset by taking an average reading with no current passing through the sensor. This value is usually ~485
  2. When current is passing through the sensor, take many readings (we use 100) to obtain an average.
  3. To get current, subtract the offset and then divide by 32.

current = (average – offset) / 32

Cable not included

For example, below, we graphed the current going into a motor controller against the power being sent to the motor.

Another application would be to know when a motor is stalled. When a motor stalls, the current spikes to multiple times the normal operating current. Your program can then turn off power to that motor or try driving the opposite direction.

Sensor Type
Three Wire Analog Sensor
Dimensions
32 mm x 32 mm x 5 mm
Mounting Holes
24 mm x 24 mm, 4mm ⌀
Power
3 V or 5 V DC, 5 mA
Signal Logic Levels
Analog 0 V – (3 or 5) V

Additional information

Weight .0120 lbs
Dimensions 3 × 4 × .5 in

FTC SDK

Android Studio Example Program

Download the below program for an example of how to read this Analog sensor. The FTC SDK will supply a value from 0-5 representing a voltage.

In your configuration file, name an Analog Input “light” and name a Core Device Interface Module “Device Interface Module 1”

/*
Modern Robotics Analog Example
Created 7/25/2017 by Colton Mehlhoff of Modern Robotics using FTC SDK 3.10
Reuse permitted with credit where credit is due

The Modern Robotics Core Device Interface reads analog input
using a 10 bit value meaning the Android Phone reads a value from 0 to 1023.
The FTC SDK supplies a "voltage". The SDK is scaling this value of 0-1023 to 1-5 with decimal places.

Configuration:
Analog Input on Core Device Interface "light"
Core Device Interface named "Device Interface Module 1"

Support is available by emailing support@modernroboticsinc.com
*/

package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.AnalogInput;
import com.qualcomm.robotcore.hardware.DeviceInterfaceModule;


@TeleOp(name = "Analog Example", group = "MRI")
//@Disabled
public class MRI_Analog_Example extends LinearOpMode {

    //An Analog Input. In this example, we used a Light Sensor although it could be any analog sensor.
    AnalogInput MRLightSensor;

    //CDI. Using this, we can read any analog sensor on this CDI without creating an instance for each sensor.
    DeviceInterfaceModule cdi;

    @Override
    public void runOpMode() {
        telemetry.addData("Status", "Initialized");
        telemetry.update();

        //Link objects to configuration file
        MRLightSensor = hardwareMap.analogInput.get("light");
        cdi = hardwareMap.deviceInterfaceModule.get("Device Interface Module 1");

        waitForStart();

        while (opModeIsActive()) {

            //Read the light sensor using the Analog Input object
            telemetry.addData("light", MRLightSensor.getVoltage());

            //Read each Analog Port of the CDI. 0-7
            for (int i = 0; i < 8; i++) {
                telemetry.addData("Analog " + i, cdi.getAnalogInputVoltage(i));
            }
            telemetry.update();
        }
    }
}