| Electronic Components Datasheet Search |
|
DEV-13956 Datasheet(PDF) 6 Page - SparkFun Electronics |
|
|
|||||||||||||||||||||||||||||
DEV-13956 Datasheet(HTML) 6 Page - SparkFun Electronics |
|
6 / 26 page ![]() Serial.println(); } digitalWrite(STAT_BLUE, LOW); //Turn off stat LED } delay(100); } //Returns the voltage of the light sensor based on the 3.3V ra il //This allows us to ignore what VCC might be (an Arduino plugg ed into USB has VCC of 4.5 to 5.2V) float get_light_level() { float operatingVoltage = analogRead(REFERENCE_3V3); float lightSensor = analogRead(LIGHT); operatingVoltage = 3.3 / operatingVoltage; //The reference v oltage is 3.3V lightSensor = operatingVoltage * lightSensor; return (lightSensor); } //Returns the voltage of the raw pin based on the 3.3V rail //This allows us to ignore what VCC might be (an Arduino plugg ed into USB has VCC of 4.5 to 5.2V) //Battery level is connected to the RAW pin on Arduino and is fed through two 5% resistors: //3.9K on the high side (R1), and 1K on the low side (R2) float get_battery_level() { float operatingVoltage = analogRead(REFERENCE_3V3); float rawVoltage = analogRead(BATT); operatingVoltage = 3.30 / operatingVoltage; //The reference voltage is 3.3V rawVoltage = operatingVoltage * rawVoltage; //Convert the 0 to 1023 int to actual voltage on BATT pin rawVoltage *= 4.90; //(3.9k+1k)/1k multiple BATT voltage b y the voltage divider to get actual system voltage return (rawVoltage); } Open the Serial Monitor. You should see the following output: Put your hand over the small clear device labeled ‘Light’, and watch the light level change to 0. Blow lightly on the humidity sensor, and watch the humidity change. Page 6 of 26 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |