Ks0274 keyestudio Current Sensor Current Detection Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<br>
== Introduction ==
== Introduction ==
Keyestudio current detection sensor is mainly composed of a current sensor TA12-200, which can convert large current into a small amplitude of voltage output. <br>
This product can be applied to detect AC current, and its maximum detectable current is up to 5A. <br>
Current sensor can be used in a variety of microcontroller, especially on the Arduino controller, which can be connected to the Arduino dedicated sensor expansion board with the 3P sensor cable.<br>
It can easily achieve interactive works related to environmental awareness. <br>
Used for electrical load remote monitoring; as an electronic control system of input signals; lack of phase indication, power measurement; motor running state monitoring.<br>
<br>[[File:274 (3).jpg|600px|frameless|thumb]]<br>


Keyestudio current detection sensor is mainly composed of a current sensor TA12-200, which can convert large current into a small amplitude of voltage output. This product can be applied to the AC current detection, and its maximum detectable current is up to 5A. Current sensors can be used in a variety of microcontroller controllers, especially on the Arduino controller, which can be connected to the Arduino dedicated sensor expansion board with the 3P sensor cable, easily achieving interactive works related to environmental awareness.
<br>
 
<br>[[File:KS0274 (1).jpg|500px|frameless|thumb]]<br>


==Specification ==
==Specification ==
Line 12: Line 18:
* Flame retardant conforms to UL94-VO
* Flame retardant conforms to UL94-VO
* Dielectric strength 6000V AC/1min
* Dielectric strength 6000V AC/1min
* Usage: electrical load remote monitoring; as an electronic control system of input signals;lack of phase indication, power measurement; motor running state monitoring.


<br>
==Connection Diagram ==
==Connection Diagram ==
<br>[[File:Ks0274.png|700px|frameless|thumb]]<br>


<br>[[File:Ks0274.png|500px|frameless|thumb]]<br>
<br>
 
 
==Sample Code==
==Sample Code==
<pre>
<pre>
Line 67: Line 72:
</pre>
</pre>


<br>
== Result ==
== Result ==
Done as the above wiring, upload the code, and then open the serial monitor, the magnitude of current is shown  (not connected to the current), as the figure below.
Done as the above wiring, upload the code, and then open the serial monitor, the magnitude of current is shown  (not connected to the current), as the figure below.<br>
<br>[[File:Ks0274-.png|600px|frameless|thumb]]<br>


<br>[[File:Ks0274-.png|500px|frameless|thumb]]<br>
<br>


== Resources ==
== Resources ==
'''PDF File:'''


http://www.keyestudio.com/files/index/download/id/1500602045/
* '''Code:'''<br>
https://fs.keyestudio.com/KS0274
 
<br>


== Get One Now ==
== Get One Now ==
http://www.keyestudio.com/keyestudio-current-detection-sensor.html
 
*[https://www.keyestudio.com/keyestudio-current-detection-sensor-module-for-arduino-p0383-p0383.html    '''Official Website''']
 
*[https://www.aliexpress.com/store/product/Keyestudio-Current-Detection-Sensor-Module-For-Arduino/1452162_32905900757.html?spm=2114.12010615.8148356.7.699d672dJeKgxF    '''Shop on aliexpress''' ]
 


[[Category: Sensor]]
[[Category: Sensor]]

Latest revision as of 12:12, 7 January 2021


Introduction

Keyestudio current detection sensor is mainly composed of a current sensor TA12-200, which can convert large current into a small amplitude of voltage output.
This product can be applied to detect AC current, and its maximum detectable current is up to 5A.
Current sensor can be used in a variety of microcontroller, especially on the Arduino controller, which can be connected to the Arduino dedicated sensor expansion board with the 3P sensor cable.
It can easily achieve interactive works related to environmental awareness.
Used for electrical load remote monitoring; as an electronic control system of input signals; lack of phase indication, power measurement; motor running state monitoring.

thumb


Specification

  • Working voltage:5V
  • Detecting current:up to 5A
  • Working frequency: 20Hz~20KHz
  • Data type: analog input
  • Flame retardant conforms to UL94-VO
  • Dielectric strength 6000V AC/1min


Connection Diagram


thumb


Sample Code

#define ELECTRICITY_SENSOR A0 // Analog input pin that sensor is attached to
float amplitude_current;               //amplitude current
float effective_value;       //effective current 
void setup() 
{
	Serial.begin(9600); 
	pins_init();
}
void loop() 
{
	int sensor_max;
	sensor_max = getMaxValue();
	Serial.print("sensor_max = ");
	Serial.println(sensor_max);
	//the VCC on the RobotBase interface of the sensor is 5v
	amplitude_current=(float)sensor_max/1024*5/800*2000000;
	effective_value=amplitude_current/1.414;//minimum_current=1/1024*5/800*2000000/1.414=8.6(mA) 
						//Only for sinusoidal alternating current
	Serial.println("The amplitude of the current is(in mA)");
	Serial.println(amplitude_current,1);//Only one number after the decimal point
	Serial.println("The effective value of the current is(in mA)");
	Serial.println(effective_value,1);
}
void pins_init()
{
	pinMode(ELECTRICITY_SENSOR, INPUT);
}
/*Function: Sample for 1000ms and get the maximum value from the SIG pin*/
int getMaxValue()
{
	int sensorValue;             //value read from the sensor
	int sensorMax = 0;
	uint32_t start_time = millis();
	while((millis()-start_time) < 1000)//sample for 1000ms
	{
		sensorValue = analogRead(ELECTRICITY_SENSOR);
		if (sensorValue > sensorMax) 
		{
			/*record the maximum sensor value*/
			sensorMax = sensorValue;
		}
	}
	return sensorMax;
}


Result

Done as the above wiring, upload the code, and then open the serial monitor, the magnitude of current is shown (not connected to the current), as the figure below.

thumb


Resources

  • Code:

https://fs.keyestudio.com/KS0274


Get One Now