Kirjeldus
This brick includes a TA12-200 current transformator.Use it for detecting through current and calculate total power consumption.
Connect the + pin to 5v and – pin to GND, S pin will output the AC current information.
Features
- Electronic brick compatible interface
- High accuracy
- Small size
Programming
Connect the module to the electronic brick basic board using the analog interface. Put the alternating current wire through the hole of the current transformer. The SIG pin will output a alternating voltage based on the alternating current being measured. You can measure the value using ADC.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
const int sensorPin = A0; // pin that the sensor is attached to int sensorValue; int time =1; float current; float effective_value; void setup() { Serial.begin(115200); } void loop() { int sensorMax = 0; while (millis() < time *1000) { sensorValue = analogRead(sensorPin); if (sensorValue > sensorMax) { sensorMax = sensorValue; } } time ++; current=( float )sensorMax/1024*5/800*2000000; effective_value=current/1.414; Serial.println( "The amplitude of the current is(in mA)" ); Serial.println(current, 1); Serial.println( "The effective value of the current is(in mA)" ); Serial.println(effective_value, 1); } |
Specification
This brick includes a TA12-200 current transformator.Use it for detecting through current and calculate total power consumption.
Connect the + pin to 5v and – pin to GND, S pin will output the AC current information.
Features
- Electronic brick compatible interface
- High accuracy
- Small size
Programming
Connect the module to the electronic brick basic board using the analog interface. Put the alternating current wire through the hole of the current transformer. The SIG pin will output a alternating voltage based on the alternating current being measured. You can measure the value using ADC.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
const int sensorPin = A0; // pin that the sensor is attached to int sensorValue; int time =1; float current; float effective_value; void setup() { Serial.begin(115200); } void loop() { int sensorMax = 0; while (millis() < time *1000) { sensorValue = analogRead(sensorPin); if (sensorValue > sensorMax) { sensorMax = sensorValue; } } time ++; current=( float )sensorMax/1024*5/800*2000000; effective_value=current/1.414; Serial.println( "The amplitude of the current is(in mA)" ); Serial.println(current, 1); Serial.println( "The effective value of the current is(in mA)" ); Serial.println(effective_value, 1); } |
Specification
Brick Type | Sensor Brick |
---|---|
Brick Interface | 3PIN |
Brick Power Supply | 5V |
Board Size | 34 × 21 × 1.6mm |
Weight | 25.00g |
Model | IM120710018 |
Arvustused
Tooteülevaateid veel ei ole.