Controlling Voltage and Current

Discussion in 'Homework Help' started by CivicCritical, Oct 12, 2018.

  1. CivicCritical

    Thread Starter New Member

    Oct 12, 2018
    5
    0
    For school, I need to design a circuit that can provide power at appropriate current and voltage to charging devices (and also incorporate an LCD and Arduino board). I am studying mechanical engineering but hey, first year and I am absolutely terrible with electrical.

    I have a DC power supply of 12W: 5V & 2.4A. I need to drop the voltage by approximately 0.65V to 4.35V to charge a 4.2V device. I was planning use a resistor and then a switch that would add another resistor when desired to achieve a further drop to 3.7V. I am unclear on how to control voltage and current at the same time.

    I was thinking for the first voltage drop that a resistor of 0.27Ω would cause a drop of 0.65V. Vdrop = 2.4A * R = 0.65V so R = 0.65V/2.4A.
    I'm not really sure where to go from here or if this is wildly wrong. Any help would be appreciated.

    Thanks,
    James
     
  2. ebp

    Well-Known Member

    Feb 8, 2018
    2,332
    812
    4.2 V sounds very like a single lithium ion cell. It is absolutely imperative that lithium cells not be overcharged by more than a very small amount or there is a risk of them exploding or catching fire. If they are overcharged to a less degree, the life, in terms of number of charge-discharge cycles, can be dramatically reduced.

    A resistor won't do for this sort of application because, as you calculate, the voltage drop is dependent on current, but not the current that the supply can deliver, rather the current that the load requires. If you are charging a battery, the current will drop as the battery approaches full charge, meaning the voltage at the battery will go up. The 2.4 A rating of the supply is probably the specified maximum load, but the supply might be able to deliver much higher current at rated voltage or with the voltage dropping somewhat if you overload it. Most power supplies do not have accurate current limiting.

    You need to tell us a bit more about what you are trying to do.
     
  3. CivicCritical

    Thread Starter New Member

    Oct 12, 2018
    5
    0
    The assignment is to create a circuit powered by a DC supply that is capable of charging 2 different handheld radios of our choosing. The DC supply must be portable, so i chose a 5V/2.4A power bank. Our materials provided were a breadboard, arduino, LCD to display voltage and charge %, resistors, wires and potentiometers. I don't see how I can achieve an acceptable current and voltage for one radio, let alone 2. I also don't see why 1000 Ohm potentiometers would be used as it would be much harder to control resistance.

    I have attached a Fritzing diagram of my circuit. The LED goes green when charge is over 75% and red under. The LCD displays charge% and voltage.

    I was introduced to Arduino a few days ago and I am sure there's a lot wrong. This is the Arduino code so far:

    Code (C):
    1. /*
    2. * the program detects the voltage across a resistor and displays the result both on the Serial monitor and a LCD
    3. */
    4.  
    5. // include LCD library and I2C library
    6. #include <Wire.h>
    7. #include <LiquidCrystal_I2C.h>
    8.  
    9. // Set the LCD address to 0x20 for a 16 chars and 2 line display
    10. LiquidCrystal_I2C lcd(0x20  , 16, 2);
    11.  
    12. void setup() {
    13. lcd.begin();
    14. lcd.backlight(); // lcd.noBacklight() will turn off the light, lcd.backlight() turn it on
    15.  
    16. lcd.setCursor(5,0); // set cursor to the 5th char of the 1st line (row number starting at 0)
    17. lcd.print("James");
    18. lcd.setCursor(3,1); // set cursor to the 3rd char of the 2nd line (row number starting at 1)
    19. lcd.print("s4582287");
    20. delay(2000);
    21.  
    22. pinMode(5,OUTPUT);
    23. pinMode(6,OUTPUT);
    24.  
    25.  
    26. Serial.begin(9600); // Initialize the serial monitor at a speed of 9600 baud
    27. }
    28.  
    29. void loop() {
    30.   int sensorValue = analogRead(A0); // read the input on analog pin 0
    31.   float voltage = sensorValue * (5.0 / 1023.0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V)
    32.   float percentage = 1-voltage/5;
    33.   Serial.print(voltage); // print out the value you read
    34.   Serial.print("\t"); // print out the value you read
    35.   Serial.println(percentage); // print out the value you read
    36.  
    37.   // display messages on LCD
    38.   lcd.clear();
    39.   lcd.setCursor(0,0);
    40.   lcd.print("voltage:");
    41.   lcd.setCursor(8,0);
    42.   lcd.print(voltage);
    43.   lcd.setCursor(0,1);
    44.   lcd.print(100*percentage);
    45.   lcd.setCursor(5,1);
    46.   lcd.print("% full");
    47.  
    48.   if (percentage<0.75) // if low battery, turn the red LED on
    49.   {
    50.     digitalWrite(6,HIGH);
    51.     digitalWrite(5,LOW);
    52.     delay(1000);
    53.   }
    54.   else // if normal, turn the green LED on
    55.   {
    56.     digitalWrite(5,HIGH);
    57.     digitalWrite(6,LOW);
    58.     delay(1000);
    59.   }
    60.   // add other useful features here
    61. }
    Moderator edit: added code tags.
     
    Last edited: Oct 12, 2018
  4. BR-549

    AAC Fanatic!

    Sep 22, 2013
    4,936
    1,348
    Do the "2 different handheld radios of our choosing" use the exact same battery?
     
  5. CivicCritical

    Thread Starter New Member

    Oct 12, 2018
    5
    0
    I wish, they want us to use different batteries.
     
  6. BR-549

    AAC Fanatic!

    Sep 22, 2013
    4,936
    1,348
    Maybe I am not on your page yet.........what types of batteries? what are the voltages?.......and who asked you to do this?

    I don't think I understand clearly what are your parameters?
     
  7. CivicCritical

    Thread Starter New Member

    Oct 12, 2018
    5
    0
    We must choose 2 radios using 2 different voltage batteries. I know lithium ion are more complex in their charging but it seems like most handheld radios are lithium ion. I was planning on using a 3.7V and 4.2V but they can be any voltage handheld radio. This is an assignment for first year engineering design. It definitely feels overwhelming (I am yet to do the engineering fundamentals course that introduces electrical).
    For the assignment, we must create a circuit capable of charging 2 different handheld radios of different voltages (our choice) using a portable power supply of our choice. We must use an arduino board and breadboard with an LCD display to show voltage and %charge on battery. It only needs to charge 1 battery at a time.

    PS. I'm probably more lost than you.
     
  8. BR-549

    AAC Fanatic!

    Sep 22, 2013
    4,936
    1,348
    OK...I'm still in the dark. I'm not a power fella anyway. There are experts on here that can help. I have never heard of a "universal charger". But it's hard to keep up with it all. For all I know, they might have software that can sense and detect battery now.

    I'll standby and let your thread cook a while.
     
  9. CivicCritical

    Thread Starter New Member

    Oct 12, 2018
    5
    0
    Great, thanks for your help :)
     
  10. MrChips

    Moderator

    Oct 2, 2009
    19,114
    6,145
    You cannot set the voltage and the current at the same time. To do so would violate the fundamental law of electricity, Ohm's Law.
    For a given voltage, the current will be I = V/R.
    If you set the current, the voltage will be V = I x R.
    The voltage and current are interrelated by the load or resistance of the battery being charged.
     
  11. Bordodynov

    Well-Known Member

    May 20, 2015
    2,344
    727
    The easiest way is to make a voltage regulator 4.2V and limit the current by the resistor. Suppose you want the maximum charge current not to exceed 500mA, then the value of the resistor Rb = (4.2V-2.7V) /0.5A=3Ohm. Such a charger will charge the battery for a long time, but there is no need to control the charging process. In addition, to prolong battery life, it is not recommended to charge it 100%.
    But if you need a fast charge, then you can make a current generator on the operational amplifier and a P-channel transistor, and also supply it with a voltage of 4.2V.
     
Loading...