Voltage monitor and switching control. Initial design thoughts

Hello all,

First post on here, have spent some time reading through various threads.

I am building a portable radio box for outings and am wanting something like a UPS setup but on the +12 Volt level.

The box will have an internal Battery, and an external Input.

I want to draw from the external source when its safe (voltage in range), saving the internal charge.

My thought is to use a mosfet setup to switch the Sources. Ideally i'd like to have switching to be fast enough to remain on without interrupt.

I do intend on putting a current shunt in to monitor and cut off the load if the current rises to high.

I am slowly learning code, but am more concerned if my idea will work.

If it works as I think it should, i could use a battery on the input until its low, and the Controller flips to internal, the i could plug in a second external battery and the controller would see it and return to the input feeding the load.

I am also looking at making a charger to use input voltage to step up and charge the internal battery, But that is a project for later.

I know i will need Voltage dividers, and once the tested solution is working i will be ordering some tight tolerance parts to build the final unit. For now i have 1/2 Watt, 5% resistors to use.

I have a Nano that i have made show a variable voltage on the 20x4 LCD, I have some relays and shunts but have not gotten that far.

Nor have i started on any form of code for the project.

Just looking for thoughts and input for now

Thanks all,
Joe

Do you need a switch? Why not just use a 12v battery with a mains float charger or solar panel?

mikb55:
Do you need a switch? Why not just use a 12v battery with a mains float charger or solar panel?

Hi,

The system will be run for extended periods 24-48+hrs non stop away from civilization. I am figuring on needing 225Ah to 400Ah per 24hrs. Depending on radios used. Its a fair amount to haul around, hence wanting to make it a simple swap allowing the use of lighter packs.

I also don’t deeply discharge my battery’s as it shortens life span, therefore it requires more Capacity and swaps.

Cheers,
Joe

For seamless switching between batteries use two Schottky diodes or mosfet based "ideal diode" modules (beware of cheap fakes on Ebay/Aliexpress).

There are lots of commercial 12v 'battery guard' type products that provide an automatic low voltage cutoff. You'll need two of those.

Hi,
Welcome to the Forum.

Can you define "radios" and what sort of load they represent?
What will your "charger" source be? PV cells or a powersupply type charger.

Thanks.. Tom.. :slight_smile:

mikb55:
For seamless switching between batteries use two Schottky diodes or mosfet based "ideal diode" modules (beware of cheap fakes on Ebay/Aliexpress).

There are lots of commercial 12v 'battery guard' type products that provide an automatic low voltage cutoff. You'll need two of those.

A Schottky Diode setup will only prevent interaction between battery's running both down together in essence. I looked there first, i want to use up the external battery to its cut off before it switches to using internal.

As for Battery guards, sure they would be great if that wouldn't cost me $200+ for them alone.

Not trying to be mean or bitter, but i wouldn't be here if off the shelf gadgets were of interest.

My interest is in making a home brew Arduino setup to achieve my goals.

TomGeorge:
Hi,
Welcome to the Forum.

Can you define "radios" and what sort of load they represent?
What will your "charger" source be? PV cells or a powersupply type charger.

Thanks.. Tom.. :slight_smile:

Loading will be a undetermined combination of These, while possibly possibly both HF rigs they will never be TX at the same time.
Ft-450D 22A Tx, 1.5A RX
Netbook Acer Aspire 1
FT-707 20A TX, 1A? RX (untested)
FTM-350 10A TX, 0.5A RX
TM-281a 14A TX, 1A RX
Raspberry pi with 7" Screen
Plus a couple LED lights and charging my Cell.

Charging source will be at home from AC power.

External battery's will likey be 8D flooded deep cycles, or 6v AGM's
Internal will most likely be SLA arrangement of limited capacity.

I have not spent much time looking at hardware today, but i did spend some time on my desk, tinkering with code and kit.

Running from UBS power, and using a buck converter from a 13.8v power supply to provide variable voltage for testing.

I have made an LED do exactly what i want a Mosfet to do on a simple scale. I do want to add a variable that lets its stay out of range for 3 delay counts before tripping. This should save the false trips from load spikes.

I have came to the conclusion that my 14 year old Radio shack 22-805 DMM needs replacement, as its not reading accurately. Most likely will be replaced with a Chinese marketed Fluke

Todays code as of now, ( i do have line numbering turned on for simplicity of pointing out errors)

/*
  DC Voltmeter
  An Arduino DVM based on voltage divider concept
  T.K.Hareendran
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
const int analogInput = 0;
const int ledout = 13;
float vout = 0.0;
float vin = 0.0;
float R1 = 4610.0; // resistance of R1 (100K) -see text!
float R2 = 2163.0; // resistance of R2 (10K) - see text!
int value = 0;
void setup() {
  pinMode(analogInput, INPUT);
  pinMode(ledout, OUTPUT);
  lcd.begin(20, 4);
  lcd.print("DC VOLTMETER");
}
void loop() {
  // read the value at analog input
  value = analogRead(analogInput);
  vout = (value * 4.50) / 1023.0; // see text
  vin = vout / (R2 / (R1 + R2));
  if (vin < 0.09) {
    vin = 0.0; //statement to quash undesired reading !
  }
  lcd.setCursor(0, 1);
  lcd.print("INPUT V= ");
  lcd.print(vin);
  if (vin < 7.0) {
    digitalWrite(ledout, HIGH);
  } else {
    digitalWrite(ledout, LOW);
  }
  if (vin > 10.0) {
    digitalWrite(ledout, HIGH);
  } else {
    digitalWrite(ledout, LOW);
  }
  delay(500);
}

I have no doubt that my additions make for some dirty work, but it does work lol.

Cheers for now,
Joe

Your 225-400AH for 24 hours implies a current draw of 9 - 16A continuous or 112 - 200 watts.

Ignoring the batteries required ( which will be large and expensive ) that's a helluva lot of power - what are you running? A pirate radio station?

Why not buy a little generator?

Allan

allanhurst:
Your 225-400AH for 24 hours implies a current draw of 9 - 16A continuous or 112 - 200 watts.

Ignoring the batteries required ( which will be large and expensive ) that's a helluva lot of power - what are you running? A pirate radio station?

Why not buy a little generator?

Allan

That's a value i added 25% to as a safety as lighting may change, and if i use less that is quite ok. With all equipment not transmitting its about a 5amp load, although i have NOT measured this just going from spec sheets. Battery sizing is adjustable simple enough.

Ham Radio, not pirate. attempted at doing the Ah calculations at 80%Rx and 20%Tx as a starting point

Rx being Recieve, and Tx being Transmit.

As for a generator, i am wanting to get into trying some contest stuff, and i was told that running battery would net a multiplier for points.

Hi,
Power all your equipment off the battery, and float charge the batteries.
Your radio equipment is able to take up to 15V as its designed for mobile use.

Have you consulted a Ham Radio forum or what ever your countries Amateur Radio Emergency Volunteer Group is to see how they do it?

Tom... :slight_smile:

TomGeorge:
Hi,
Power all your equipment off the battery, and float charge the batteries.
Your radio equipment is able to take up to 15V as its designed for mobile use.

Have you consulted a Ham Radio forum or what ever your countries Amateur Radio Emergency Volunteer Group is to see how they do it?

Tom... :slight_smile:

Its not what i am asking though...... none of that is. I'm not trying to mean or a jerk, simply sort answers.

I came to an Arduino forum for arduino advice where the users are knowledgeable on such topics. This isn't about how to power radios, i have the exact setup you pointed out on all my stationary equipment for power down situations.

I want to build a system that is portable and can simply have power plugged in and out, and the controller make sense of it while keeping the load powered.

I'm going to assume that its how i asked the questions, i'm guessing to much off topic information.

Sorry for the misunderstandings.
I'll let this thread sink, and start another at a later date when i have more technical questions.
Like if a Nano can program a ATTINY84A-PU.

Cheers,
Joe

crash5291:
I want to build a system that is portable and can simply have power plugged in and out, and the controller make sense of it while keeping the load powered.

I think that was answered pretty much in #3. I really don't see where an Arduino or other microcontroller comes in play here.

What are you really trying to achieve what existing systems can't do? Cheap solar solutions do exactly this: you plug in or out the solar panel, and everything continues to work. Solar power goes to your device, if anything left it goes in the battery, or if not enough the battery supplies the balance. Plug in another power source (generator, mains power, whatever) and it continues to do the same.

You may even be able to get away with removing the whole battery when sufficient external power is there, or adding/removing batteries.

crash5291:
Its not what i am asking though...... none of that is. I'm not trying to mean or a jerk, simply sort answers.

I came to an Arduino forum for arduino advice where the users are knowledgeable on such topics. This isn't about how to power radios, i have the exact setup you pointed out on all my stationary equipment for power down situations.

I want to build a system that is portable and can simply have power plugged in and out, and the controller make sense of it while keeping the load powered.

I'm going to assume that its how i asked the questions, i'm guessing to much off topic information.

Sorry for the misunderstandings.
I'll let this thread sink, and start another at a later date when i have more technical questions.
Like if a Nano can program a ATTINY84A-PU.

Cheers,
Joe

Really very simple to achieve, I have built a similar system for "House" vs Start batteries in my sons campervan. We used a different microprocessor to the Arduino but the same principle applies:
Test internal battery voltage
Test external Battery Voltage
Compare, if External is higher than internal switch to external source
If external is lower (or not present) run off internal
Report to LCD Display etc

Is your equipment susceptible to brown outs and/or spikes? if not a simple double pole double throw relay may be the answer (prevents both batteries connected at the same time).
I can probably help with battery runtime calcs if you need it? (The largest battery system I have sized and specified runs a 400VAC 3 Phase UPS for a local Telecommunications company for a total load of 4.5MW)