Тёмный

Arduino - Single LED Sensing and Emitting Light 

Dorian McIntire
Подписаться 25 тыс.
Просмотров 5 тыс.
50% 1

An LED (Light Emitting Diode) is used as both a sensor and light Source with an Arduino Uno as the controller. The circuit also emits sound when the LED detects light. Can't include the code here because the less-than symbol is not allowed in a description. The code is in my first comment which allows the "dangerous" Less-Than symbol.

Опубликовано:

 

6 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@georgebarnes9837
@georgebarnes9837 7 лет назад
I am a self taught beginner level hobbiest. I found this most interesting as I had never heard that an LED has the capability to sense light. I look forward to your course. Thankyou.
@WaltonPete
@WaltonPete 7 лет назад
Interesting video. When I was a kid I cut the top off an old metal canned transistor and used it to sense light. Nothing complicated but it was fun then and still is today!
@DorianMcIntire
@DorianMcIntire 7 лет назад
Thanks for sharing that - I did the same thing as a kid. Photocells were hard to find and even though it made a lousy light sensor it was magic to have the ability to sense light. LED technology has come a long way and I'm amazed at what you can do with them today. BTW I still have some of those old metal can transistors in my antique transistor collection. I'll share it on RU-vid one of these days. Thanks for watching and commenting.
@djbishop30189
@djbishop30189 7 лет назад
Brilliant! Thanks for sharing. Excellent explanation of the whole circuit and software. I'm gonna try it. Thanks!
@VasilisKarastergios
@VasilisKarastergios 7 лет назад
Thanks for the tip and project, looking forward for the arduino tutorials!
@DorianMcIntire
@DorianMcIntire 7 лет назад
The code for the project can be cut and pasted from below /* Read LED as a sensor to detect light levels on A0 Use pot connected to A1 as a light threshold adjustment level control */ int sensorValue; //light level value read by LED int threshold; //Threshold adjustment to set the point at which the LED turns on void setup(){ Serial.begin(9600); // Use to view sensor value } void loop(){ sensorValue = analogRead(A0); //Read LED as a sensor //threshold = analogRead(A1); //Potentiometer level control. comment out if your putting in a threshold number threshold = 220; //Hardcoded threshold. comment out if you're using a potentiometer Serial.println(sensorValue); //Use to view sensor value if(sensorValue < threshold){ pinMode(A0, OUTPUT); //Change A0 to a digital output pin digitalWrite(A0, HIGH); // Make A0 high tone(9,2000,500); delay(1000); // Keep the LED on for 1 second pinMode(A0,INPUT); //Change A0 back to an Analog input pin } delay(50); }
@msdesignru
@msdesignru 7 лет назад
A pretty good simple project to try for beginners I guess
@davechatting
@davechatting 4 года назад
+1 for freeing the Arduino from its USB tether!
@gandsnut
@gandsnut 7 лет назад
Forrest Mims wrote Popular Electronics articles about this, various times & years. It's a shame his extraordinary "Experimenter's Handbook" is so hard to find either in print or online. I have said publication, held together by layers on layers of tape. Far easier to find are his "mini notebooks", which are bite-sized reductions from other collections of his projects. It's strange indeed that Mims' most complicated hobbyist circuits with discrete components are now implemented quickly using PICs, Arduinos and the like.
@DorianMcIntire
@DorianMcIntire 7 лет назад
Forrest Mims was my boy-hood hero. I also have all his handbooks and many Popular Electronics issues (actually all of them - over 400 issues) loaded with his projects. I remember playing with the LED sensor idea many years ago but sensing the feeble signal required an Op-Amp.Today's Superbright LEDs produce much stronger signals - that can be greater than a volt. The Arduino A-D converter can detect signals as low as 5 millivolts so now we can detect and process these signals in very interesting ways. The project in the video would be much more complicated with the original LEDs of the day. We live in amazing times! Thanks for watching and commenting.
@gandsnut
@gandsnut 7 лет назад
My pleasure chatting & remembering. So you have both the small and large format PC issues. I had a boatload of them as well - not sure where they went. It was criminal when the publication of PE ended. I never got into Radio-Electronics much. Around 1964 (8yo) my dad introduced me to Knight Kit SW radios "Star Roamer" and "Space Spanner", building these tube receivers on the kitchen table much to the stress of my mother who needed a place to SERVE DINNER. Haaaa. Remember Eico, and Paia? Lafayette? POLY-PACKS? Tiny Digikey adverts at the back of PE issues? When able to drive in the early 70's, there was a Heathkit STORE still operating (Chicago area), PLUS an Olson's, which may have sold thousands of cr@p items, but such was affordable. Hell, I was riding my bicycle there before having a DL. Yes, yes with the Internet as our resource, times today are amazing. Crazy as it sounds, I wouldn't put it past one of us hobbyists to achieve anti-gravity, teleportation, or some such fantastic science. Best!
@Edmorbus
@Edmorbus 7 лет назад
Thanks for sharing
@adrianaellyssa7695
@adrianaellyssa7695 5 лет назад
May I know what is the thing that you put on 1:15 ?? I need to know it asap because I have a school project :))
@DorianMcIntire
@DorianMcIntire 5 лет назад
I added a small speaker so the Arduino could make a noise. The speaker I used was an electro-magnetic speaker however a piezo speaker could also be used.
Далее
Proximity Sensor Interfacing to PLC made easy
18:14
Просмотров 220 тыс.
Mcdonalds cups and ball trick 🤯🥤 #shorts
00:25
Просмотров 1,3 млн
Serial Communication with Arduino - The details!
16:51
Hacking Microsoft BASIC
18:03
Просмотров 74 тыс.
Developing a high fidelity LED Magnet Matrix
15:26
Просмотров 147 тыс.
Why build an entire computer on breadboards?
28:43
Просмотров 3,1 млн
The most deadly project on the Internet
15:14
Просмотров 7 млн
Arduino Motor Interfacing using MOSFET and PWM
10:49
Просмотров 188 тыс.