# Pi with light sensor to trigger an email

**URL:** https://forum.core-electronics.com.au/t/pi-with-light-sensor-to-trigger-an-email/13761
**Category:** Raspberry Pi
**Created:** [13 April 2022 10:34 UTC](https://forum.core-electronics.com.au/t/pi-with-light-sensor-to-trigger-an-email/13761 "2022-04-13T10:34:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![George198863](https://avatars.discourse-cdn.com/v4/letter/g/c4cdca/32.png) [@George198863](https://forum.core-electronics.com.au/u/George198863)
#### Post date: [13 April 2022 10:34 UTC](https://forum.core-electronics.com.au/t/pi-with-light-sensor-to-trigger-an-email/13761/1 "2022-04-13T10:34:12Z")

</div>

Last year my son and daughter gave me a Pi 3 Model B+ “starter kit”. It has stayed in the box until now, because my programming experience, decades ago, was in Basic, and I know virtually nothing about Python or Pi’s operating system.  
Now my son has suggested a useful project:  
The power in my garage is on a circuit which has no connection to the panel of circuit breakers etc in my home. Because of the equipment in my garage, I need to monitor the state of the garage power when I am in my study, so that if the garage power goes off, I can investigate the problem and if ok, go to the garage’s circuit breaker (near the garage) and reset it. I have a USB power supply plugged into a power board in my garage. A long USB cable goes to my study, and on its way the cable passes through a hole that is so small that I could fit only the two wires for power through it. The other end of the USB cable has a “USB Mini LED light” (bought from Jaycar) connected to it. So I can keep an eye on the LED light.  
That’s all fine when I am in the study, but when I am not there I want to be notified by email if the power goes off in the garage.

I propose using a PiicoDev Ambient Light Sensor VEML6030 directed at the LED light. However, it’s an **Ambient** Light Sensor. Would the LED’s output (120 Lumens) be too much for the sensor to handle?

Also, if there is a power outage in the garage, and the LED in the study stops shining, the sensor should sense the drop in light ouput. So I will some kind of “if” statement to send an instruction to the Pi, which would activate an email to me containing a simple warning message. How do I do all of that?

What bits of equipment will I need to make the system work?

---

<div class="post-metadata">

### Author: ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)
#### Post date: [14 April 2022 06:20 UTC](https://forum.core-electronics.com.au/t/pi-with-light-sensor-to-trigger-an-email/13761/2 "2022-04-14T06:20:13Z")

</div>

Hi George,

You could definitely do it the way you are suggesting, and I wouldn’t worry about “overloading” the light sensor, the VEML6030 chip on our PiicoDev light sensor boards is good for 120 000 lux, and a 120 lumen light with a 60 degree beam angle at 10cm is only about 14 000 lux. [Lux/Lumens Calculator: How Much Light Do You Need?](https://www.bannerengineering.com/za/en/company/expert-insights/lux-lumens-calculator.html)

A slightly neater (but a little more complicated) method would be to use a logic level converter on 5V and GND lines of your USB cable, and run the resulting 3.3V logic to an input GPIO pin on your Pi.

> **[Logic Level Converter Bi-Directional](https://core-electronics.com.au/logic-level-converter-bidirectional.html)**
>
> This Bi-Directional Logic Level Converter is a breadboard-friendly device that converts between 5V and 3.3V logic.

A bit more on those parts here:[Bi-Directional Logic Level Converter Hookup Guide - learn.sparkfun.com](https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide)

-James
