Is it possible to use an arduino nano, to check the voltage of a 18650? The nano will be powered from a different 6v source, and the 18650 will be used with a relay to power a vape tank, which is run off another device. Ultimately id like to use a nano gpio to power the relay for the 18650 but according to the data sheet for the relay it draws approx 150ma which is slightly higher than the nano can put out. So im thinking i could use the relay trigger as an input into the nano and effectively cut off the relay trigger if the battery current gets too low. Ive seen plenty of posts of a similar nature except they are powering off the 18650 and my use its stand alone. Am i making sense, is this possible.? Are there any examples of this?
Please make this into schematics and post it.
Datasheet of the relay stuff would help us.
Just referring to the relay portion: Look for a relay with a JD-VCC jumper. This jumper, when removed, passes external power (rather than Arduino power) to drive the relay coil and at the same time, lets the Arduino signal/switch an opto-coupler to use external power to energize the relay. Notice in the drawing, the diode on the signal line (IN1) wants a LOW to enable the relay.
If you are going to power the relay from the Nano's 5V I highly recommend you use a solid state relay. With that load you will be pushing the capabilities of the Nano's regulator. Powering the relay from an external source would be fine.
Putting 6V on the 5V pin probably will damage the Nano. Putting 6V on Vin will probably be flakey as it needs about 7V to work properly. Sorry for the not so good news.
6V is not high enough to power the Nano through the VIN pin, you need at least 7 but not over 9V.
Thanks for all the replies, I’ve actually got a few options to power the nano. I can get 5v from a buck thats there as well, my main question is the battery monitor part, i cant find any examples or documents explaining it as just checking the voltage.
Look for any example of voltmeter with Nano/UNO to take as a base.
A 18650 can be measured directly from an analog pin because it does not exceed 5V.
What are you using for a 6V power supply?
Which Nano pin are you putting the 6V into?
This is what i was trying to search but came up empty, but using voltmeter instead of monitor came up with what i needed. Thanks.
This has been solved. Wrote some code to check the battery, use the relay trigger pin as an input and d8 as an output to go to the relay, with the condition if voltage drops below 2.5 the stop outputting. I can post the code if anyone is interested.
Post it.
const int analogPin = A0; // Analog pin connected to the battery
const int inputPin = 8; // Digital input pin
const int outputPin = 2; // Digital output pin
const float voltageThreshold = 2.8; // Voltage threshold to stop the output
void setup() {
pinMode(outputPin, INPUT);
Serial.begin(9600); // Initialize serial communication
pinMode(inputPin, INPUT_PULLUP); // Set input pin as INPUT
pinMode(outputPin, OUTPUT);// Set output pin as OUTPUT
digitalWrite(outputPin, LOW);
}
void loop() {
// Read the raw analog value
int rawValue = analogRead(analogPin);
// Convert the raw value to voltage (assuming a 5V Arduino)
float voltage = (rawValue / 1023.0) * 5.0;
// Print the battery voltage to the serial monitor
Serial.print("Battery Voltage: ");
Serial.print(voltage);
Serial.println(" V");
// Check if the voltage is below the threshold
if (voltage < voltageThreshold) {
Serial.println("Battery voltage is below 2.8V. Please charge the battery.");
digitalWrite(outputPin, LOW); // Turn off the output pin
} else {
// Read the input pin state
int inputState = digitalRead(inputPin);
// Set the output pin based on the input state
digitalWrite(outputPin, inputState);
}
delay(1000); // Delay for a second before taking another reading
}
You named a pin outputPin then set it to INPUT?
Well..., what battery type?
It wasnt like that originally. I read on this forum someone had used it to stop the relay going high during startup. When i power it up the relay turns on for a sec or two. But I’ve discovered that line does not work. Im using just a single cell 18650.
One more chance to tell me what battery type, what power supply for the Nano and which pin you are putting the supply voltage into, else, I'm gone.
Its hohm life 4 lion 18650, the nano is powered from a buck with 7v into the vin pin. Im not sure what your issue is mate cause its been solved and marked as such. But honestly thanks for helping.
Never let a lipo fall below 3.5V, and you will never get an accurate reading with that method, but good luck.
its not a lipo its a li-ion, and the datasheet for the battery says 2.2 is the minimum discharge, which is why a left it at 2.8
Whatever, good luck
