{"id":3304,"date":"2026-02-21T19:00:00","date_gmt":"2026-02-21T19:00:00","guid":{"rendered":"https:\/\/pirhome.com\/?p=3304"},"modified":"2026-02-21T19:00:00","modified_gmt":"2026-02-21T19:00:00","slug":"pir-comparator-hysteresis","status":"publish","type":"post","link":"https:\/\/www.pirhome.com\/?p=3304","title":{"rendered":"PIR Sensor Comparator Circuits: Hysteresis Design"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>The final stage in a PIR signal chain is a comparator that converts the analog signal to a clean digital output. Adding hysteresis prevents oscillation when the signal hovers near the threshold.<\/p>\n<h2>Why Hysteresis is Essential<\/h2>\n<p>Without hysteresis, when the input signal is near the threshold, noise can cause multiple rapid output transitions (chattering). Hysteresis creates two thresholds: one for rising edge (V_rising) and a lower one for falling edge (V_falling). This creates a dead zone that ignores noise.<\/p>\n<h2>Hysteresis Calculation<\/h2>\n<p>For a non-inverting comparator with positive feedback:<\/p>\n<ul>\n<li><strong>Upper threshold (V_UT):<\/strong> V_ref + (V_OH &#8211; V_ref) \u00d7 R1\/(R1+R2)<\/li>\n<li><strong>Lower threshold (V_LT):<\/strong> V_ref &#8211; V_ref \u00d7 R1\/(R1+R2) (assuming V_OL = 0)<\/li>\n<li><strong>Hysteresis width:<\/strong> \u0394V = (V_OH &#8211; V_OL) \u00d7 R1\/(R1+R2)<\/li>\n<\/ul>\n<p>Where V_OH is comparator output high voltage, V_OL is output low (near 0).<\/p>\n<h2>Design Example<\/h2>\n<p>Goal: Hysteresis of 100 mV around a threshold of 1.0V. Supply voltage = 3.3V, comparator output swings 0 to 3.3V.<\/p>\n<ol>\n<li>Choose R1 and R2 to set \u0394V. \u0394V = 3.3 \u00d7 R1\/(R1+R2) = 0.1V.<\/li>\n<li>R1\/(R1+R2) = 0.1\/3.3 = 0.0303.<\/li>\n<li>If R1 = 10k, then R2 = 10k \u00d7 (1\/0.0303 &#8211; 1) = 10k \u00d7 (33 &#8211; 1) = 320k (choose 330k).<\/li>\n<li>Center threshold set by V_ref. Use resistor divider from VCC to generate 1.0V.<\/li>\n<\/ol>\n<h2>Using Comparators with Built-in Hysteresis<\/h2>\n<p>Many comparators (e.g., LMV7235, MAX9025) have built-in hysteresis of a few millivolts. For larger hysteresis, external feedback is still needed.<\/p>\n<h2>Inverting vs. Non-Inverting<\/h2>\n<p>The above formula is for non-inverting configuration (signal to non-inverting input). For inverting, the calculation differs.<\/p>\n<h2>Practical Circuit<\/h2>\n<pre><code>Analog input \u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500 10k \u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500 Inverting input of comparator\n                 \u2502              \u2502\n               10k             \u2502\n                 \u2502              \u2502\nV_ref (1.0V) \u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500 Non-inverting input\n<\/code><\/pre>\n<h2>Adjusting Threshold Dynamically<\/h2>\n<p>For adaptive systems, the threshold can be generated by a DAC or PWM-filtered signal from a microcontroller, allowing software-adjustable sensitivity.<\/p>\n<h2>Output Pull-Up<\/h2>\n<p>If using an open-drain comparator, add a pull-up resistor to VCC. Choose value (e.g., 10k) for fast rise time.<\/p>\n<h2>Conclusion<\/h2>\n<p>Proper comparator design with hysteresis ensures clean, reliable digital output from your PIR sensor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction The final stage in a PIR signal chain is a comparator that converts the analog signal to a clean digital output. Adding hysteresis prevents oscillation when the signal hovers near the threshold. Why Hysteresis is Essential Without hysteresis, when the input signal is near the threshold, noise can cause multiple rapid output transitions (chattering). [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-3304","post","type-post","status-publish","format-standard","hentry","category-reference"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>PIR Sensor Comparator Circuits: Hysteresis Design - PIRHOME<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"http:\/\/www.pirhome.com\/?p=3304\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"PIR Sensor Comparator Circuits: Hysteresis Design - PIRHOME\" \/>\r\n<meta property=\"og:description\" content=\"Introduction The final stage in a PIR signal chain is a comparator that converts the analog signal to a clean digital output. Adding hysteresis prevents oscillation when the signal hovers near the threshold. Why Hysteresis is Essential Without hysteresis, when the input signal is near the threshold, noise can cause multiple rapid output transitions (chattering). [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"http:\/\/www.pirhome.com\/?p=3304\" \/>\r\n<meta property=\"og:site_name\" content=\"PIRHOME\" \/>\r\n<meta property=\"article:published_time\" content=\"2026-02-21T19:00:00+00:00\" \/>\r\n<meta name=\"author\" content=\"nic@nicsky.com\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"nic@nicsky.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3304#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3304\"},\"author\":{\"name\":\"nic@nicsky.com\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\"},\"headline\":\"PIR Sensor Comparator Circuits: Hysteresis Design\",\"datePublished\":\"2026-02-21T19:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3304\"},\"wordCount\":318,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"articleSection\":[\"Reference\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=3304#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3304\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3304\",\"name\":\"PIR Sensor Comparator Circuits: Hysteresis Design - PIRHOME\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\"},\"datePublished\":\"2026-02-21T19:00:00+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3304#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=3304\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=3304#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.pirhome.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PIR Sensor Comparator Circuits: Hysteresis Design\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/\",\"name\":\"PIRHOME\",\"description\":\"PIR &amp; Motion Sensor\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/www.pirhome.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\",\"name\":\"PIRHOME\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.pirhome.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pirhome.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg\",\"width\":512,\"height\":512,\"caption\":\"PIRHOME\"},\"image\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\",\"name\":\"nic@nicsky.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"caption\":\"nic@nicsky.com\"},\"sameAs\":[\"http:\\\/\\\/www.pirhome.com\"],\"url\":\"https:\\\/\\\/www.pirhome.com\\\/?author=1\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PIR Sensor Comparator Circuits: Hysteresis Design - PIRHOME","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.pirhome.com\/?p=3304","og_locale":"en_US","og_type":"article","og_title":"PIR Sensor Comparator Circuits: Hysteresis Design - PIRHOME","og_description":"Introduction The final stage in a PIR signal chain is a comparator that converts the analog signal to a clean digital output. Adding hysteresis prevents oscillation when the signal hovers near the threshold. Why Hysteresis is Essential Without hysteresis, when the input signal is near the threshold, noise can cause multiple rapid output transitions (chattering). [&hellip;]","og_url":"http:\/\/www.pirhome.com\/?p=3304","og_site_name":"PIRHOME","article_published_time":"2026-02-21T19:00:00+00:00","author":"nic@nicsky.com","twitter_card":"summary_large_image","twitter_misc":{"Written by":"nic@nicsky.com","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.pirhome.com\/?p=3304#article","isPartOf":{"@id":"http:\/\/www.pirhome.com\/?p=3304"},"author":{"name":"nic@nicsky.com","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3"},"headline":"PIR Sensor Comparator Circuits: Hysteresis Design","datePublished":"2026-02-21T19:00:00+00:00","mainEntityOfPage":{"@id":"http:\/\/www.pirhome.com\/?p=3304"},"wordCount":318,"commentCount":0,"publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"articleSection":["Reference"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.pirhome.com\/?p=3304#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.pirhome.com\/?p=3304","url":"http:\/\/www.pirhome.com\/?p=3304","name":"PIR Sensor Comparator Circuits: Hysteresis Design - PIRHOME","isPartOf":{"@id":"http:\/\/www.pirhome.com\/#website"},"datePublished":"2026-02-21T19:00:00+00:00","breadcrumb":{"@id":"http:\/\/www.pirhome.com\/?p=3304#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.pirhome.com\/?p=3304"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.pirhome.com\/?p=3304#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.pirhome.com\/"},{"@type":"ListItem","position":2,"name":"PIR Sensor Comparator Circuits: Hysteresis Design"}]},{"@type":"WebSite","@id":"http:\/\/www.pirhome.com\/#website","url":"http:\/\/www.pirhome.com\/","name":"PIRHOME","description":"PIR &amp; Motion Sensor","publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.pirhome.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/www.pirhome.com\/#organization","name":"PIRHOME","url":"http:\/\/www.pirhome.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.pirhome.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.pirhome.com\/wp-content\/uploads\/2026\/02\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg","contentUrl":"https:\/\/www.pirhome.com\/wp-content\/uploads\/2026\/02\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg","width":512,"height":512,"caption":"PIRHOME"},"image":{"@id":"http:\/\/www.pirhome.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3","name":"nic@nicsky.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","caption":"nic@nicsky.com"},"sameAs":["http:\/\/www.pirhome.com"],"url":"https:\/\/www.pirhome.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/3304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3304"}],"version-history":[{"count":1,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/3304\/revisions"}],"predecessor-version":[{"id":3336,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/3304\/revisions\/3336"}],"wp:attachment":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}