Contactless wakeup for LCD

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Contactless wakeup for LCD

#1 Post by Grumpf » 02 Dec 2020, 18:53

I'm wondering if someone has a better option than a PIR to trigger the display of a LCD after time out.

Objective is to have a 2004 in the bedroom that can be used as a clock with some messages from domoticz. All of that works for now, the LCD goes off and as soon as the PIR detects a movement, the LCD goes on for the programmed time.

I want a contactless option like I have for other clocks where I just sleepily wave my hand somewhere around the clock turns on. PIR is a bit big...

Any ideas guys ?

Thanks.

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#2 Post by TD-er » 02 Dec 2020, 19:12

You can add a tip touch pad, which can be mounted inside the enclosure.
But you still need to touch it.

Other way can be one of those "gesture" chips. These are relatively small.
Or you can try experiment with one of those cheap "radar" sensors.
They are quite small (small PCB with low profile components), but they are a bit tricky to operate as they are sensitive in all directions and may be affected by metal close to the sensor.
But they are really cheap :)

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#3 Post by Grumpf » 02 Dec 2020, 19:48

Cheap and tricky ? That'll remind me of my earliest love life. Any link or examples ?

Thanks.

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Contactless wakeup for LCD

#4 Post by Ath » 02 Dec 2020, 20:18

I've written about my PV Monitor project over here in this forum, a couple of months ago.

It is working, sort of, but the APDS9960 gesture sensor (Chinese clone) is not very responsive, most of the time, and it is influenced by the housing I put around it. I actually had to enlarge the hole it is looking out through, just to unblock the ESP, as the I2C bus is blocked if there is too much material close to the sensor.
I have planned to experiment with both a PIR and a TCRT5000 IR sensor, though that last one hasn't arrived yet. But that one is dirty cheap, ~€0,25 each, shipping to my location is about double of that :D
I'll have to wait and see if that one does what I want it to do.
/Ton

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#5 Post by TD-er » 02 Dec 2020, 21:12

Grumpf wrote: 02 Dec 2020, 19:48 Cheap and tricky ? That'll remind me of my earliest love life. Any link or examples ?
For which of the two? ;)
As Google search: rcwl-0516 microwave radar sensor

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#6 Post by Grumpf » 02 Dec 2020, 22:10

All right I checked comparison youtube videos and ordered some rcwl-0516. They look great. Only 3 months to wait for them to be delivered...

Thanks guys, @Ath keep me posted when your sensor arrives.

Cheers !

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#7 Post by Grumpf » 13 Jan 2021, 15:54

Hi guys, thanks for the tip, those guys are awesome. Now, I googled a lot and search this forum but couldn't find a simple example of a capacitor to add for 1 or 2 or 5 minutes delay to C-.
I got the (1/f)*32768 and the
2021-01-13 15_50_41-Clipboard.png
2021-01-13 15_50_41-Clipboard.png (13.44 KiB) Viewed 925 times
But Engineer school was 30 years ago...

Erm, Did someone tried so I don't have to rely on programming for delay ? 100% error time is totally acceptable by the way...

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#8 Post by TD-er » 13 Jan 2021, 16:26

What exactly do you want to achieve?

Is it going to be a RC timer circuit?
Then you must also know what the charging voltage is and what voltage will be enough to be considered "high" or "low" (depending how you connect it)

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#9 Post by Grumpf » 13 Jan 2021, 19:36

Hi, thanks for the quick reaction and your advice about those !

I want to control the backlight of LCD or Led matrix to only lit when there's someone to watch.
Project one is a simple 2004 LCD: wave in front of it and backlight on (I know I'd have to limit the range with a resistor but small steps).

Project two is a 32 ou 64X8 Leds matrix to display message.

Both will be powered by 5V.
Best will be for the module to be able to feed the backlight/Matrix (I imagine the 3v to a transistor to feed 5v). But I'm opened to suggestion.
The idea is to be able to have a module that I can put between the MP & the "lights on" wire. 5V-> rcwl-0516 -> 5V if motion for X min, 0V if not.

Cheers!

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#10 Post by TD-er » 13 Jan 2021, 19:43

Why diving into RC networks for timing (which also needs 2 pins, one for the motion detection, one for the timer), while you can do it all in rules?

For example a motion sensor can trigger a signal on a GPIO pin, which triggers an event in the rules.
This event then sets a timer (each time again if it is triggered) and turns on the backlight.

After the timer fires (meaning no motion for set amount of time) you act on it in the rules to turn off the backlight.

That makes it very versatile and easy to tune the time the backlight needs to auto power off.

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#11 Post by Grumpf » 14 Jan 2021, 09:00

I guess I can do it this way. It'll require a bit more programming as I need Domoticz to send and on/off signal to the motion detection mechanism. I also want a radio switch to turn on the light and in this case prevent the off when no motion is detected. I'll need to research how to send a variable to the Esp and use it in the rules then.

Thanks.

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Contactless wakeup for LCD

#12 Post by Ath » 14 Jan 2021, 09:56

Grumpf wrote: 14 Jan 2021, 09:00 I'll need to research how to send a variable to the Esp and use it in the rules then.
You can send (a) value(s) to an ESPEasy unit by sending an event or a TaskValueSet command, something in this line:

Code: Select all

http://ip.of.esp.unit/control?cmd=event,setvalues=value1,value2
and in rules:

Code: Select all

on SetValues do
  TaskValueSet,<tasknr>,<varnr1>,%eventvalue1%
  TaskValueSet,<tasknr>,<varnr2>,%eventvalue2%
endon
or (but less flexible)

Code: Select all

http://ip.of.esp.unit/control?cmd=taskvalueset,tasknr,varnr,value
/Ton

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Contactless wakeup for LCD

#13 Post by Ath » 14 Jan 2021, 10:10

Grumpf wrote: 02 Dec 2020, 22:10 @Ath keep me posted when your sensor arrives.
I have received the sensors, but haven't gotten to connecting them up :?
Btw, the TCRT5000 looks useless for this purpose, as it has a range of around 10 millimeters, usable for like tracking a (white) trace on the floor or something (haven't properly investigated though).

The PIR sensor acts like a switch, so should be usable for the intended purpose, just need finish some other stuff before I'll pick that up.
/Ton

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#14 Post by Grumpf » 14 Jan 2021, 10:30

Thanks a lot. The TCRT5000 can be use for waving your hand above a clock for example ?

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#15 Post by Grumpf » 14 Jan 2021, 18:02

I'm trying something like this :

Code: Select all

on wave#State do
  if [wave#state]=1
   gpio,2,0
   timerSet 1,10
  endon

on Rules#Timer=1 do
   gpio,2,1
endon 
It works but it is erratic, sometimes the led stays on longer and sometimes the sensor doesn't pick up movement for a while... Dunno why.

Is it because of my device declaration perhaps ?
2021-01-14 18_01_25-Thirty-two.png
2021-01-14 18_01_25-Thirty-two.png (66.56 KiB) Viewed 784 times

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#16 Post by TD-er » 14 Jan 2021, 18:31

You should use another pin since GPIO-16 doesn't support interrupts.

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#17 Post by Grumpf » 14 Jan 2021, 18:35

Will do, thanks again !

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#18 Post by Grumpf » 14 Jan 2021, 18:53

Mmm not sure :? , I changed for D5 and it triggers fine but stops after 10 seconds, even if I dance in front of it while active (fully clothed be reassured). Shouldn't it retrigger the counter to 10 every time it detects a movement ?
Also, when I do that, it seems that it won't re-trigger for a certain time, maybe linked to the time I spend waving while its active ?
Is my button declaration correct for this sensor ?

Cheers !

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#19 Post by TD-er » 14 Jan 2021, 18:57

Code: Select all

on wave#State do
  if [wave#state]=1
   gpio,2,0
   timerSet 1,10
  endif // Missed this one
endon

on Rules#Timer=1 do
   gpio,2,1
endon 
You missed an "endif"

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#20 Post by Grumpf » 14 Jan 2021, 19:02

shame.jpg
shame.jpg (72.74 KiB) Viewed 770 times

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#21 Post by TD-er » 14 Jan 2021, 20:34

It happens to me a lot (also in C++), so it is one of those things I check as one of the first things in debugging.
So maybe it should also be done in the rules parsing to help via the logs to indicate mismatch in if/endif etc.

User avatar
Grumpf
Normal user
Posts: 100
Joined: 05 May 2017, 23:45
Location: Namur

Re: Contactless wakeup for LCD

#22 Post by Grumpf » 16 Jan 2021, 18:55

All right, this is what I got so far. Any advice welcome :

So 2 devices, one for the motion sensor and one for a Led or just variable status.
2021-01-16 18_30_12-Thirty-two.png
2021-01-16 18_30_12-Thirty-two.png (24.81 KiB) Viewed 550 times
Device one, the sensor :
2021-01-16 18_31_08-Thirty-two.png
2021-01-16 18_31_08-Thirty-two.png (67.23 KiB) Viewed 550 times
Device two, the variable/Led
2021-01-16 18_31_29-Thirty-two.png
2021-01-16 18_31_29-Thirty-two.png (78.81 KiB) Viewed 550 times
Rules being :

Code: Select all

on wave#State do
  if [wave#state]=1
   gpio,2,0
   timerSet 1,10
  endif
endon

on Rules#Timer=1 do
  if [D6#State]=0
   gpio,2,1
  endif
endon 

On ForceOn do
  gpio,12,1
endon

On ForceOff do
  gpio,12,0
endon
If I send http://172.19.0.232/control?cmd=event,ForceOn the sensor will not enable gpio2 until it received the ForceOff and end of timer.
So that works but I have two questions :

How can I simply force wave#state to 0 or 1 with a simple command to prevent using device linked to a GPIO and/or, how can I read a GPIO value ?

Thanks !

PS: Yes I can also do an event that'll do the reverse and prevent triggering in case of detection but I don't need this feature.

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Contactless wakeup for LCD

#23 Post by TD-er » 16 Jan 2021, 20:45

To get a pin state, see: https://espeasy.readthedocs.io/en/lates ... red-values
[Plugin#GPIO#Pinstate#N]
By searching through that page for "[plugin" you can find more spots where it is explained (but I cannot link to it directly)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 18 guests