Notifications
Clear all

Powering Arduino through Vin and 5V pin.

68 Posts
3 Users
34 Likes
4,263 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7021
 

@mrbond007 Whatever

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
mrbond007 reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7021
 

To learn about hardware, for Arduino's go to website arduino.cc. Select Hardware, then classic family boards then UNO. Look at or download the pinout and notice in the lower left corner that Power Pins are RED. There are 3 red pins, VIN 5V and 3V3. Notice the arrows on the diagram, the VIN pin is the ONLY pin providing power to the board, 5V and 3V3 are OUTPUT only. Spend a few weeks just studying the UNO. There is even a board wiring diagram. Then do the same only it won't take as long for all the NANO boards, MEGA, RP2040, 33IOT etc etc. Now you can start with software. Almost everyone does not study the documentation on libraries and they then come to the forum after they have totally messed up their environment. Often they will say something like I found it on the net, or another forum or his barber. Check your sources. I deleted all my software many years ago so I can not backup my credentials so you should find folks that have work product to show you and have the info you need.

Then for RaspBerryPi do the same, then for ESP8266 and ESP32 more again.

I could probably go on for hours, but let's call that a start.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
mrbond007 reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1697
 

Hi @mrbond007,

re books etc.  I offer an honourable suggestion to check out ---- though sadly not a cheap one :

The "classic" electronics book, whose 1st edition was in 1980, The Art of Electronics by Horowitz and Hill.

I bought a copy back in early 1980s and replaced it with Edition 2 in 1990s. This is the book all the graduate engineers I came across had in the 1990s. It starts at the first principles of basic electronic components and works up. Obviously, as 1 thick volume, it couldn't cover every aspect, but it makes a good try at giving a  without heavy theory, etc. Note, Edition 2 was too early for microcontrollers (Arduino etc) in the ubiquitous fashion they are now.

I notice it is now up to Edition 3 - and even that dates to 2015 ... which I haven't seen.... so there is a risk they have 'broken it'.

But hopefully, the updating reflects many of the changes in the last 20 or so years.

However, I would not expect to have too much detailed information on the computing side as it is aiming at the electronics basics ... look elsewhere for Arduino how-tos etc.

www.amazon.co.uk/Art-Electronics-Paul-Horowitz/dp/0521809266/ref

As I said, I haven't checked out the current edition ... so this is a semi-blind suggestion, not a recommendation .. but if I was looking to extend my bookshelf, this would be a very strong candidate to consider.

Best wishes, Dave

ps I just noted there is an X Chapters version in the same series dated 2020 ... this is supplementary book ... not a replacement for the 'original'. Also note there is a Lab manual in the same series. Be careful to start with the 'main' book I described above.


   
mrbond007 reacted
ReplyQuote
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  
Posted by: @davee

Hi @mrbond007,

re books etc.  I offer an honourable suggestion to check out ---- though sadly not a cheap one :

The "classic" electronics book, whose 1st edition was in 1980, The Art of Electronics by Horowitz and Hill.

I bought a copy back in early 1980s and replaced it with Edition 2 in 1990s. This is the book all the graduate engineers I came across had in the 1990s. It starts at the first principles of basic electronic components and works up. Obviously, as 1 thick volume, it couldn't cover every aspect, but it makes a good try at giving a  without heavy theory, etc. Note, Edition 2 was too early for microcontrollers (Arduino etc) in the ubiquitous fashion they are now.

I notice it is now up to Edition 3 - and even that dates to 2015 ... which I haven't seen.... so there is a risk they have 'broken it'.

But hopefully, the updating reflects many of the changes in the last 20 or so years.

However, I would not expect to have too much detailed information on the computing side as it is aiming at the electronics basics ... look elsewhere for Arduino how-tos etc.

www.amazon.co.uk/Art-Electronics-Paul-Horowitz/dp/0521809266/ref

As I said, I haven't checked out the current edition ... so this is a semi-blind suggestion, not a recommendation .. but if I was looking to extend my bookshelf, this would be a very strong candidate to consider.

Best wishes, Dave

ps I just noted there is an X Chapters version in the same series dated 2020 ... this is supplementary book ... not a replacement for the 'original'. Also note there is a Lab manual in the same series. Be careful to start with the 'main' book I described above.

Thank you @davee for the suggestion. I will the mentioned book and start with it. 


   
ReplyQuote
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  
Posted by: @zander

To learn about hardware, for Arduino's go to website arduino.cc. Select Hardware, then classic family boards then UNO. Look at or download the pinout and notice in the lower left corner that Power Pins are RED. There are 3 red pins, VIN 5V and 3V3. Notice the arrows on the diagram, the VIN pin is the ONLY pin providing power to the board, 5V and 3V3 are OUTPUT only. Spend a few weeks just studying the UNO. There is even a board wiring diagram. Then do the same only it won't take as long for all the NANO boards, MEGA, RP2040, 33IOT etc etc. Now you can start with software. Almost everyone does not study the documentation on libraries and they then come to the forum after they have totally messed up their environment. Often they will say something like I found it on the net, or another forum or his barber. Check your sources. I deleted all my software many years ago so I can not backup my credentials so you should find folks that have work product to show you and have the info you need.

Then for RaspBerryPi do the same, then for ESP8266 and ESP32 more again.

I could probably go on for hours, but let's call that a start.

Thank you @zander for suggestion will go through the provided resources. 


   
ReplyQuote
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  

Hello @zander @davee, I have made changes to the schematic diagram and changed the input of Arduino from 5V to Vin. Please check. I have powered the GSM900A module using a wall wart connected to a UPS instead of a 9V battery. The 9V battery will now only power the Arduino in case of power failure.

Screenshot (1862)

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7021
 

@mrbond007 I have a couple questions. What is being plugged into the jack J2? I don't think the shield will work as I don't see any power for it.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1697
 

Hi @mrbond007,

   Your revised schematic is certainly closer to a realistic circuit.

  Nitpicking your drawing, I notice the connection line to GSM pin "DSM RX D2" also appears to touch the two pins above labelled "N/C D0" and "N/C D1". The latter two pins must of course remain unconnected.

I was also surprised by the diode type for D1 and D2 as "P1000K". A quick look up suggested these are rated at 10A. If you happen to have some, they might well work, but if you are still procuring parts, a smaller rated (say about 1A) device like IN400x, where x could any number from 1 to 7, e.g. IN4001 should do just as well.

You say you are going to power the GSM module from a wall wart, which itself is supplied by the UPS.

This could work, but does have downsides.

  • As I pointed out before, the GSM module appears to specify a supply in the range 3.3-4.5V. I am guessing you are thinking of a 5V Wall wart ... these can be a bit 'variable' in how closely they regulate to 5V .. I would not be surprised if an individual device produced a voltage of a little more than 5V, especially as the current demand will be small when it is not actually transmitting phone data. Normally, the load circuit of such a 'wart' would be specified to accept up to (say) 5.3V or 5.5V without damage to allow for such 'real world' tolerances ... but the GSM module is specified up to 4.5V .. so you could be 'pushing your luck' and premature failure may result ... not necessarily immediately, but in time.
  •  
  • The other downside is more subtle ... and may possibly sound unbelievable. Imagine the 9V battery is flat or disconnected when the power fail occurs. The GSM module will still be powered via the UPS and wall wart, but the Arduino will not. Now, protection diodes built into every chip to protect against damage by static electricity, could start a current flow from the GSM chip, to the Arduino, via the data line connections, such as those to pins D7 and D8 of the Arduino.
    • Because this current flow is through devices within the chips that do not normally carry a current, the consequences are difficult to predict ... likely possibilities include
      • "Not a problem" .. normal operation will continue when power is restored
      • one or both chips go into a 'hang up' state until all sources of power is removed
      • one or both chips are permanently damaged

So there are downsides to this ... and I am struggling to find a good upside. Personally, I think it would be better to source the GSM power from the same battery as the Arduino. Of course there should be an additional voltage regulator to reduce the voltage to about 4.5V to supply the GSM module.

Best wishes,Dave


   
mrbond007 reacted
ReplyQuote
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  
Posted by: @zander

@mrbond007 I have a couple questions. What is being plugged into the jack J2? I don't think the shield will work as I don't see any power for it.

Which J2 Jack are you talking about? I mean the left or the right one. I will be powering the GSM module using a separate wall wart.


   
ReplyQuote
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  
Posted by: @davee

Your revised schematic is certainly closer to a realistic circuit.

All praises to you guys. It is because of you that this project is coming to life.

Posted by: @davee

  Nitpicking your drawing, I notice the connection line to GSM pin "DSM RX D2" also appears to touch the two pins above labelled "N/C D0" and "N/C D1". The latter two pins must of course remain unconnected.

I'm sorry for this issue. This happened because I didn't pay proper attention while wiring the D2 and D3 pin in Fritzing. I will remove it. There is a rule I read while I was testing the GSM module. The Rx pin must be connected to Tx, and the Tx pin must be connected to Rx. Be it from Arduino to the GSM module or vice versa. Or we can customize the pins of Arduino (this method is used in our project) by command:

SoftwareSerial SIM900(7, 8); 

 Pin 7 becomes Rx, and Pin 8 becomes Tx.

Posted by: @davee

I was also surprised by the diode type for D1 and D2 as "P1000K". A quick look up suggested these are rated at 10A. If you happen to have some, they might well work, but if you are still procuring parts, a smaller rated (say about 1A) device like IN400x, where x could any number from 1 to 7, e.g. IN4001 should do just as well.

Thank you for pointing it out. I was not able to find the "IN4001" in Fritzing that's why I used a regular diode. I will use the mentioned diode when building the project.

Posted by: @davee

As I pointed out before, the GSM module appears to specify a supply in the range 3.3-4.5V.

I was under the wrong impression of using a 12V wall wart. It was mentioned on the sellers' website that the max power supply or 12V, and the current is 1A to 2A. My reason for using an external wall wart instead of the 9V battery through Arduino is that the GSM module may take up 2A of current in a burst where it sends SMS, which I think the 9V battery will not be able to provide. The link says 2A will be required in a burst while sending SMS.

https://components101.com/wireless/sim900a-gsm-module

Posted by: @davee

would not be surprised if an individual device produced a voltage of a little more than 5V,

Yes, I tested this myself yesterday. The 12V wall wart was giving around 12.3 ~ 12.4 V.

Posted by: @davee

The other downside is more subtle ... and may possibly sound unbelievable. Imagine the 9V battery is flat or disconnected when the power fail occurs.

Thank you for pointing this out. I was not aware of this. I thought the battery would take the Arduino for at least a week, but I was wrong. The battery could dry out early.

 

Posted by: @davee

The GSM module will still be powered via the UPS and wall wart, but the Arduino will not. Now, protection diodes built into every chip to protect against damage by static electricity, could start a current flow from the GSM chip, to the Arduino, via the data line connections, such as those to pins D7 and D8 of the Arduino.

  • Because this current flow is through devices within the chips that do not normally carry a current, the consequences are difficult to predict ... likely possibilities include
    • "Not a problem" .. normal operation will continue when power is restored
    • one or both chips go into a 'hang up' state until all sources of power is removed

This is interesting. Never in my wildest dream could I have thought this. What are your suggestions and modifications to avoid this problem? Can I use a rechargeable battery with a battery charging module?

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7021
 

@mrbond007 There is only ONE  J2.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  
Posted by: @zander

@mrbond007 There is only ONE  J2.

J2 will be used to power GSM module as my module had a barrel jack to take input. 


   
ReplyQuote
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  
Posted by: @zander

@mrbond007 There is only ONE  J2

The power from J2 should go to barrel jack instead of Vin of GSM module. This error happened because I was in hurry to post this schematic. 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7021
 

@mrbond007 Ok, I don't get it but you seem sure.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7021
 

@mrbond007 Are you having PCB's made? How many are in your project and is it for school or work?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 4 / 5