Home Creators Posts Import Register Favorites Logout

Content

In this video I'll show you how to create two similar (although in some ways opposite!) escape room-style puzzles based on a Light Dependent Resistor (LDR).

 - In the "Cover Up" puzzle, players must place their hands (or any other object) over the LDR, raising its resistance to trigger a relay.

 - In the "Shine On" puzzle, which uses identical hardware but a minor code change, players must instead shine a torch or other light source onto the LDR, lowering its resistance to trigger a relay.

The relay can then be used to power a load - release a maglock, play a sound, or activate any other sort of electronic device. 

The code listing, documentation, and wiring diagram can be accessed by Patreons at https://www.patreon.com/posts/16239233

Files

Cover Up! / Shine On! Escape Room Puzzle

In this video I'll show you how to create two similar, although in some ways opposite, escape room-style puzzles involving a Light Dependent Resistor (LDR). - In the "Cover Up" puzzle, players must place their hands (or any other object) over the LDR, raising its resistance to trigger a relay. - In the "Shine On" puzzle, which uses identical hardware but a minor code change, players must instead shine a torch or other light source onto the LDR, lowering its resistance to trigger a relay. The relay can then be used to power a load - release a maglock, play a sound, or activate any other sort of electronic device. The code listing, documentation, and wiring diagram can be accessed by Patreons at https://www.patreon.com/posts/16239233

Comments

oleg ardassov

Hello Alastair Aitchison. I am sorry for bothering you again. But i was trying to make that project work with multiply LDR sensors for few hours. But i couldn,t get it work. Could you give me your email please. So i can send you my code, and if you have time, maybe you could explain what am I doing wrong.

Wayne Ianson

could i use a smaller magnetic catch for this rather than the big mag lock .and if so would i still have to run from a external 12v power supply as im stuck for room .Thanks

oleg ardassov

Hello Alastair Aitchison. I made Shine On Probe into smokesensor, so player have to shine with a laser into sensor. And probe goes active, smoke alarm goes on and the door opens . But I am not good at coding and cannot figure out how to modify code so players have to shine into the sensor for 3 or more seconds before it goes active. At the moment sometimes probe goes active even if you point the laser near the sensor because my room is made from reflective plastic and it sometimes shines into sensor from reflection, i would like to make it more efficient. I hope you can help me with that, and I think it would be useful for all the others fans of yours. Best Rgds, Oleg P.S I wanted to post picture of my SmokeSensor, but it is not allowed to post pictures in comment section.

oleg ardassov

Hello, I am trying to make probe where u need to shine on more then 5 seconds before it activates. I made code but it doens,t work. I hope maybe you could help me: const byte ldrPin = A0; const int time_period = 5000; long last_millis = 0; const byte lockPin = 2; int baseReading = 512; const int sensitivity = 150; enum PuzzleState {Initialising, Running, Solved}; PuzzleState puzzleState = Initialising; bool checkIfPuzzleSolved(){ return analogRead(ldrPin); last_millis = millis(); while(analogRead(ldrPin)) ((millis()-last_millis)>=time_period && currentReading < baseReading - sensitivity); } Best Rgds, Oleg