# Motion detection at night

**URL:** <https://forum.core-electronics.com.au/t/motion-detection-at-night/17372>\
**Category:** Support\
**Created:** [18 June 2023 22:49 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372 "2023-06-18T22:49:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![K250750](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@K250750](https://forum.core-electronics.com.au/u/K250750)\
**Post date:** [18 June 2023 22:49 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/1 "2023-06-18T22:49:54Z")

</div>

I am making a gadget using an led as a light source, a light detector about 10cm away. When an object passing between the led and the detector at night, the light will be cut off which triggers a pull-solenoid to kick off a series of mechanical actions.

Wondering if a ready-made one is available. If unable get it off the shelf, I need help to create the electronics to perform the above action. My electronic knowledge is very basic, so I like it as simple to make as possible.

Just in case a colour of the light is not suitable, please recommend more than one type of leds/detector combinations. Thank you.

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [19 June 2023 00:21 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/2 "2023-06-19T00:21:51Z")

</div>

Good question. 🙂

> [@K250750](#):
>
> Wondering if a ready-made one is available.

Just to clarify, are you wanting a ready made device that will detect the light from an already existing LED?

OR

**Are you wanting any device that uses light as a trip wire?**

This technology sounds similar to [laser](https://core-electronics.com.au/piicodev-laser-distance-sensor-vl53l1x.html).  
Similar to your LED trip wire, we are emitting light and listening for returned luminosity.  
Have a look at this article by @Michael. You could check sharp sudden dips in the range which would be just like your trip wire.

> **[PiicoDev Distance Sensor VL53L1X - Raspberry Pi Pico Guide - Tutorial Australia](https://core-electronics.com.au/guides/piicodev-distance-sensor-vl53l1x-raspberry-pi-pico-guide/)**
>
> Introduction
> This guide will help you read distance data in millimeters from your PiicoDev® Distance Sensor and a Raspberry Pi Pico
> To follow along, it's best to have:
> 
> A Raspberry Pi Pico with pins soldered (pointing down)
> A PiicoDev Distance Sensor...

---

<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:** [19 June 2023 01:50 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/3 "2023-06-19T01:50:44Z")

</div>

Hi K,

Pixmusix has hit the nail on the head here, I suggested a similar thing over on this thread: [Looking for a high power infrared LED](https://forum.core-electronics.com.au/t/looking-for-a-high-power-infrared-led/17337)

But your range is nowhere as demanding, so smaller pre-build options _are_ available:

> **[IR Break Beam Sensor - 3mm LEDs](https://core-electronics.com.au/ir-break-beam-sensor-3mm-leds.html)**
>
> Infrared (IR) break-beam sensors are a simple way to detect motion. They work by having an emitter side that sends out a beam of human-invisible IR light, then a...

The one above can sink as much as 100mA, so you could use a relay for firing that solenoid.

---

<div class="post-metadata">

**Author:** ![K250750](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@K250750](https://forum.core-electronics.com.au/u/K250750)\
**Post date:** [20 June 2023 11:58 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/4 "2023-06-20T11:58:15Z")

</div>

Hi Jonny,  
Thank you for your advice.### [IR Break Beam Sensor - 3mm LEDs](https://core-electronics.com.au/ir-break-beam-sensor-3mm-leds.html)is exactly what I need.

I can get a set the sensor and a 5V small pull-solenoid, could you please help by providing:

1. a list of all the parts needed to make the device planned (when the light is cut off, that triggers the pull solenoid). Please include price for each item.
2. a circuit diagram to hook all the parts together.

Then I will place an order those part.  
Thank you.

Regards,  
K Chai

---

<div class="post-metadata">

**Author:** ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)\
**Post date:** [21 June 2023 01:53 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/5 "2023-06-21T01:53:16Z")

</div>

Hi K,

Unfortunately we dont have the capacity to go deep into any single project on the forum, though there are excellent guides for each of the parts and I’ll attach those.  
(Pricing will also change, so I’ll leave links to each of the products so you can order them)

- [Breakbeam sensor](https://core-electronics.com.au/ir-break-beam-sensor-3mm-leds.html) - [Guide](https://learn.adafruit.com/ir-breakbeam-sensors/arduino)
- [Relay](https://core-electronics.com.au/5v-single-channel-relay-module-10a.html) - controls the higher power solenoid, since the IR sensor is open collector you can wire it directly to the input pin of the relay
- Solenoid - I’ve used this [small 5V one](https://core-electronics.com.au/5v-solenoid.html) with great success
- [Power source](https://core-electronics.com.au/5v-dc-2a-fixed-2-1mm-tip-appliance-plugpack.html)
- [An option for connecting everything](https://core-electronics.com.au/quick-snap-connector-kit.html)

I’d also strongly recommend grabbing a multimeter to debug any parts of the circuit!

Liam

---

<div class="post-metadata">

**Author:** ![K250750](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@K250750](https://forum.core-electronics.com.au/u/K250750)\
**Post date:** [22 June 2023 11:44 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/6 "2023-06-22T11:44:21Z")

</div>

Hi Liam,  
With the 4 items you suggested, put them together, it is possible to make the device I have in mind - triggering the solenoid when an object passing the sensor setup. If that works, I shall put an order in. Please advise. Thanks.

Regards,  
K

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [23 June 2023 07:00 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/7 "2023-06-23T07:00:44Z")

</div>

Hi K,

If you wire the power connection to the solenoid via the relay’s output then you can have the solenoid powered when the sensor is triggered.  
So the signal in effect works as below:

Sensor → Relay → Solenoid

---

<div class="post-metadata">

**Author:** ![K250750](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@K250750](https://forum.core-electronics.com.au/u/K250750)\
**Post date:** [29 June 2023 01:12 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/8 "2023-06-29T01:12:20Z")

</div>

Hi Trent,  
Thank you for the advice over the phone yesterday. The AC supply is not quite suitable for my application. Instead of power source recommended by Liam, I would like to use either 6V or 9V battery. As such, I will need parts to hold the battery and connection to power the device. Would those parts recommended by Liam able to handle 6V supply? If using 6V batteries, will the batteries last a few days? Please advise. Thanks.

Regards,  
K

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [29 June 2023 02:47 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/9 "2023-06-29T02:47:26Z")

</div>

Hi K,

Having the project battery powered is possible but you’ll need to make some adjustments.

All of the parts Liam has suggested can’t handle much more than 5V, so your options are to either find higher voltage versions of each part, or to add a regulator to convert the voltage of your battery pack down to 5V so that the existing parts can be used.  
A regulator like this will be able to take the voltage from your battery pack and convert it to stable 5V output for the rest of your devices, however soldering will be required to assemble and connect it to the circuit.

> **[Pololu 5V Step-Up/Step-Down Voltage Regulator S7V7F5](https://core-electronics.com.au/pololu-5v-step-up-step-down-voltage-regulator-s7v7f5.html)**
>
> The S7V7F5 switching step-up/step-down regulator efficiently produces 5 V from input voltages between 2.7 V and 11.8 V. Its ability to convert both higher and lower input voltages makes it useful for applications where the power supply voltage can...

---

<div class="post-metadata">

**Author:** ![K250750](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@K250750](https://forum.core-electronics.com.au/u/K250750)\
**Post date:** [29 June 2023 03:52 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/10 "2023-06-29T03:52:15Z")

</div>

Hi Trent,  
That’s fine. I can include [S7V7F5](https://core-electronics.com.au/pololu-5v-step-up-step-down-voltage-regulator-s7v7f5.html) in the order. So I can go to your site to place an order for

1. [Breakbeam sensor](https://core-electronics.com.au/ir-break-beam-sensor-3mm-leds.html)

2. [Relay](https://core-electronics.com.au/5v-single-channel-relay-module-10a.html) - controls the higher power solenoid, since the IR sensor is open collector you can wire it directly to the input pin of the relay

3. Solenoid - I’ve used this [small 5V one](https://core-electronics.com.au/5v-solenoid.html) with great success

4. S7V7F5

5. Battery holder with connection to the circuit. Please recommend the appropriate one.  
Do I have to get a small board to hold all the parts together? If so what would you recommend?

I have access to a soldering kit, so that is not an issue.

Please advise. Thank you.

Regards,  
K

---

<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:** [30 June 2023 00:41 UTC](https://forum.core-electronics.com.au/t/motion-detection-at-night/17372/11 "2023-06-30T00:41:31Z")

</div>

Hi K,

> [@K250750](#):
>
> Battery holder with connection to the circuit. Please recommend the appropriate one.

> **[6-AA Battery Holder, Enclosed with Switch](https://core-electronics.com.au/6-aa-battery-holder-enclosed-with-switch.html)**
>
> Enclosed battery holder for six AA cells. This holder features a lid that slides over the batteries and snaps into place to fully enclose them. It also...

> [@K250750](#):
>
> Do I have to get a small board to hold all the parts together? If so what would you recommend?

Take a look at our in-house designed protoboard range:

> **[Prototyping - Makerverse Australia](https://core-electronics.com.au/makerverse/prototyping.html)**
>
> Core Electronics is a retailer for electronics in Australia including Arduino, Raspberry Pi, Sparkfun and Adafruit products. Fast shipping and support.
