0

For few days, I am trying to figure out, why my sensors do not work on external power. I bought NodeMCU along with couple different sensors etc. I was happily working with them, connecting them one by one to the 3.3v pin in the NodeMCU board, programming each of them. Everything was working as expected. After I have finished, I decided it's time to use them all at once, but I knew, that for that to work, I need to provide them with enough power, as USB probably won't be enough (plus, when I'm done, I don't plan to use USB to power the system anyway). I have a module that converts 230v AC into 5v DC, and then I am stepping it down to 3.3v in order to power the sensors. After checking with multimeter, the voltages are ok, and so is the current.

My problem is, that the sensors give completely random data (most of the time they don't give any information, but once in a while they send something like 1000 times the normal value). Below you can see the schematic that I use. Can you please help me figure this out?

Edit: I would just like to add - I did try to run NodeMCU solely on the Ext. Power - the circuit looked exactly as below, I just connected positive output of 3.3v power source, to the 3.3v connector on NodeMCU. The board was working (I was able to control the onboard LED via WiFI), but the sensor did not. I then reconnected the sensor from external power, to NodeMcu 3.3v, and it (the sensor) worked... I have no idea why.

schematic

simulate this circuit – Schematic created using CircuitLab

5
  • 1
    Did you connect both ground (Arduino, ext. power) together permanently or only for testing voltage difference?
    – user31481
    Oct 21, 2017 at 20:40
  • I did connect them (NodeMCU GND <-> Ext. Power GND) permanently, to test if the sensors will start working. They still were behaving randomly, so I removed that connection.
    – ojek
    Oct 21, 2017 at 20:46
  • 1
    @ojek hackingmajenkoblog.wordpress.com/2016/12/06/…
    – Majenko
    Oct 21, 2017 at 20:53
  • @Majenko: Thanks. I did read about common ground before. That's why I decided to power the whole system only by "Ext. Power 3.3v" (so no USB). And it still behaves the same way - sensor Vin/GND connected to NodeMCU works, but when I connect them to Ext. Power it stops working.
    – ojek
    Oct 21, 2017 at 21:03
  • 1
    Line noise, maybe? Do you have an osc? Can you give us more information on the power supply side of the story?
    – user31481
    Oct 21, 2017 at 21:18

2 Answers 2

1

Sorry I don't have reputation for a comment but this might be of help.

You didn't specify if the sensor was a breakout board. If it is then the board may already have the resistor in place, which is why removing it worked.

Now if you had the resistor in place when it was also connected to the nodeMCU, then perhaps power from it was high enough to still generate a stable operating condition (not familiar with nodeMCU) but more likely you have a power supply issue.

  • Is it a module and does it have resistor on board.

  • was the 27k resistor only in circuit on external power.

If the answer was yes to the above that is probably the issue.

If they are not the cause, my next check would be your external power. It could need calibration, power spikes/ripples etc but the easiest thing to do is put in a smoothing capacitor in circuit after your power supply.

Probably about 20-30% of my sensor issues are resolved by this. Another 60% are solved by fixing my screw ups and assumptions.

2
  • Ugh I just realized you were talking about the current the sensor draws. I had a brain dump (assumptions will be the death of me). You need to just get rid of the resistor. The sensor, if voltage is right will only draw what it needs. I'm guessing you didn't have it in circuit before you went to external power.
    – Tibsy
    Oct 23, 2017 at 20:35
  • I feel really bad for an answer that made such a bad assumption. My apologies. Let me know if you work out the cause.
    – Tibsy
    Oct 23, 2017 at 20:43
0

I have fiddled with it a little more. Turns out, that the resistor I was putting in the circuit was the cause of failure - the sensor did not have enough power.

Now this is very weird to me, as the sensor is rated at 190uA max, and it is not working on this current. Only after I removed the resistor (so the current was around 800mA) it started operating as it should have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.