Light a LED based on a Sensors activity

I want to have a LED turn ON (used as an indicator only) as long as its sensor (DS Light Bridge) is activated. (Light stream blocked = detecting, unrestricted = no detection).
The sensor circuit works flawless, the controlling software does not provide access to attach an external LED just the routine for its primary purpose. Due to time considerations, it is imperative to know when or if the sensor is active.

I'm posting this here because I'm not even qualified to be called a beginner but do have conceptual knowledge of the UNO from years ago. Closest Post I could find was from Feb 2015 and although related, it is much deeper than what I would require, and responses were more about the Title and area of posting then help.
I intentionally left out specifics of purpose and controlling software because they are moot, I'm not looking for design or safety concerns, just simply how to wire and the code required.

Hi, @Pepsikid51
Welcome to the forum.

Can you please post the code you have?
What model Arduino controller are you using?
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Can you please post a link to spec/data of the Bridge.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Not true. Your devices, their properties and the control of the devices are all important. Otherwise, this forum would not be needed or used.

Depends on the device. Some sensors are HIGH when active some are LOW, some have timeouts (LOW to HIGH to LOW) and some are analog.

Your solution might more complicated to ensure false activation does not occur, or it might be as simple as this simulation, if you imagine the pushbutton in the simulation as your light sensor, active/pressed and the light turns on...

Thanks Tom,

Truth of the matter is I'm not technical, use of wrong nomenclature is worse than lack of details. I know a LED means different things to different people, what LED (size, color, voltage etc.) needs to be considered (by me not you), and not required for a response. Nor is the type or specs on the sensor, or interface it is using to send its inbound signal to the computer (as well as type or make of the computer or OS). What is important is for the response to be structured in Plain language as the question was written. It's my system (project) and as such my responsibility for testing and construction not the responders should I want to use it. I reread my post and feel it was written to convey the fact I know what the Uno board is capable of (just not who to do it), that I have sensors (type, brand, speed etc.) is not relevant other than they send a signal (inbound) to my computer and that signal is sufficiently received and understood to trigger a routine in the software but does not include the capability to trigger an Outbound Pin state, because it is not written into the software. Simply, and I chose it vice Basic, because of previous reference to BASIC being reason for explanation the Arduino is not programed in BASIC. I'm trying to turn On/Off a LED from the Pin state change of a sensor.

A PHIDGET 1012 BOARD (Inbound Pin) receives the signal from the DS Electronics Light bridge (housing the light sensing circuit). No, I don't know the sender or receiving elements used in it, but clearly stated it is working flawlessly. Again, providing all this information serves only to lengthen the post because has no bearing on a reply. Now for fuller disclosure the project is to create a visible indicator (LED) when a Slot Car enters the pit area on a 1/32nd scale Policar Track system that via the Ultimate Racer Timing software provides 1/1000th of a second timing, with Pit Stop functions. Because the Pit area is also part of the normal lap circuit, a 500ms (1/2 sec) delay is required on the sensor before the Fueling sequence starts to distinguish it from the passing on a normal lap, the need for a visible signal to indicate the car is in position (in Pit Area).

Again, the question requires NOTHING explained here for consideration of a reply. I tried to research an answer and hesitated posting because most responders are more interested in professing their knowledge than helping and example from Arduino Learning are written by Tech's in Tech language or not applicable.
Thanks for the time and advice but keep it simple, make it fun.

| TomGeorge Jackson
June 11 |

  • | - |

Hi, @Pepsikid51
Welcome to the forum.

How to get the best out of this forum IDE 1.x

See also FAQ - Arduino Forum for general rules on forum behavior and etiquette. Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frus…

Can you please post the code you have?
What model Arduino controller are you using?
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Can you please post a link to spec/data of the Bridge.

Thanks.. Tom.. :smiley::+1::coffee::australia:

Thanks George,

Proving my point - I'm the idiot for asking the question, because I can't possibly know anything to ask such a simple question. I stated I'm not looking for you to design or advise on all safety matters. Perhaps you are right that without all the details the site is useless because those responding assume someone asking for help couldn't grasp Pin states, High and Low, On or Off. Why push a button when you have a sensor in place that acts as that button, automatically?

Thanks Tom,

Truth of the matter is I'm not technical, use of wrong nomenclature is worse than lack of details. I know a LED means different things to different people, what LED (size, color, voltage etc.) needs to be considered (by me not you), and not required for a response. Nor is the type or specs on the sensor, or interface it is using to send its inbound signal to the computer (as well as type or make of the computer or OS). What is important is for the response to be structured in Plain language as the question was written. It's my system (project) and as such my responsibility for testing and construction not the responders should I want to use it. I reread my post and feel it was written to convey the fact I know what the Uno board is capable of (just not who to do it), that I have sensors (type, brand, speed etc.) is not relevant other than they send a signal (inbound) to my computer and that signal is sufficiently received and understood to trigger a routine in the software but does not include the capability to trigger an Outbound Pin state, because it is not written into the software. Simply, and I chose it vice Basic, because of previous reference to BASIC being reason for explanation the Arduino is not programed in BASIC. I'm trying to turn On/Off a LED from the Pin state change of a sensor.

A PHIDGET 1012 BOARD (Inbound Pin) receives the signal from the DS Electronics Light bridge (housing the light sensing circuit). No, I don't know the sender or receiving elements used in it, but clearly stated it is working flawlessly. Again, providing all this information serves only to lengthen the post because has no bearing on a reply. Now for fuller disclosure the project is to create a visible indicator (LED) when a Slot Car enters the pit area on a 1/32nd scale Policar Track system that via the Ultimate Racer Timing software provides 1/1000th of a second timing, with Pit Stop functions. Because the Pit area is also part of the normal lap circuit, a 500ms (1/2 sec) delay is required on the sensor before the Fueling sequence starts to distinguish it from the passing on a normal lap, the need for a visible signal to indicate the car is in position (in Pit Area).

Again, the question requires NOTHING explained here for consideration of a reply. I tried to research an answer and hesitated posting because most responders are more interested in professing their knowledge than helping and example from Arduino Learning are written by Tech's in Tech language or not applicable.
Thanks for the time and advice but keep it simple, make it fun.

| TomGeorge Jackson
June 11 |

  • | - |

Hi, @Pepsikid51
Welcome to the forum.

How to get the best out of this forum IDE 1.x

See also FAQ - Arduino Forum for general rules on forum behavior and etiquette. Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frus…

Can you please post the code you have?
What model Arduino controller are you using?
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Can you please post a link to spec/data of the Bridge.

Thanks.. Tom.. :smiley::+1::coffee::australia:

Try this:

Lay off the bloviation and answer the plain language requests for relevant information.

Hi, @Pepsikid51
.
It appears a Phidget is not an Arduino based controller.

But to generalise.
In simple logic.

Define input pin.
Define output pin.
Define an input HIGH = Detected.
Define an input LOW = No Detection.
Define LED HIGH = ON
Define LED LOW = OFF

START;  //of code
If input == HIGH
output = HIGH
else
output = LOW
Loop back to START;

The controller should automatically do the loop for you.

Have you looked at;

Have you looked and asked at their forum?
https://www.phidgets.com/phorum/index.php

They should be able to help you.

Is this a school/college/university/commercial project?

Do you really need a controller to do the job?
A relay or solid state switch will do the same thing.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

"It appears a Phidget is not an Arduino based controller". Correct a Phidget is an interface board much like an Arduino board. Excuse me for not understanding your inquiry about what Arduino based controller I'm using; I've never heard or seen Arduino Boards referred to as a "based controller" but was stated in original post I was using an Uno board. Again, to my point about including nomenclature and Tech terms, they do not always mean or used interchangeably.

Yes, I have researched Phidgets.com, but the problem is not about the Phidget , it about HOW can I use an Arduino Uno board to light a led from a sensor.

I'm not sure if I need a controller, but I need to use the signal from the detecting sensor which is being sent into the computer software (on an Inbound Pin). The software can only use this signal for the purpose written into the code it was programmed for. Agree the Software is a limiting factor, but it cannot be modified, thus a work around solution is required (hardware).

I thought using remarks in code or a sketch was valuable and highly recommended especially when trying to help. The sketch provided does bring back some recall of structure, but not enough to grasp total concept. Should I be looking at "loop" examples?

| TomGeorge Jackson
June 11 |

  • | - |

Hi, @Pepsikid51
.
It appears a Phidget is not an Arduino based controller.

But to generalise.
In simple logic.

Define input pin.
Define output pin.
Define an input HIGH = Detected.
Define an input LOW = No Detection.
Define LED HIGH = ON
Define LED LOW = OFF

START;  //of code
If input == HIGH
output = HIGH
else
output = LOW
Loop back to START;

The controller should automatically do the loop for you.

Have you looked at;

Phidgets Support – 26 Jun 19

What is a Phidget?

Have you looked and asked at their forum?
https://www.phidgets.com/phorum/index.php

They should be able to help you.

Is this a school/college/university/commercial project?

Do you really need a controller to do the job?
A relay or solid state switch will do the same thing.

Thanks.. Tom.. :smiley::+1::coffee::australia:

You were shown.

Thanks to all for responding, there is no need for further assistance.

I see it otherwise, with assistance given summarily dismissed.

HI, @Pepsikid51

Ten years ago, did you take the advice given and learn some electronics basics?

Tom.. :smiley: :+1: :coffee: :australia:
PS. You didn't say if any of our offerings helped.

No, I did not try to learn electronic basics, Then, as now do not believe structured learning of non-applicable concepts is required to complete a singular task. I research and learn specifics.
Yes, all responses were helpful in refreshing Arduino structure and gave a reference of where possibly to look. Not helpful at all was the snide remarks or comments that only served to enhance my thoughts that HELP is not as important to some responders as trying to Show their (lack of) intelligence. The below is 1st attempt (no board attached) at what it might look like from the poor attempt sent. I know not all syntax maybe proper but will get it right. Thanks again.

/*
Turn ON/OFF In Pit Area LED based on state of Input pin from Sensor.
Based on sketch from xfpd (Arduino.cc forum (Jerk)) 06/12/24
Modified by Pepsikid 6/12/24
*/
Define input pin. //Sensor from Ln1 Pit on Pin 1
Define input pin. //Sensor from Ln2 Pit on Pin 2
Define input pin. //Sensor from Ln3 Pit on Pin 3
Define input pin. //Sensor from Ln4 Pit on Pin 4
Define output pin. //Pit Red Led Ln1 on Pin 5
Define output pin. //Pit Blu LED Ln2 on Pin 6
Define output pin. //Pit Grn LED Ln3 on Pin 7
Define output pin. //Pit Yel LED Ln4 on Pin 8
Define an input HIGH = Detected. //If InPin(#) is HIGH car is detected
Define an input LOW = No Detection. //If InPin(#) is LOW no car is detected
Define LED HIGH = ON //If OutPin(#) is HIGH Led is on
Define LED LOW = OFF //If OutPin(#) is LOW Led is off

START; //of code
If input == HIGH
output = HIGH
else
output = LOW
Loop back to START;void setup () {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

| TomGeorge Jackson
June 12 |

  • | - |

HI, @Pepsikid51

Pepsikid51:

Thanks to all for responding, there is no need for further assistance.

Ten years ago, did you take the advice given and learn some electronics basics?

BASIC ARDUINO HARDWARE HELP General Discussion

Is there such a thing as BASIC or a BEGINNERS section on using ARDUINO and/or ARDUINO associated hardware? Basic or Beginner approach does not start with a SKETCH, nor a SCHEMATIC, and although helpful for marketing isn't a description of a piece of hardware capabilities. What I'm talking about is a section where a piece of hardware is described in terms of usage, not capabilities. I understand there are hundreds of pieces of hardware, and several hundred more ways they can be used. What I don'…

Tom.. :smiley::+1::coffee::australia:
PS. You didn't say if any of our offerings helped.

Hi,
Well you will have to do some structured learning to get the syntax correct, otherwise you will be wasting your valuable time to accomplish your goal to any satisfaction.

The code is structured in itself.

Also have you learnt Ohms Law to work out the LED circuits?

Good luck, Tom.. :smiley: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.