ML8511 UV Sensor (GYML8511) [S083]

 


 

https://www.youtube.com/watch?v=R-o1q9Vmtk4


*GitHub : https://github.com/rdiot/rdiot-s083.git

 

* Specs
The ML8511 breakout is an easy to use ultraviolet light sensor. The MP8511 UV (ultraviolet) Sensor works by outputing an analog signal in relation to the amount of UV light that's detected.
This breakout can be very handy in creating devices that warn the user of sunburn or detect the UV index as it relates to weather conditions.
This sensor detects 280-390nm light most effectively.
This is categorized as part of the UVB (burning rays) spectrum and most of the UVA (tanning rays) spectrum.
It outputs a analog voltage that is linearly related to the measured UV intensity (mW/cm2).
If your microcontroller can do an analog to digital signal conversion then you can detect the level of UV!

 

* Contents
- Connect
VIN ----- X
3V3 ----- 3.3V
GND ----- GND
OUT ----- A0
EN ----- A1

 

- Key Code
int UVOUT = A0; //Output from the sensor
int REF_3V3 = A1; //3.3V power on the Arduino board

 

int uvLevel = averageAnalogRead(UVOUT);
int refLevel = averageAnalogRead(REF_3V3);

 

//Use the 3.3V power pin as a reference to get a very accurate output value from sensor
float outputVoltage = 3.3 / refLevel * uvLevel; 
float uvIntensity = mapfloat(outputVoltage, 0.99, 2.9, 0.0, 15.0);

 

lcd.print("uv=" + (String)uvIntensity + "(mW/cm^2)");


//The Arduino Map function but for floats
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

Posted by RDIoT
|

Load CDS sensor type values into DB by calling server API [P001]


 



 

https://www.youtube.com/watch?v=KGXxDDacQb4


*GitHubhttps://github.com/rdiot/rdiot-p001.git

 

* Contents

- API Call and Save the CDS Values to the API Server.

 

- Result
2391 S001       ArduinoUno   W5100         Ethernet     MiniPhotocell       2015-10-08 00:22:34 F01                  513 0~1023           
2392 S002       ArduinoUno   W5100         Ethernet     PhotoResistorModule 2015-10-08 00:22:36 F01                  343 0~1023           
2393 S003       ArduinoUno   W5100         Ethernet     CDS5MM               2015-10-08 00:22:37 F01                 829 0~1023           
2394 S004       ArduinoUno   W5100         Ethernet     CDS10MM             2015-10-08 00:22:38 F01                  702 0~1023           
2395 S005       ArduinoUno   W5100         Ethernet     CDS15MM             2015-10-08 00:22:39 F01                  957 0~1023           
2396 S006       ArduinoUno   W5100         Ethernet     CDS20MM             2015-10-08 00:22:41 F01                  959 0~1023           

 

- Key Code
#include <SPI.h>
#include <Ethernet.h>

/* --------------------------------------------------------------------
*  Ethernet Config
* -------------------------------------------------------------------*/
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 }; //MAC Address
char server[] = "54.65.30.222"; //API Server
String s_data1 = ""; // Request Data
int led_green = 6; // Connect LED ON
int led_red = 7; // DisConnect LED ON


EthernetClient client;

connect_server();

 s_data1 = "sensor_id=S001&";
 s_data1 += "sensor_board=ArduinoUno&";
 s_data1 += "sensor_shield=W5100&";
 s_data1 += "sensor_comm=Ethernet&";
 s_data1 += "sensor_name=MiniPhotocell&";
 s_data1 += "sensor_func=F01&";
 s_data1 += "sensor_value=" + (String)analogRead(A0) + "&";
 s_data1 += "sensor_value_desc=0~1023";
 Serial.println("S001-"+ (String)analogRead(A0));


if (client.connected())
 {
  Serial.println("c1");
  client.println("POST /iotHome-api/v1/sensor/post-form2xml-mysqldb HTTP/1.0");
  client.println("Host: 54.65.30.222");
  client.println("User-Agent: Arduino");
  client.println("Connection: close");
  client.println("Content-Type: application/x-www-form-urlencoded");
  client.print("Content-Length: ");
  client.println(s_data1.length());
  client.println();
  client.println(s_data1);

  digitalWrite(led_green, HIGH);
  delay(100);
  digitalWrite(led_green, LOW);
 }
 else
 {
  digitalWrite(led_red, HIGH);
  delay(1000);
  digitalWrite(led_red, LOW);
 }
 delay(1000);

Posted by RDIoT
|

Auto On Off Photo Switch (AS-10-220) [S157]

 

 

 

https://www.youtube.com/watch?v=8xIMZTtYBdg

* Specs
To turn on or off the light in day and night without manual operation
Do not install the control unit in a place extremely darker in daytime or a place directly by lighting of turning - ON lamp
Widely used: street light, highway, factories, garden, ports, airports, farm, parks, schools, and other places. Also can fit into solar lamps and lanterns, or cars, motorcycles, electric cars and other power supply voltage is 220V lamps and lanterns or equipment
Easy to install and Convenient to use
Model:AS-10-220
Input Voltage: DC or AC 220V
Max Load Current: 10A
Size:(approx)5 x 4.2 x3.5cm/1.96"x1.65"x1.37"
Frequency:50-60Hz

 

* Contents
AC Auto On/Off Test

 

- Connect
Black - LINE
White - NEUT
Red - LOAD

Posted by RDIoT
|