Moteino gets power from RX pin or any other digital pin

Started by barbaran, August 03, 2018, 07:50:23 AM

barbaran

Hi all,

I am connecting the sensor Honeywell N56XXX https://aidc.honeywell.com/en-US/Pages/Product.aspx?category=OEM-scanner&cat=HSM&pid=N5600 using the UART Serial line. I'm experiecing a weird situation. With no power line connected to moteino, as soon as I power the N56 I see the moteino getting power (through RX line which is TX line from the N56). And also when using SoftwareSerial I get the same situation.

As a consecunce of this, I get a unexpected reboot on the moteino when the moteino gets a message via Lora.

When I power the moteino and N56 from same or different power supply it happens the same, getting around 15 mA (taking into account that Lora is powered) from RX line. However, if I connect the FTDI to the moteino, and I use SoftwareSerial with the N56 then I get normal behaviour.

Many thanks!

Other information:
Moteino version: Rev.6 + Lora + Flash.

Felix

Hi barbaran,
I am not really surprised anything strange will happen if you apply random power to pins of the atmega328 (other than VIN/VCC). I would expect a large impedance on the serial line from the N56 sensor though, not to allow so much power to go through those pins (and actually power a Moteino!).

The part about reboot is fuzzy, not clear if the Moteino is running from the "N56 serial power" or ... ?

However I am more interested about the situation where the N56 and Moteino share a power supply.
How about using some resistors (try 1K, 10K) on the TX/RX lines?

barbaran

Hi Felix,

I realized there was a problem because I sent a Lora message to the moteino, and when TX line from N56 was connected to the moteino, I got a reboot. I guess because moteino is getting power from the N56 and there is not enough current to power the Lora module to receive.

I was surprise, becasue I was powering moteino and N56 from the same power supply unit. Then, I tried to use two different power supplies sharing the ground line, with same result. I'm quite stuck with this.

Could you give me an idea how to make it work?

Is there a way to tell moteino to get power from Vin instead of RX line?

Many thanks indeed.

Felix

Quote from: barbaran on August 03, 2018, 09:59:23 AM
I realized there was a problem because I sent a Lora message to the moteino, and when TX line from N56 was connected to the moteino, I got a reboot. I guess because moteino is getting power from the N56 and there is not enough current to power the Lora module to receive.
That would completely explain it although I need to repeat that powering the atmega328 through the TX/RX is probably a very bag thing, if that's indeed what's happening. It SHOULD NOT happen. I have not seen this happen with serial devices before, BUT applying power to random pins of the atmega (including serial) can cause strange things to happen.
Please DONT expect the Moteino to work correctly when you power it from anything other than the GND+VIN pins.

Quote from: barbaran on August 03, 2018, 09:59:23 AM
I was surprise, becasue I was powering moteino and N56 from the same power supply unit. Then, I tried to use two different power supplies sharing the ground line, with same result. I'm quite stuck with this.

Could you give me an idea how to make it work?

Is there a way to tell moteino to get power from Vin instead of RX line?

Tell it to get its power from VIN instead of RX line? Interesting question :)
I think the answer is "no", and you have to ensure that power is applied properly to both devices and the serial lines present a high enough impedance to each other. Normally when you setup the Moteino TX/RX pins as Serial, and the other device works properly this should certainly not happen. The assumption is they both are powered and the serial lines are not used for power.

Did you see my suggestion about inserting resistors in the serial lines?

Are your Moteino pins properly defined and setup?

Is anything else wired in your circuit and what power supply are we talking about?

Sergegsx

Hola! Please post a picture of your setup for better analysis

barbaran

Hi Felix,

Many thanks for the information. I have not applied the resistor to the RX line, but it makes a lot of sense to me, I'll give it a try and let you know.

Hi Sergegsx,

My setup it pretty straightforward, no external components, just the sensor plugged to the moteino Serial line and powered up from a power supply.

I'll keep you updated with the resistor in RX line.

Many thanks both!