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 | 3 | 4 
chimera

506 posts

Ultimate Geek


  #1958828 15-Feb-2018 22:24
Send private message

You mean what GPIO pins on Wemos from comparator output? 1,2,3 and 5



elpenguino
3427 posts

Uber Geek


  #1960082 18-Feb-2018 22:27
Send private message

https://zoetrope.io/tech-blog/esp8266-bootloader-modes-and-gpio-state-startup/

 

Says you go into boot loader mode with GPIO2 high at boot?

 

What's the state of the GPIOs you named when wemos boot occurs.

 

Might be as simple as choosing another GPIO, if you have a spare.





Most of the posters in this thread are just like chimpanzees on MDMA, full of feelings of bonhomie, joy, and optimism. Fred99 8/4/21


chimera

506 posts

Ultimate Geek


  #1960677 19-Feb-2018 23:55
Send private message

Thanks, I’ll try that tomorrow. Would be good to find the source of the problem as opposed to band aiding it. However at the time controlling power by MOSFET worked so I wiped my hands of it and had moved onto the next project (which works pretty well too, using photoresistor to count the LED ‘blinks’ that come from the power meter and send to OpenHAB. It blinks when every 1kWh is used, so is like a poor mans power meter. OpenHAB calculates current kW load, plus daily and monthly kWh usage. Plenty of articles out there on how to make one. I just love the simplistic nature of it)



chimera

506 posts

Ultimate Geek


  #1961012 20-Feb-2018 15:04
Send private message

I'd forgotten I'd already gone ahead and soldered the MOSFET and wiring for it in, so bypassing is too much work to test.  Other than that, the above is related to the ESP chip itself.  Whilst the Wemos uses the ESP chip, it has extra smarts around flashing it, pin states that will differ from the above.  I'll leave it at that, don't have the patience to redo a breadboard to test this.  It works, and is good enough :-)

 

 


chimera

506 posts

Ultimate Geek


  #1965404 27-Feb-2018 22:19
Send private message

May have to revisit this or at least build in some form of protection. I’ve blown 2 x GPIO pins on 2 x different Wemos chips - however this has likely been where I’ve stuffed up with MQTT persistence and caused the Wemos to boot up then reboot constantly - overnight the first time (didn’t realize til one zone stopped reporting), the second time not realizing my MQTT mistake and swapping it out with a new chip then troubleshooting - looped hard out again and blew a different GPIO pin on the new Wemos. Basically i have the ability to send a “reset” request to all my ESP devices to remotely reboot when needed. That cmd was persisted causing the issue. I’ve since realized my mistake and resolved, however - I’m not 100% sure whether the cause is due to the nature of the constant rebooting, or whether it’s due to some voltage spike or higher current from the alarm system either directly or indirectly caused by the rebooting.

Any thoughts?

elpenguino
3427 posts

Uber Geek


  #1965410 27-Feb-2018 22:48
Send private message

Were the blown GPIOs set to be used as input or outputs?

 

We've run through IO protection in the various answers already.

 

Current limiting resistors and clamping diodes will get you most of the way there.





Most of the posters in this thread are just like chimpanzees on MDMA, full of feelings of bonhomie, joy, and optimism. Fred99 8/4/21


chimera

506 posts

Ultimate Geek


  #1965414 27-Feb-2018 23:04
Send private message

Input pull-ups

Ok, will re read - electronics isn’t my strong point, im more a software guy than hardware so takes a little longer to get my head around it :-)

So effectively some current limiting resistors between the comparator outputs and GPIO inputs may help. I’d need to measure current hitting the pins at present and reduce to something more suited to logic inputs, using ohms law to calculate an effective sized resistor correct?

 
 
 

Trade NZ and US shares and funds with Sharesies (affiliate link).
elpenguino
3427 posts

Uber Geek


  #1966010 28-Feb-2018 16:48
Send private message

Well sort of. You don't need to measure your current now, you plan for the current you want. Yes, Ohms law, data sheets, absolute maximum ratings etc.

 

Practically though , you could use 1k - 10k and you'll usually be grand.

 

Whats the supply voltage on the comparator chip?





Most of the posters in this thread are just like chimpanzees on MDMA, full of feelings of bonhomie, joy, and optimism. Fred99 8/4/21


chimera

506 posts

Ultimate Geek


  #1966035 28-Feb-2018 17:56
Send private message

12V supply to comparator.

Voltage divider for a comparator reference voltage of about 5.4V on inverting side, varies on the non inverting side depending on PIR (6.65-7.92V when idle, between 0-4.35V when triggered), input pull-ups on GPIO pins from comparator outputs.

chimera

506 posts

Ultimate Geek


  #1966743 1-Mar-2018 19:17
Send private message

Put 10K resistors to all GPIO's, tried it but zone 3 stopped reporting its state.  Found this site, http://www.esp8266learning.com/wemos-d1-mini-hardware.php and it shows pin already has 10K pullup on it, so removed that resistor and shes all go again. 

 

 


elpenguino
3427 posts

Uber Geek


  #1966891 2-Mar-2018 09:26
Send private message

Good stuff.

 

I would suggest you disconnect your comparator from the IO chip and measure the voltage max and mins.

 

If those values exceed the controller's power rail voltage then you need the clamping diodes as well.





Most of the posters in this thread are just like chimpanzees on MDMA, full of feelings of bonhomie, joy, and optimism. Fred99 8/4/21


chimera

506 posts

Ultimate Geek


  #1966893 2-Mar-2018 09:27
Send private message

Thanks,.... do you mind explaining that in laymen’s terms and why it’s needed?

Aredwood
3885 posts

Uber Geek


  #1967342 2-Mar-2018 23:26

chimera:

Put 10K resistors to all GPIO's, tried it but zone 3 stopped reporting its state.  Found this site, http://www.esp8266learning.com/wemos-d1-mini-hardware.php and it shows pin already has 10K pullup on it, so removed that resistor and shes all go again. 


 



Use 1K resistors instead. As per my previous post. Using 10K means that you have a voltage divider of 2x 10K resistors in series (pull up resistor and external resistor). This means that the GPIO pin voltage would only fall to 2.5V when a zone is triggered. Nowhere near low enough to register a valid logic 0.

Using 1K resistors means the the GPIO voltage when a zone is triggered, will be approx 0.5V Definitely low enough to be a valid logic 0.

You shouldn't be getting any 12V coming from the comparator, as it's outputs are open collector. Meaning the outputs are either connected to ground, or open circuit.





chimera

506 posts

Ultimate Geek


  #1967344 2-Mar-2018 23:39
Send private message

@elpenguino and @aredwood

Awesome, thanks guys - makes a lot more sense now you’ve explained it, thanks heaps.

1 | 2 | 3 | 4 
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





News and reviews »

Gen Threat Report Reveals Rise in Crypto, Sextortion and Tech Support Scams
Posted 7-Aug-2025 13:09


Logitech G and McLaren Racing Sign New, Expanded Multi-Year Partnership
Posted 7-Aug-2025 13:00


A Third of New Zealanders Fall for Online Scams Says Trend Micro
Posted 7-Aug-2025 12:43


OPPO Releases Its Most Stylish and Compact Smartwatch Yet, the Watch X2 Mini.
Posted 7-Aug-2025 12:37


Epson Launches New High-End EH-LS9000B Home Theatre Laser Projector
Posted 7-Aug-2025 12:34


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









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.