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
2083 posts

Uber Geek

Subscriber

  # 1893446 1-Nov-2017 08:57
One person supports this post
Send private message

Very impressed with your Instructable. Very well done. 




401 posts

Ultimate Geek


  # 1893611 1-Nov-2017 13:23
Send private message

linw:

 

Very impressed with your Instructable. Very well done. 

 

 

Thanks! I find it frustrating that too many instructables projects assumes the person following it, already has knowledge in what they're following - which kind of defeats the purpose because if they did, then they would already be able to work it out themselves.  I like to write instructables so the person gets educated as they follow the steps in the project - its really a summary of what I learn't doing it myself.

 

Feel free to vote for it if you like :-)  I've entered into the instructables electronics competition - worth a shot...!

 

 





 

 


 
 
 
 




401 posts

Ultimate Geek


  # 1956881 14-Feb-2018 10:51
Send private message

chimera:

 

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

 

 

 

 

 

 

 

I want to revisit this... specifically my post above where I mention "The only one downside, is the Wemos doesn't power up when the alarm powers up."

 

As my alarm system has been powered on all this time, and the circuit was running off a breadboard I'd forgotten about this small issue.  While its powered, it runs fine (eg; power up alarm system, wait 5 seconds, and THEN plug power to the circuit)  I've now soldered this to a PCB and was going to enclose into the alarm panel, and noticed this small issue has come about again so need to remedy.

 

The issue is when everything is connected (circuit board to alarm and PIR zones etc) and I power up the alarm system (which also powers the Wemos) the Wemos doesn't work. The LED on it flashes once briefly, but it doesn't run.  I've worked out the issue is due to the GPIO's (that are connected to the comparator outputs) and I suspect its possibly something to do with the "alarm system power on test" (as I've tested it with comparator outputs unplugged, and it boots up fine)

 

The problem has something to do with the GPIO pins - I suspect the voltage that is hitting these is causing the issue, but I can't work out where or why. 

 

Any ideas?

 

 

 

Here is what it looks like (ignore the voltage reg on the right, that's been replaced with a buck convertor - although is irrelevant to the issue)

 

 

 





 

 


543 posts

Ultimate Geek

Subscriber

  # 1956909 14-Feb-2018 11:16
Send private message

Have you tried seeing if its the ESP8266 crashing?

 

If you plug it into a computer and bring up a serial terminal if it does crash it will dump the crash log.

 

It may be something as simple as a number being out of bounds during the power on cycle.

 

If its the LM339 crashing the only suggestion would be to put a p channel MOSFET on the power rail to the LM339 and have the ESP8266 bring it high after a select amount of time.





Geoff E

1032 posts

Uber Geek


  # 1957000 14-Feb-2018 12:17
Send private message

You should check the rise time on your power supply to the wemos. Make sure the rail doesn't take too long to come up.

 

If it is this, you can get reset ics that hold your MCU in reset until the power rail is up.




401 posts

Ultimate Geek


  # 1958320 14-Feb-2018 21:03
Send private message

It's not rise time, power is near immediate to Wemos (prior to buck convertor, 9V then jumps to about 12V - but seamless at 5V on buck output)

 

It's not ESP crashing, certainly not a coding issue.  As I say, works normally as per usual.

 

Delaying to power the LM339 makes sense, I'll work through this in my head and see how it goes.

 

Thanks for your replies!





 

 


1032 posts

Uber Geek


  # 1958342 14-Feb-2018 21:51
Send private message

There is more to crashes than software.
Yes, if you have current coming in the gpio before the cpu boots, that could be problematic.

Do any of those gpio signals exceed vcc?

 
 
 
 




401 posts

Ultimate Geek


  # 1958353 14-Feb-2018 22:26
Send private message

Yes actually they do. I think 6.6V I measured. The pins are defined as pull-ups in code, but you’re saying there is a likelihood that the higher voltage is hitting the pins before the board is able to boot and define those pins as pull-ups?

 

 

 

Confirmed voltage on GPIO pin jumps high to about 6.7V for 1-2 seconds before dropping down to the ~4.7V or so range.  How do I avoid this?!





 

 


1032 posts

Uber Geek


  # 1958369 14-Feb-2018 23:53
Send private message

It could be the fact the pin voltage exceeds VCC - usually modern chips can handle an active input pin on boot.

 

Solve with a clamp diode - anode on GPIO, cathode (stripe) on VCC.

 

More info on illegal pin states is in the hardware manual for the MCU (sorry not familiar with that particular one you have, just speaking generally with my comments).

 

http://www.kevinmfodor.com/home/My-Blog/microcontrollerinputprotectiontechniques

 

Pic half way down the page shows this idea. 


3885 posts

Uber Geek

Subscriber

  # 1958373 15-Feb-2018 01:35

@chimera Are you sure that your buck converter doesn't cause a voltage overshoot at power on? Also verify you have good ground connections between alarm, LM338 and wemos. As there will be large currents in the ground wires at switch on. Any resistance will mean voltage differences that shouldn't be there. You can get lots of weird and difficult to trace symptoms caused by high resistance ground connections.

What is the default state of the wemos gpio pins at switch on? if it is logic high, that combined with the alarm doing its self test and activating the LM338 will short the gpio pins. As they will be trying to go high and low at the same time.

Try installing 1Kohm resistors in the wires between the LM338 and wemos. This might fix your problem. And if not, you can measure the voltage across those resistors to figure out if power is flowing out of the wemos pins, or into them.

Most microcontroller boards have a power supervisor circuit that does the equivalent of continuously pushing the reset button until the power rails reach their correct voltages. Check what state the gpio pins are in while this is happening.







401 posts

Ultimate Geek


  # 1958419 15-Feb-2018 08:35
Send private message

Apologies, it was too late at night to be working on this... GPIO voltages are actually ok, I was measuring the comparator inputs rather than outputs undecided

 

I measured GPIO pin voltage and they are very low Vcc on power on.  GND connections from what I can see are good.  Buck convertor voltage output is dead on 5V on power up (plus as I say, if I plug power to the Wemos AFTER the alarm system has powered up it runs ok)  

 

However, I just did a test with the 12V VCC to the LM339 VCC unplugged, and the Wemos booted up fine.  So, if I control the LM339's power on by code instead, this should in theory work right?

 

If I'm powering on the LM339 via a MOSFET then I'd want an N channel wouldn't I?  Because the GPIO pin will be LOW on power up, and I'd need to provide HIGH to the gate to power it?  Or would it be better using a P channel MOSFET with pull up resistor then pull the gate LOW to power it?

 

 





 

 




401 posts

Ultimate Geek


  # 1958488 15-Feb-2018 10:42
Send private message

I had an N channel FET (2N7000) floating around so hooked it up with a 1K ohm resistor pulling the GPIO pin to ground, gate to GPIO, source to GND, drain to GND pin of LM339 and altered the code in setup to set "LM339" GPIO pin low first, then delay a few seconds, then pull it high and it worked a treat. Thanks Geocom for the suggestion! Question though - would it make more sense to use a P channel FET still?  Eg: so I'm not wasting power by holding a dedicated GPIO pin HIGH all the time?  Is that the main difference between P and N from a usability point of view? 

 

 





 

 


543 posts

Ultimate Geek

Subscriber

  # 1958536 15-Feb-2018 11:36
One person supports this post
Send private message

The key difference between a p-channel and n-channel is that p only works on positive and n only works on negative.

 

The reason I suggested a p-channel is in some chips the GND can be tied to multiple pins even ones not marked GND(https://www.youtube.com/watch?v=2yFh7Vv0Paw) where as this should not really be the case with the positive rail.

 

But if it works fine with a n-channel mosfet then there would be no real reason to change it for a p-channel one.





Geoff E

3885 posts

Uber Geek

Subscriber

  # 1958789 15-Feb-2018 20:47

Another possible test. Try temporarily connecting the 4 Wemos inputs to ground. And see if that stops it from booting.

It's always good to try and find the root cause, rather than have a possible unresolved race condition.





1032 posts

Uber Geek


  # 1958821 15-Feb-2018 22:12
Send private message

That's right @aredwood.

 

i suggest you follow his earlier suggestion to check the state of the GPIO's internal pullup/down at boot.

 

You might find that all you have to do is invert the signal arriving at the GPIO (and the corresponding software) or, flip a config bit in the IO config register.

 

BTW, what pin numbers use the comparator input?


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



Twitter and LinkedIn »



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 New Zealand starts two year partnership with LetsPlay.Live
Posted 28-Jan-2020 11:24


Ring launches indoor-only security camera
Posted 23-Jan-2020 17:26


New report findings will help schools implement the digital technologies curriculum content
Posted 23-Jan-2020 17:25


N4L to upgrade & support wireless internet inside schools
Posted 23-Jan-2020 17:22


Netflix releases 21 Studio Ghibli works
Posted 22-Jan-2020 11:42


Vodafone integrates eSIM into device and wearable roadmap
Posted 17-Jan-2020 09:45


Do you need this camera app? Group investigates privacy implications
Posted 16-Jan-2020 03:30


JBL launches headphones range designed for gaming
Posted 13-Jan-2020 09:59


Withings introduces ScanWatch wearable combining ECG and sleep apnea detection
Posted 9-Jan-2020 18:34


NZ Police releases public app
Posted 8-Jan-2020 11:43


Suunto 7 combine sports and smart features on new smartwatch generation
Posted 7-Jan-2020 16:06


Intel brings innovation with technology spanning the cloud, network, edge and PC
Posted 7-Jan-2020 15:54


AMD announces high performance desktop and ultrathin laptop processors
Posted 7-Jan-2020 15:42


AMD unveils four new desktop and mobile GPUs including AMD Radeon RX 5600
Posted 7-Jan-2020 15:32


Consolidation in video streaming market with Spark selling Lightbox to Sky
Posted 19-Dec-2019 09:09



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.