suggestions on project

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

suggestions on project

#1 Post by bobbybeans » 25 Apr 2018, 12:59

Hey guys
I recently bought touch lamp circuits (see below).
https://tinyurl.com/ya4va4ua
These are fantastic. I have installed them on every single lamp I own. All you have to do is touch the metal frame of the lamp and it turns on, no actual physical switch. I have also just last night succesfully attached it to home automation. I installed along side of the touch switch a wemos and a prototyping shield with a bc548 and a 15k resistor on it, Powered by transformer down to 240 to 5v. Works a treat.
When someone touches it, there is a sense wire that gets pulled to ground because the person touching it is ground, which signals the lamp board to turn the light on. the wemos does the same thing with the bc548 by pulsing it to ground and it turns on.

The problem I am having is when a person touches it, the wemos with ESPeasy doesn't know that it is touched so there is no feedback to domoticz. On the domoticz page it still shows as "off" but the light is physically "on"
Do you guys have any suggestions on how to remedy this?
I was thinking of 2 possible solutions. Below is a diagram to give you a graphical representation of how its wired up .
1 ) I need to "sense" if there is AC voltage on the white wire. I dont need to know the current or voltage, all i need to do is tell if its there. But how do i do that? I can't really find anything on aliexpress that would align for my project. Because When I touch the lamp, the circuit opens and allows current to flow through the white wire and back to the black wire. Any suggestions? The few things I did find on ali were only rated up to 24v ac. I need 240v.... I tried dropping the voltage down with a series of 10x10m resistors but that only brought it down to 50v. Plus even if I were to attach more and get it down to 24v ac. I dont think the wemos would like it.

2) since the sense wire (yellow) is being touch, it is being pulled to ground. I could have another transistor in parrallel to the BC548 but flipped to when the base is pulled down via the sense line it would signal back to a GPIO pin on the wemos then I can have espeasy handle it from there. However I am not sure if that would work.

Do any of you have ANY suggestions at all?

Edit: forgot to add power to the wemos diagram. i am not going to fix it, just imagine it is there. its not really part of the problem so its fine missing :)
Attachments
Capture.PNG
Capture.PNG (71.13 KiB) Viewed 8283 times

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: suggestions on project

#2 Post by budman1758 » 25 Apr 2018, 18:14

2 possibilities come to mind. One is a current sensor that reads the load on the lamp side of the circuit. Something like this.....
https://www.ebay.com/itm/5A-20A-30A-Ran ... KauXtL4h1g

The other is a small power supply that gets energized from the lamp side of the circuit. Use the output to trigger a gpio.
https://www.ebay.com/itm/AC-DC-3-3V-800 ... SwHUhZ~ChJ

I'm sure there are other more elegant solutions but both of the above are cheap and fairly easy.
"The glass is twice as big as it needs to be".

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: suggestions on project

#3 Post by Domosapiens » 25 Apr 2018, 20:15

30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

Re: suggestions on project

#4 Post by bobbybeans » 26 Apr 2018, 01:21

budman1758 wrote: 25 Apr 2018, 18:14 2 possibilities come to mind. One is a current sensor that reads the load on the lamp side of the circuit. Something like this.....
https://www.ebay.com/itm/5A-20A-30A-Ran ... KauXtL4h1g

The other is a small power supply that gets energized from the lamp side of the circuit. Use the output to trigger a gpio.
https://www.ebay.com/itm/AC-DC-3-3V-800 ... SwHUhZ~ChJ

I'm sure there are other more elegant solutions but both of the above are cheap and fairly easy.


hmm never thought of a power supply! sorta wasteful but at the same time i like that idea.
As for the current sensor module. I saw this while browing ali but i was not sure if that would work. Obvioulsy it detects current but is it able to handle 240v? if it does I might do that because it is smaller and would fit in the boxes I bought comparitively to the octocoupler mentioned below


@Domosapiens
I like that idea but it looks only suited for 12v. if its on the white wire and black wire it would need to work for 240v. the yellow sense wire going to the red wire on the circuit is 12 volts. so that would work however with the item you linked it would detect voltage all the time. With it on or off it doesn't matter it still has 12 volts.
you gave me inspiration to look for other octocoupler stuff and I think i may have found one that does 240v.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: suggestions on project

#5 Post by Domosapiens » 26 Apr 2018, 13:17

Yep, sorry,

I posted the wrong link.
This one is 230V
https://nl.aliexpress.com/item/1-Bit-AC ... Title=true
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

Re: suggestions on project

#6 Post by bobbybeans » 03 May 2018, 00:40

Thank you for this, I have actually ordered 2 and they came today very very quickly. Haven't tested them besides hooking them up to mains but they look nice. What I may do is build a custom shield that fits on top of a wemos along with an output transistor so its able to do flipping of the touch sensor.
The only compenent on there that I am confused on is the diode. There is a 100uf 25v cap, 150k resistor 47k resistor, an led, an octocoupler- el817 , a rectifier -MB6M
The diode is labeled 5.1v 5t. From google it says a zener diode? does this sound correct?(im not a part expert)
Also does anybody know what would happen if I made a shield that would supprt this whole circuit minus the LED. Can I remove the cap then as well? I THINK the caps purpose is to prevent the LED from flickering as it is in series with the LED after the voltage gets recitified.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: suggestions on project

#7 Post by Domosapiens » 03 May 2018, 17:22

A good practice in electronics is drawing a schema ;)
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

Re: suggestions on project

#8 Post by bobbybeans » 06 May 2018, 12:20

lol ok, I will do this for you guys as I already somewhat did that in my head. However even with a schematic I wouldn't know if I could remove components and I wouldnt be able to bread board test it either as its mains voltage and my breadboard is not rated for that
Based on the diagram I believe I can completely bypass the cap and the led but im not 100% sure can someone answer that with more electrial engineering? I can take high res pics of the board as well if that helps because I know my schematic is not graphically accurate as they did not have all the components in it so I had to improvise
Please see attachment
Attachments
output.PNG
output.PNG (108.3 KiB) Viewed 8095 times

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: suggestions on project

#9 Post by Domosapiens » 07 May 2018, 00:46

I know my schematic is not graphically accurate as they did not have all the components in it
Lost your pencil ???
bypass the cap
don't think so, .. it's to reduce the 50/100 Hz ripple after rectification
and the led
don't think so ... it reduces the input on the el817 with around 2V compared to the zener voltage (without checking the el817 spec.)

My suggestion:
- make a correct drawing
- study the component specs
- get your arguments straight
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

bobbybeans
Normal user
Posts: 119
Joined: 26 Feb 2017, 17:30

Re: suggestions on project

#10 Post by bobbybeans » 07 May 2018, 13:39

Domosapiens wrote: 07 May 2018, 00:46
I know my schematic is not graphically accurate as they did not have all the components in it
Lost your pencil ???
bypass the cap
don't think so, .. it's to reduce the 50/100 Hz ripple after rectification
and the led
don't think so ... it reduces the input on the el817 with around 2V compared to the zener voltage (without checking the el817 spec.)

My suggestion:
- make a correct drawing
- study the component specs
- get your arguments straight
Thanks for your suggestions however you dont have to be so condescending about it. Not going to draw it out as it would be 100x worse than the schematic i gave you above. I can take pictures of the board if youd like
it is a "correct" drawing based on where the traces go to and from. The actual items aren't correct but even if i had a library to chose from or to try and draw it out, it wouldn't be correct either because im not an electrical engineer nor have i taken a class in it. its what i have learned here and online
not sure what you mean by get your arguments straight. All i am asking is would it work without the LED and cap. And by your answer it wouldn't

here is the max values for the chip
Forward current IF 60 mA
Peak forward current (1us, pulse) IFP 1 A
Reverse voltage VR 6 V
Power dissipation
Derating factor (above Ta = 100°C)
PD
100 mW
2.9 mW/°C

Input
Parameter Symbol Min. Typ. Max. Unit Condition
Forward Voltage VF - 1.2 1.4 V IF = 20mA
Reverse Current IR - - 10 µA VR = 4V
Input capacitance Cin - 30 250 pF V = 0, f = 1kHz
Last edited by bobbybeans on 07 May 2018, 18:03, edited 1 time in total.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: suggestions on project

#11 Post by Domosapiens » 07 May 2018, 15:59

The cap is needed to smooth and not replaceable.
The LED could be replaced by a 1KOhm resistor to limit the in-going current ...but ..
The LED has also a voltage threshold function.
So ... why changing a proven design ?
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests