Unwanted power from Arduino

I noticed that when I turned off the power supply (connected to 9V battery), it still showed a green light. This was coming from the arduino, yet I only had pins 5,4,3,GND , A0 connected on the arduino.

  1. So where is this unwanted power supply coming from?
  2. Would my DC motor also be drawing current from the arduino since there is an unwanted power supply?

I disconnected it, but it was basically the most common way of connecting: 9V battery + power supply, L293D, DC Motor, Arduino

EDIT: Schematic

Schematic of my circuit or almost my circuit. There was a fan connected to the DC motor, and the goal was that when there is tilting (don't overlook the tilt sensor!), the DC motor was supposed to switch off.

Things to note:

  1. The 9V battery was connected to the power supply module (module from the Elegoo Super Starter Kit). I didn't see the power supply module in TinkerCAD

  2. Pretty sure that I did not have Pin 5 connected to GND and Pin 16 connected to the +ve rail. My circuit worked though.

Questions:

  1. When it tilted, the DC motor was supposed to switch off, however, it did not and rather slowed down. This was fixed when I did a digitalWrite() and set the tilt pin to be HIGH at the start. Can someone explain what the issue was – if it is more than what I saw at the surface level?

  2. So back to the main question, I clicked the button on the power supply module to turn off the supply from the 9V. However, the green light didn't turn off. The only things I remember connecting to the power supply module were: all the GNDs & Pin 8 from the L293D. The L293D supplied a voltage from the arduino?

  3. And another main question, when I ran my arduino code, my DC motor would run slowly. When I turned on the power supply module, it would then work as normal. Where was this power coming from – when the power supply module button was not pressed to be turned on.

===============================================================
Corrections:
I have posted the corrected schematic below:
"SW200D" is supposed to be a tilt sensor, i dont really know what SW200D is

Why is the wire connecting Pin 8 to the +ve power supply of the power module (module not on diagram) causing the power module's green light to turn on? I pressed the button to turn it off.

Do you think a block or schematic of how everything is connected might help us understand your problem ?

A sneak path through the data lines. Very, very bad for the continued health of your Arduino. That's all I can surmise in the absence of a very much required schematic.

hI, @randomarduino13122

What were they connected to?
Does the other bit of hardware have it own power supply?

Is most possibly the problem.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Do you have a DMM? Digital MultiMeter?

Tom.... :smiley: :+1: :coffee: :australia:

Here on the forum that is usually the wrong way.

1 Like

Your schematic shows nothing connected to the Arduino GND or Pin 2.

There are many other oddities in your schematic.

How about posting a schematic of your actual circuit instead of "almost your circuit"?

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

I made a mistake by saying pin 2 of the Arduino was connected to something so forget that bit.

I did this some time ago so the circuit has been disconnected. But this (see the post) is my intended circuit, I posted the corrected circuit

The logic (5volt) supply of the L293 (pin16) is not connected.
What is the SW200D part inline with A0 supposed to do.
Hopefully you're not using a smoke alarm battery.
Leo..

"SW200D" is supposed to be a tilt sensor, i dont really know what SW200D is

as for pin16, im only using 1 motor, so why do i need to connect a pin on the other side of the L293D?

Pin 16 is the power supply of the L293D, it must be connected to 5volt of the Arduino.
Pin8 is motor supply.
Leo..

1 Like

So i need to connect Pin 8 to the power supply module, and Pin 16 to the 5V from the arduino.

May I ask if i need to ground pins 4,5,12,13 of the L293D?

It's basically a switch (datasheet), so it needs to be wired like a switch. Specifically, you'll need a power source and a pull-up or pull-down resistor, and the output should probably go to a digital I/O pin, not A0. Currently, the way the SW-200D is wired, it is doing nothing.

Do you have any code for this project?

I would suggest connecting the SW-200D between GND and a digital I/O pin, and setting the pinMode for that pin to INPUT_PULLUP.

Alternatively, here is an example that uses an external pulldown resistor and a 5-V power source.:

my apologies, i didn't intend to use "SW200D" as SW200D. Just imagine that it is a tilt sensor.

My concern is Pin 8 causing my Elegoo power supply module green light to turn on. The corrected schematic is in my post.


from – Elegoo Super Starter Kit

Edit - i've wired it up with
Pin 16 --> +5V of Arduino
Pins 12 & 13 --> GND

and i decided to run blank arduino code. My power supply module green light isn't on when I've turned it on, anymore.

Not sure what happened...

I can;t understand what you've written. The SW-200D is a tilt sensor, I don't have to imagine it. If you're trying to say that you are using a different tilt sensor (not the SW-200D), then in all likelihood, my previous comment still applies. If not, you need to specify exactly what tilt sensor you are actually using.

Pin 8 of what?

I edited my reply to you so please check,

Apologies, the pin numbers referred to in my reply to you are for the L293D

If you want to get anywhere with your problem, I would suggest that you make some effort to respond to the request that has been made by @TomGeorge (twice) and others in this thread:

Maybe you should look over the L293D's datasheet and make some attempt to learn how it works.
https://www.st.com/resource/en/datasheet/l293d.pdf

It is a switch, on or off depending on orientation.

Yeah so i have a question (I have the 16-pin L293D)

Pin 8 --> external power supply
Pins 3&4 --> GND

Pin 16 --> 5V from Arduino
Pins 12&13 --> GND (same GND as above)

Do I need to do this if i am using only ONE Dc Motor? Relevant connections on the side that is Pins 1-->8
I understand that pin 16 is for logic, so more concerned about pins 12&13