Power up from VIN issue

Started by odiephd, February 27, 2017, 12:36:14 PM

odiephd

I am having issue powering up my new Motes RFM69HW when connected to VIN.  I searched the forum and found this info: https://lowpowerlab.com/forum/moteino/moteino-power-up-problem/msg16607/#msg16607.

However, I shorted GND and DTR with a wire and it worked once only.  I tried adding a 0.1uF cap across RST and GND.  I see 3.3V at both 3v3 output pins.  The first mote would blink a couple times then stay solid for a second while the 2nd mote won't even blink.

Both motes work flawlessly powered through FTDI/USB computer.

What is the resolution to this issue?

Thanks
Jim

Felix

Can you give more details how you are using them? Anything attached to them? Are you using the SPI?
What sketch are you trying to upload?
The initial blinking is from the bootloader.

odiephd


One node has a CO2 sensor connected to it through UART (D5/D6 with software serial), and the other node has a SHT31 temp/hum sensor (I2C).  The sketches work fine powered by USB/FTDI computer.  They are just the modified sketches from your node/gateway examples with the necessary libraries for the sensor integrations.   Both are attached. 

SPI....that's for the wireless programming, right?.  I am not doing any wireless flashing.

These are the motes I just received a couple days ago.    BTW, I have the start of my wireless Pi gateway working with some simple python code.  I am just want to power my nodes by battery to continue my testing.  Each node needs to have both the CO2 sensor and SHT31 temp/hum sensor integrated. 

Lastly, I am powering it with a 9V battery through VIN/GND...not the 3v3 pin OUT.  I learned my lesson on that one :)

Thanks for your help in advance
Jim

perky

If you have any signals connected to a device when the decive is supposed to be powered down be aware that if those signals are high they can parasitically power the device through the device's substrate diodes. For example, if you've got an FTDI connector driving the MCU's RX pin, but not supplying power, the MCU may remain powered up and might not get a reset. Just something to be aware of.

Mark.

odiephd

Hi Mark,

I connect to the FTDI/USB to verify the sketch is working.  I unplug it from FTDI/USB power and it takes about 10 sec to hook up the battery power to VIN (I've tried 4 different batteries and tested them w/multimeter as well).  Even if I wait 30 min, there is no difference. 

I've even taken the sensor off so there is nothing connected to the mote.  Makes no difference.

I have tried both motes.  Neither one blinks when I connect battery.  There is 3.3v at 3v3 pin out. 

And both work fine connected through FTDI/USB computer. 

Such a simple thing....what am I missing?

odiephd

More Info:   

I powered my mote through the FTDI/USB, confirmed its working, connected the battery then disconnected the FTDI/USB power and the mote continues to work fine. 

If I try to connect the battery directly, it still doesn't work.

(in the meantime, I integrated both the temp/hum & CO2 sensors, and had it powered by battery using the trick above.  This trick won't work long term so I need a permanent solution.)

I'll try the the pull-up 10K resistor between SCK and 3V3, and report back.


odiephd

With two Motes:

I added a 10K resistor between 3v3 and pin 13 (SCK), and tried to power with battery.  No luck.  LED did not blink.
I moved the resistor between 3v3 and pin 12 (MISO), and tried to power with battery.  No luck.  LED did not blink.

Now what??

perky

Quote from: odiephd on February 27, 2017, 08:23:36 PM
With two Motes:

I added a 10K resistor between 3v3 and pin 13 (SCK), and tried to power with battery.  No luck.  LED did not blink.
I moved the resistor between 3v3 and pin 12 (MISO), and tried to power with battery.  No luck.  LED did not blink.

Now what??

You need to do some debugging. I think you're going to have to use a 'scope and toggle an I/O pin or two to get to the bottom of this. Can you reduce the code down to the simplest possible program that shows this behaviour?

First is to check whether the processor actually comes out of reset (toggle a I/O pin and look at it on a 'scope). Look at 3.3V on a 'scope, does it discharge fully before you re-enabled the power? Is the RST signal clean, and what you expect? If it does come out of reset is it blocking somewhere in the code and where? Is there an interrupt continually firing and making it look like it has slowed right down to a crawl (that would make the blinking frequency really, really slow so might appear to be stuck)?

Mark.

odiephd

Good morning Mark.  Thank you for the reply.  I'm sorry, I don't have an oscilloscope to check the pins. 

I just took one of the two offending motes, uploaded the basic node-testing sketch, and confirmed it worked through FTDI/USB, then disconnected it  I attached the battery and it worked perfectly.  I did this because last night I assembled two other motes and did the same and they worked perfectly. 

Now, the problem must be the code.   Oh my!  My plan is to reduce my code to find the issue.   I only added a couple libraries to integrate two sensors so it shouldn't be too hard to find the problem.

I will report back soon.  THANK YOU !!

Jim

Felix

I suggest starting from a plain simple blinky (no extra libs or hardware). The normal blink will tell you the main program is running. Thats the simplest way to debug this problem.

odiephd

I am starting with the node_testing program because it works perfectly from FTDI/USB and battery power.  I compiled the sketch and looked more carefully through the log, and found a warning near the top as follows:

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_MOTEINO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\Odiephd\Documents\Arduino\libraries\RFM69-master" "-IC:\Users\Odiephd\Documents\Arduino\libraries\SPIFlash-master" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "C:\Users\Odiephd\AppData\Local\Temp\arduino_build_882262\sketch\Node_testing_example_HP.ino.cpp" -o "C:\Users\Odiephd\AppData\Local\Temp\arduino_build_882262\sketch\Node_testing_example_HP.ino.cpp.o"
In file included from C:\Users\Odiephd\Documents\Cell Safe\Moteino\Node_testing_example_HP\Node_testing_example_HP.ino:27:0:

C:\Users\Odiephd\Documents\Arduino\libraries\RFM69-master/RFM69.h:128:40: warning: unused parameter 'CTLbyte' [-Wunused-parameter]

     virtual void interruptHook(uint8_t CTLbyte) {};
[/size]


I really don't know what this means exactly but could this be the start of the issue?   How can I tell if I am using the most current RFM69 library?

sparky

Quote from: odiephd on February 28, 2017, 01:07:57 PM
How can I tell if I am using the most current RFM69 library?

Download from GitHub and you will have the most current;
https://github.com/LowPowerLab/RFM69

odiephd

That's where I got it so I'm good there...

odiephd

I started with the node_testing_example using Mote #1, added the Adafruit SHT31 libraries, and line by line I checked that it would power between FTDI/USB and a 9V battery on VIN.  I successfully built and transmitted a new payload (called playload) with Temp, Humidity to a nearby MoteUSB receiver/Pi gateway. 

I added the SandboxElectronics library & SoftwareSerial (in the correct initialization order) for the NDIR-Z16 CO2 sensor.
           //#include <SoftwareSerial.h>
           //#include <NDIR_SoftwareSerial.h>
           //NDIR_SoftwareSerial mySensor(5,6);   //Rx=5,Tx=6


- Before I added these 3 lines, Mote #1 worked perfect between FTDI/USB power and battery power.
- I added the CO2 sensor to digital pins 5,6
- When I added the below 2 libraries and initialized mySensor, it worked powered by FTDI/USB but not battery.
- When I removed 3 these lines, re-compiled, and uploaded, it worked using FTDI/USB but NOT battery.
- Including only the library include lines caused no issues. 
- Problem with powering from battery occurred when I added the 3rd line, and it went to initialize mySensor which was connected.
- Tried to get Mote #1 to work right so I uploaded the original Node_testing_example to Mote #1 but it won't power by battery.

So, I switched Motes and uploaded this sketch to Mote #2 with the 3 lines above commented and the temp/hum sensor connected, and it works perfectly between FTDI/USB and 9V battery power.

Here's the stupid/newbie questions/comments:

1. Is my problem because I am using pins 5,6?  Can I used pin 1=Tx, pin 0=Rx for serial communication for my CO2 sensor?
2. The two motes I used yesterday and had this problem seem to reset overnight and when I tested them with the node_testing_example, they worked perfectly.  Yet, I cannot get Mote #1 to work for the moment even though I shorted RST & GND (no power connected).  I also tried powering it by battery with shorted DTR and GND (a trick from another thread).

What do I try next?

Thanks
Jim


odiephd

I started with fresh Mote #3 and connected my CO2 sensor only.  It could not be powered by the 9V battery, yet it worked fine connected to USB.  A light bulb went off and I decided to check the power requirements for the sensor. 

CO2 sensor:  http://sandboxelectronics.com/?product=mh-z16-ndir-co2-sensor-with-i2cuart-5v3-3v-interface-for-arduinoraspeberry-pi

Give a big warning in middle of page saying that its best to power the arduino with 12V power supply.

However, the specification sheet for the sensor says it only requires < 85mA.
See here:  http://sandboxelectronics.com/wp-content/uploads/2015/06/MH-Z16_CO2_datasheet_EN.pdf

Question/comment: 
- Doesn't the arduino have a voltage regulator on it?  Why would powering it with a 12V supply be best?
- I was powering the Mote & CO2 sensor with 9V battery?  Why wouldn't that be sufficient??
- I don't have alternative 3.3/5V power supply to connect to the sensor.
- I ordered female USB connectors and a 5V/1A cube to power my Mote and sensors.  When I get that tested, I guess I will know more.

Rather confused & very much appreciate the support of the forum,
Jim