Why does an external analog circuit make the arduino pro mini onboard LED blink?

Hi!

This is my first post in this forum so have mercy on me if i look stupid! :slight_smile:

I have made a circuit where I use an Pro Mini to control a 5V miniature relay and a buzzer using three buttons.
The output of the relay activates a solenoid that needs 8.5V to operate.
Since I want a single 9V battery to feed both the Arduino and the solenoid I have used this circuit to indicate if the voltage drops below 8.5V:

I have connected the circuit in parallel with the Arduino.
See the attached schematics.
I use pinMode(7, INPUT_PULLUP) for the buttons.

When I adjust the trim pot so that the battery indicator LED is OFF the internal LED(Pin13) starts to flash slowly.

When I adjust it so that the LED is ON, the circuit and program works as wanted.

Why does the Arduino react to the value of the trimpot?
It does not make any sense!

Please enlighten me!

First of all, why the hell are you running 9V into the VCC pin of the board?
The RAW pin is there for a reason

Hi,
What are the specs of the solenoid and is the the battery one of thses?

You will find it will not last long and probably be not able to activate the solenoid.
What are the specs of the buzzer and the 5V relay?
Do you have a DMM to measure circuit parameters?

Tom.... :slight_smile:

Nothing else matters until he sorts out how he's putting 9v into the board's VCC which is like the Uno's 5v pin.

Hi,

INTP:
Nothing else matters until he sorts out how how's putting 9v into the board's VCC which is like the Uno's 5v pin.

That's why I asked after your post.. lol

Tom.. :slight_smile:

INTP:
First of all, why the hell are you running 9V into the VCC pin of the board?
The RAW pin is there for a reason

LOL! Didn't you read my first request?

MrDoLittleLess:
This is my first post in this forum so have mercy on me if i look stupid! :slight_smile:

Anyway, thanks for your gentle lesson! :slight_smile:

This is my first Arduino project as well so now I am wiser than before I connected the +9V to VCC.
Never again!

I really didn't know that the RAW pin was connected before the Voltage regulator.
Every tutorial on the web connects the positive voltage to VCC and the negative to GND so I thought it was the way to do it.

But now I stand corrected! Very corrected!

TomGeorge:
What are the specs of the solenoid and is the the battery one of thses?

The solenoid has these specs:
Model: JF-0530B
Rated Voltage: DC6V
Rated Current:300mA
And yes, that is the kind of battery I plan on using.

TomGeorge:
What are the specs of the buzzer and the 5V relay?

The Buzzer has these specs:
Rated Voltage:3VDC
Operating Voltage:2VDC~5VDC
Rated Current:≤25mA

The 5V relay has these specs:
Type: HK 19F
Nominal Voltage: 5VDC
Coil resistance: 125 Ohm

TomGeorge:
Do you have a DMM to measure circuit parameters?

Yes I have.

I'm really looking forward to your feedback!

Hi,
OPs Circuit,


The relay you are using, just meets the output current rating of the controller.

5V / 125R = 40mA,
How ever that current and the more than 300mA for the solenoid will mean the battery will not last very long.

When you have connected the battery to the correct terminal oft he controller, measure the battery voltage with your DMM with the solenoid OFF and then ON.

Tom... :slight_smile:

With the +9V connected to the RAW pin it works just fine. Thanks @INTP !

The battery voltage readings are like this:

Battery not yet connected to the circuit:
9.31V
Powering the Arduino and a LED:
9.18V
Powering the Arduino and a two LEDs:
9.12V
Powering the Arduino, a LED and the buzzer:
9.08V
Powering the Arduino, two LEDs, the Relay and the solenoid:
5.97V

Regarding the battery consumption...
The circuit will be off most of the time.
It will maybe be turned on for 10 sessions per week.
Each session will last approximately 20 min.
The relay will be activated in 300ms, once in each session.

Will using 6 x 1.5V AA batteries instead of a single 9V 6LR61 battery give better battery life?

Yes. 9V is basically 6 AAAA batteries.
Though I'd consider 2 18650's which are rechargeable.

Hi,
If you are still using the PP3 battery you will keep having this problem, the battery voltage is going up and down when you set the low batt level because the load changes, that is another LED comes ON.

Try putting a 1000uF 16V electrolytic capacitor across the 9V battery, this may help with load changes.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Thanks.. Tom... :slight_smile:

@TomGeorge

Will a 1000uF 10V work as well? I couldn't find a 16V at home...

I'd rather not post the complete circuit and sketch in public since this project is kind of a surprise and I am not sure who is watching the forum... :slight_smile:

Is it OK if I send you a PM instead?
This thread has gotten quite a bit OT anyways.

Hi,
10V will be fine as long as you keep the supply to 9V to try out, but long term I'd use a 16V.

Tom.. :slight_smile:

The capacitor does even out the load a bit:

Battery not yet connected to the circuit:
8.75V
Powering the Arduino and a LED plus the low voltage LED:
8.67V
Powering the Arduino and a two LEDs plus the low voltage LED:
8.63V
Powering the Arduino, a LED and the buzzer plus the low voltage LED:
8.63V
Powering the Arduino, two LEDs, the Relay and the solenoid plus the low voltage LED:
5.57V

I also measured the total current through the circuit:
Powering the Arduino and a LED plus the low voltage LED:
36 mA
Powering the Arduino and a two LEDs plus the low voltage LED:
53 mA
Powering the Arduino, a LED and the buzzer plus the low voltage LED:
56 mA
Powering the Arduino, two LEDs, the Relay and the solenoid plus the low voltage LED:
1.57 A

I find the last value is far too high considering that the solenoid is rated 300mA.
Why is that? Is it because I feed 9V into a solenoid rated 6V?

By using Ohm's law the coil resistance should be
R=6/0.3=20 Ohm

In that case the current should be reading 450mA if using a 9V source instead:
I=9/20=450mA

Am I right or making a fool out of myself again? :wink: