Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Filter this topic showing only the reply marked as answer View this topic in a long page with up to 500 replies per page Create new topic
1 | 2 
Fully Operational
3343 posts

Uber Geek
+1 received by user: 1088

Trusted
Vocus
Subscriber

  Reply # 1866332 14-Sep-2017 16:07
Send private message quote this post

chimera:
ubergeeknz:

 

Let me further elucidate my answer:

 

9v high - 5.5v low

 

If you use a 6v zener + 100k pulldown

 


Would a Schottky diode suffice or does it need to be a zener diode because of the reverse biasing?

 

Has to be a zener, because you want to drop the voltage by a set amount.  Apologies as "reverse bias" I think is the wrong term.  What we want is "reverse breakdown voltage" which is the voltage at which a diode will allow current to flow "backwards".

 

Reverse breakdown voltage on a schottky is going to be somewhere around 100 volts and forward is about 0.2 - neither are useful to you here.  

 

A zener has a specified reverse breakdown voltage of your choosing, so the voltage differential (across the zener) remains effectively constant once that voltage is exceeded.  This gives you the voltage drop required want to drive your input high without overloading it, and means it will not conduct at all when the input is "low"

 

https://www.jaycar.co.nz/active-components/discrete/zener-diodes/c/211F here is a range, you would pick the best value to bring the "high" level between 2.5 and 3.3v (high as per http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/esp8266ex-gpio-high-and-low-input-thresholds/)

 

If you want to protect against overvoltage on the GPIO pin, you could also use a 3.3v zener across the pulldown and put a relatively small resistor (10k or so) in the path. But this complicates things further and is probably not needed.  From what I read the ESP8266 will withstand some overvoltage on the GPIO pins.

 

excuse the abysmal diagram

 

       6.2v    10k             100k 

 

 in ---Z<---/\/\/--gpio--+--\/\/\---+--gnd

 

9v                    ~2.7v   +---Z<---+

 

                                        3.3v (for protection)


1905 posts

Uber Geek
+1 received by user: 602

Subscriber

  Reply # 1866528 14-Sep-2017 21:17
Send private message quote this post

I wouldn't use zener diodes in this application. As their reverse breakdown voltage is not stable if you put less than 5mA through them. And any current that you draw from the alarm wiring will affect the voltages on the alarm zones. And if the ESP has inbuilt pull up or down resistors you have to allow for them as well.

And if the ESP has schottky type input logic, you might not get enough voltage swing on its inputs to reliably trigger it.

I have used zener diodes heaps in other applications, but I can see this one becoming a nightmare to diagnose if it doesn't work first time.





 
 
 
 


321 posts

Ultimate Geek
+1 received by user: 114


  Reply # 1866548 14-Sep-2017 22:21
Send private message quote this post

I suggest you experiment a little more with your PIR. The output of the PIR is probably open collector or alternatively open emitter. if it is either of these, you'll be quids in.

 

To tell which one it is, put a resistor (mebbe 1K to start with) to the power rail. See what happens when your device is active and not.

 

Repeat with the resistor switched to ground ( as @worzel mentioned).

 

If you end up with a situation he predicted with a low voltage thats ok but a high voltage that exceeds your power rail, this would be bad (i.e. smoke) for your input device. Easy way to deal with this is to limit the current (with series resistor) and and then limit the voltage with a clamping diode. This goes between the input pin and the voltage rail.

 

 




248 posts

Master Geek
+1 received by user: 50

Subscriber

  Reply # 1866553 14-Sep-2017 22:49
Send private message quote this post

I have not built/tested with the zener diode idea quite yet - for now however, I've done some reading and at the very least, I have an understanding of how a zener diode works - so thanks for the character based fritzing v0.2 diagram!!! Based on that, your description and the article article I managed to decipher the electronic buzz words and made sense of it

http://www.instructables.com/id/How-To-Diodes/

I'll experiment when I have time over the weekend and see how I go. I did get "fault" appearing on the alarm control panel with one of my attempts so it maybe susceptible to voltage drops (or poor attempts at wiring breadboards)

1 post

Wannabe Geek
Inactive user


  Reply # 1866586 15-Sep-2017 06:33
Send private message quote this post

Hi...as per my knowledge  10k ohms will give you close to 0v when not triggered.  If you still get 9v when triggered you are in business.  If not, try putting the resistor between the output and the supply voltage of the PIR instead and see if the voltage goes to 0v when not triggered.

 


1699 posts

Uber Geek
+1 received by user: 866


  Reply # 1866592 15-Sep-2017 06:45
One person supports this post
Send private message quote this post

Alarms have tamper proof circuits to the sensors. They expect certain voltages when on and off, if you pull the voltages out of range, you'll trigger the tamper protection.

Of all the advice here, I'd be going with aredwood, mostly because his solution seems least likely to mess up your alarm.





Location: Dunedin



248 posts

Master Geek
+1 received by user: 50

Subscriber

  Reply # 1882150 11-Oct-2017 22:10
Send private message quote this post

Aredwood:

 

@chimera Use a voltage comparator. The LM339 would be ideal for what you want. You simply feed 2 different voltage levels into it, and an output switches on and off depending on which input has more voltage than the other. Jaycar sell it for $2.40 ZL-3339

 

Connect the LM339 to the 12V supply from the alarm. Use 2 resistors as a voltage divider to get whatever voltage you want as your "changeover voltage" (7V maybe?) Connect that voltage to all of the minus input pins of the comparator. and connect each + input pin to an alarm zone. Since the LM339 is a quad comparator, it will do up to 4 alarm zones.

 

The output pins are open collector, meaning they are either open circuit, or connected to ground. If the ESP8266 has inbuilt pullup resistors on it's inputs, simply connect it's input pins to the comparator outputs. Otherwise just connect 10K resistors between the ESPs 5V rail and the input pins. Because of the open collector design, you can connect the comparator output pins together, if you want to monitor say 4 zones, but you don't need to know which zone got triggered. Just that a zone got triggered.

 

Swap the + and - inputs if you want to swap the output between 0V = zone triggered and 0V = zone normal.

 

Another trick is to use a 10K multi turn variable resistor as a voltage divider. Connect the end terminals to 12V and ground. And the wiper terminal is your reference voltage. So you can then adjust the changeover voltage easily if you want.

 

Remember to link the alarm system ground and the ESPs ground together.

 

 

I finally got around to testing this tonight.  I've tried an LM339 and setup as suggested, with 12V rail / GND from alarm powering LM339, voltage divider with a couple of 3300ohm resistors to drop 12V (which is actually about 13.2V) to about 6.6V.  I've run wire from alarm zone to Z1 (testing this first) to comparator input pin 1+, and run 'voltage divided' power to input pin 1-  On the pin 1 output I've connected an LED - with its GND leg to output pin 1, and the LED + leg to a 1k ohm resistor then off to the +12V rail (for starters at least, so I can visually see if it works)  Under normal operation, it appears to work fine - I go and walk in front of the PIR, and the LED illuminates (4.3V read via multimeter when Z1 triggered), then when the PIR goes back to idle, the LED turns off (and 7.9V read via multimeter when Z1 is idle)

 

However, the issue is the PIR zone voltage when the alarm system powers up.  On power up, the multimeter shows Z1 for the first ~1 second reads about 5.8V (LED flashes), then voltage drops to 4.3V (LED turns on) for about ~8 seconds, then eventually jumps back up to 7.9V (LED turns off)  When I get around to programming the Wemos, because its powered off the alarm system, I could do a delay for the first 10 seconds or so to ignore the GPIO inputs, but would rather solve via circuitry to avoid any discrepancies.

 

Any ideas?

 

 


1905 posts

Uber Geek
+1 received by user: 602

Subscriber

  Reply # 1882828 13-Oct-2017 10:07
Send private message quote this post

@chimera I have only just seen your post. It looks like the alarm PIR is doing some sort of power on test. To narrow it down disconnect the zone wire from the alarm zone input terminal. And tempoarlly connect a 3.3K resistor between the zone wire and ground. to simulate the internal pull down resistor. Test again, then you will know if it is the panel or the sensors causing it to trigger.

Also test a tamper zone and test with the alarm running on the backup battery instead of mains.





1905 posts

Uber Geek
+1 received by user: 602

Subscriber

  Reply # 1882836 13-Oct-2017 10:20
Send private message quote this post

Another thought. It could also be the panel doing a power on self test. Assuming you are monitoring all 4 zones, the best method might be some code that tells the wemos to ignore the alarm if all 4 zones get triggered at the same time.

And test the panel without any sensors connected to the zone by wiring a 2.2k resistor between the zone terminal and 12V.







248 posts

Master Geek
+1 received by user: 50

Subscriber

  Reply # 1882844 13-Oct-2017 10:27
Send private message quote this post

Aredwood: Another thought. It could also be the panel doing a power on self test. Assuming you are monitoring all 4 zones, the best method might be some code that tells the wemos to ignore the alarm if all 4 zones get triggered at the same time.

 

I think this is what it is - I checked it last night, and if I power on the alarm system, and peak at all PIR's (without moving to trigger them obviously) I can see all PIR LED's light up throughout the duration of the alarm POST sequence (about 8-10 seconds or so)  

 

Your latter suggestion is genius... as highly unlikely 4 burglars will be breaking into 4 different areas of the house at the same time! cool

 

Thanks again!

 

 




248 posts

Master Geek
+1 received by user: 50

Subscriber

  Reply # 1882907 13-Oct-2017 11:49
Send private message quote this post

So I did a quick test of voltage across zones Z1, Z2, Z3 and Z4.  I've been testing so far with Z3, which is throwing out 7.89V when idle, and about 4.38V when triggered. 

 

I put a multimeter across Z4, got same readings. 

 

I put a multimeter across Z1 and Z2, they show 6.68V when idle, and 0V when triggered.

 

All zones have the blue 'PIR movement' wire in it, on closer inspection zone Z3 also has a white wire that goes to the external siren (assume siren tamper) and Z4 has a white wire to a resistor in series then onto a momentary switch on the front of the alarm panel box (must be box tamper)

 

So had to alter voltage divider to read somewhere in the middle of 4.3V and 6.68V.  Have opt'd for 12V to 5V drop (actually reads 5.4V) which is a 4.7 ohm and 6.8 ohm resistor.  That's quite a large voltage drop though?

 

It works for all zones, but will need to see what voltage reads if the box or siren tamper is triggered next (maybe I'll get some earplugs first) - perhaps the combination of which may alert me to when the alarm is actually triggered.

 

I'm guessing any changes I make need to have no / or very minimal changes to any voltage the alarm panel is seeing.

 

 


1905 posts

Uber Geek
+1 received by user: 602

Subscriber

  Reply # 1883226 14-Oct-2017 02:08
Send private message quote this post

@chimera The current that the voltage comparator draws from the alarm zones is measured in nanoamps. And changing the voltage divider won't have any effect on the alarm either apart from a very small change to the amount of power drawn from it's 12V supply. And assuming you wired it how I described. Switching off or power cycling the ESP won't affect the alarm either.

 

Your alarm uses "EOL Wiring" as per your circuit diagram that you posted earlier. Since you are getting different voltages on some of the zones when they have been triggered. It means that the original installer hasn't put all of the EOL resistors on all of the zones. EOL wiring is based on voltage dividers (resistors in both series and parallel) With different switches disconnecting or connecting different resistors into or out of the voltage divider. Which is how the alarm has 8 zones despite only having 4 zone inputs.

 

So you can see why I said not to go with the other suggestions of adding more voltage dividers into midpoints of existing voltage dividers, with some active components (zener diodes) for good measure.

 

You can also add a second comparator IC, setup with a different reference voltage. If you want to be able to tell the difference between an alarm due to a triggered PIR and an alarm due to a tamper condition.

 

The comparator can also easily be used for mains failure detection or low battery voltage detection. (with suitable input circuitry of course - easy to make though).








248 posts

Master Geek
+1 received by user: 50

Subscriber

  Reply # 1883268 14-Oct-2017 10:08
Send private message quote this post

Thanks, yes I considered the tiny amp draw after I posted but couldn’t edit the post, negligible watts lost to heat.

I actually rang the installer the other day, he said there are EOL resistors wired into the PIR’s (which I opened and confirmed) and also the siren box, and said that’s why they’re called “end of line”, except the box tamper though as obviously it’s tamper switch is in the alarm panel. He also ran me through the manual and how to get into installer mode and make changes - quite a bit to take in.

I’ve got the WeMos chip programmed up and yes they do have internal pull-ups so I’ve managed to get it reading either 3.3V when idle or 0V when triggered. Just need to fix up the code to have the last state remembered for each zone and also put some delays in as my initial attempt caused it to read totally wrong.

I’ll post the setup and code and some pictures of how it looks when done. A second comparator with different voltage divider is a good idea though although I’ll complete the first phase until it’s robust enough before moving to the next.

Thanks again



248 posts

Master Geek
+1 received by user: 50

Subscriber

  Reply # 1884498 16-Oct-2017 18:14
One person supports this post
Send private message quote this post

Got the basic's of this going last night, works pretty well. Thanks so much for your help Aredwood, it makes sense, well - now that I've done it! 

 

EDIT: The only one downside, is the Wemos doesn't power up when the alarm powers up.  Suspect the alarm panel must draw a bit of power on startup, I'll try some capacitors for the Wemos see if that helps.  Other issue is powering off alarm panel all the time for testing, comes up with fault 12 hours later but luckily it is only because the date/time isn't set.

 

 

 

Breadboard to alarm...

 

 

iPhone view of OpenHAB

 

 

 


1 | 2 
Filter this topic showing only the reply marked as answer View this topic in a long page with up to 500 replies per page Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Vodafone TV — television in the cloud
Posted 17-Oct-2017 19:29


Nokia 8 review: Classy midrange pure Android phone
Posted 16-Oct-2017 07:27


Why carriers might want to embrace Commerce Commission study, MVNOs
Posted 13-Oct-2017 09:42


Fitbit launches Ionic, its health and fitness smartwatch
Posted 12-Oct-2017 15:52


Xero launches machine learning automation to improve coding accuracy for small businesses
Posted 12-Oct-2017 15:45


Bank of New Zealand uses Intel AI to detect financial crime
Posted 12-Oct-2017 15:39


Sony launches Xperia XZ1, a smartphone with real-time 3D capture
Posted 11-Oct-2017 10:26


Notes on Nokia’s phone comeback
Posted 10-Oct-2017 10:06


Air New Zealand begins Inflight Wi-Fi rollout
Posted 9-Oct-2017 20:16


The latest mobile phones in perspective
Posted 9-Oct-2017 18:34


Review: Acronis True Image 2018 — serious backup
Posted 8-Oct-2017 11:22


Lenovo launches ThinkPad Anniversary Edition 25
Posted 7-Oct-2017 23:16


Less fone, more tech as Vodafone gets brand make-over
Posted 6-Oct-2017 08:16


API Talent Achieves AWS MSP Partner Status
Posted 5-Oct-2017 21:20


Stellar Consulting Group now a Domo Partner
Posted 5-Oct-2017 21:03



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.