Notifications
Clear all

Powering Arduino through Vin and 5V pin.

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

@mrbond007 Changing a few things is largely dependent on your experience level. Based on your words it is highly possible you are very new. Messing with the power section is not a task to be attempted by a newbie unless you don't mind buying a few spare UNO's. If you build it exactly as shown with the one addition of a blocking diode on the 5V pin (the top positive line about the middle of the board. You want to block current flowing into the board and only allow the board to supply power in the outbound direction.

My hunch is the author has a 12V wall wart plugged into something that he wants to get notified if it loses power.

The purpose of the 9V battery is to power the UNO once the wall wart power goes away so the sketch can send an SMS message.

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: 6662
 

@mrbond007 No he is not. That would destroy the UNO, the powerjack 12V is across what is known by even very beginner electronics hobbyists as a voltage divider. The tap on the divider goes to pin 2 so the UNO can do a digital read and determine if power has failed. Can you read the sketch?

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: 6662
 

@mrbond007 NOPE, the input 12V is across a voltage divider with thr resistors sized to yield 5V at pin 2. Look at the sketch, it is obvious he is doing a digital read and when it goes LOW he sends an SMS. 

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
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  
Posted by: @zander

@mrbond007 I should have checked re your noobiness

I'm sorry I'm new to this Arduino and electronics.

Posted by: @zander

. Pin 2 is an input, it is used to determine if power is applied at the power jack (2.1mm). It is a signal line, not a power line.

The arduino is power using the barrel jack 2.1mm?

Posted by: @zander

Pin 2 is an input, it is used to determine if power is applied at the power jack (2.1mm). It is a signal line, not a power line.

This means the black wire from the DC output will go to pin 2?


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

My hunch is the author has a 12V wall wart plugged into something that he wants to get notified if it loses power.

Whta should I make out of it? 


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

The purpose of the 9V battery is to power the UNO once the wall wart power goes away so the sketch can send an SMS message.

Yes. 


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

Can you read the sketch?

The schematic diagram? 


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

@mrbond007 NOPE, the input 12V is across a voltage divider with thr resistors sized to yield 5V at pin 2

I didn't know that the control cable is connected at pin 2. This is what got me more Confused. 


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

@mrbond007 Black wire is not a valid descriptor. The schematic and sketch you referred us to earlier has what is needed. I will try to explain.

The entire device is designed to send an SMS when the mains power fails. A 12V wall wart is plugged into the device. I did a screen grab of the 12V power front end.

The current flows from +12V to ground. In order to get to ground it flows thru R3 then R1 then R2. The values of the resistors will cause pin Digital 2 to 'see' 5VDC (basically R3 + R1 consume 7V while R2 is 5V). As long as it stays at 5VDC then all is well, as soon as it goes to 0 a powerfail has happened. 

Got it?

 

 

Screen Shot 2022 09 29 at 11.38.03

 

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: 6662
 
Posted by: @mrbond007
Posted by: @zander

My hunch is the author has a 12V wall wart plugged into something that he wants to get notified if it loses power.

Whta should I make out of it? 

No idea what you mean.

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
(@mrbond007)
Member
Joined: 2 years ago
Posts: 34
Topic starter  

@zander You are basically saying everything is correct in the diagram if two things are corrected. One changing the 5V to Vin to accept the power from 9V battery. Second, if one more diode is added between the 9V battery and and Vin. Correct? 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6662
 
Posted by: @mrbond007
Posted by: @zander

Can you read the sketch?

The schematic diagram? 

OK, now we know you have no education/experience with the Arduino IDE. I will refrain from asking you to look at the sketch since you are not trained.

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: 6662
 
Posted by: @mrbond007
Posted by: @zander

Can you read the sketch?

The schematic diagram? 

NOPE, a sketch is a piece of arduino software.

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: 6662
 
Posted by: @mrbond007
Posted by: @zander

@mrbond007 NOPE, the input 12V is across a voltage divider with thr resistors sized to yield 5V at pin 2

I didn't know that the control cable is connected at pin 2. This is what got me more Confused. 

If by control cable you mean the 5V detection circuit then yes.

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: 6662
 
Posted by: @mrbond007

@zander You are basically saying everything is correct in the diagram if two things are corrected. One changing the 5V to Vin to accept the power from 9V battery. Second, if one more diode is added between the 9V battery and and Vin. Correct? 

NO NO NO, only one thing needs to be changed, a blocking diode on the 5V pin. You could try wiring it up as documented, but there is a chance you would smoke the UNO. 

EDIT: If that is the complete wiring diagram, then the wires attached to 5V need to move over onto VIN. No other diodes are needed.

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
Page 2 / 5