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.


chimera

506 posts

Ultimate Geek


#223117 13-Sep-2017 16:12
Send private message

Electronics nerds,...

 

I have an alarm system where I have PIRs that read back to the controller as 9V when triggered and 5.5V when idle.

 

I need to convert from 9V to 3.3V, and 5.5V to 0V (or thereabouts) for GPIO input pins on an ESP8266 chip, as I want to read movement in the various zones, then have that sent as MQTT messages from ESP to OpenHAB which updates with the "date/time of the last movement detected".  I'll be using a Wemos D1 mini board.

 

I can't quite work out the resistor values for R1 and R2 to get the desired results however, there is a very fine tolerance for both and quite possibly not enough variance to differentiate between "high" and "low".  For example:

 

R1 = 6800 ohms, R2 = 900 ohms

 

Vin = 9V, Vout = 1.05V

 

Vin = 5.5V, Vout = 0.64V

 

Would a 3 resistor voltage divider work better?

 

I also can't find the datasheet for the Wemos D1 mini to find what the variance is for pin = LOW vs pin = HIGH, I seem to recall reading in the past LOW is < 0.75V or so.  If anyone knows has a link it would be most appreciated.

 

Anyways, is a voltage divider suitable in this case, or is there another solution that would work better?  I think I read somewhere that I could use MOSFET's to do this?

 

Any ideas?  

 

 

 

Thanks

 

 


View this topic in a long page with up to 500 replies per page Create new topic

This is a filtered page: currently showing replies marked as answers. Click here to see full discussion.

Aredwood
3885 posts

Uber Geek


  #1864865 14-Sep-2017 00:57

@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.








chimera

506 posts

Ultimate Geek


  #1892799 30-Oct-2017 19:30
Send private message

Created another instructable for this... to me its a good way of sharing an idea, plus by me documenting it, helps commit what I've learn't to memory!

 

https://www.instructables.com/id/Alarm-PIR-Movement-to-Home-Automation/

 

Thanks again Aredwood!

 

 


View this topic in a long page with up to 500 replies per page Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









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.