Notifications
Clear all

Unstable when using battery

17 Posts
4 Users
7 Likes
555 Views
(@mikel)
Member
Joined: 4 years ago
Posts: 3
Topic starter  

Hi, I'm not sure if this is the right section or not. Here is my problem. I am using an Arduino Nano. The sketch operates a Father Christmas who blinks and waves his arms. This is in the form of a light box and a backlight. It uses A sensor to operate when someone is near. When powered via the USB connected to the computer everything works well.

When I power it via a switch and 9v battery the sensor seems to switch off and then on very quickly and does not stay on for any length of time. The senso is an SR505 and the servos for the arms are SG90. Given that it works fine when powered vie the USB/Computer  I am assuming that it may be stability. I think I read somewhere that a capacitor can cure this issue but have no idea if that is right or how to place it in the circuit. Power from the battery goes to a POS BUS and a  GND BUS . The Servos, Sensor, and Nano draw the power from the POS BUS and all components are connected to the GND BUS. Please help this novice 79 year old electronics novice.


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

@mikel It works when powered by 5 volts but does not when powered by 9 volts? That seems backwards. I suspect the 9V is going through one of those breadboard power boards? Try a wall wart that puts out 5V and see what happens.

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
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Posted by: @mikel

Hi, I'm not sure if this is the right section or not. Here is my problem. I am using an Arduino Nano. The sketch operates a Father Christmas who blinks and waves his arms. This is in the form of a light box and a backlight. It uses A sensor to operate when someone is near. When powered via the USB connected to the computer everything works well.

When I power it via a switch and 9v battery the sensor seems to switch off and then on very quickly and does not stay on for any length of time. The senso is an SR505 and the servos for the arms are SG90. Given that it works fine when powered vie the USB/Computer  I am assuming that it may be stability. I think I read somewhere that a capacitor can cure this issue but have no idea if that is right or how to place it in the circuit. Power from the battery goes to a POS BUS and a  GND BUS . The Servos, Sensor, and Nano draw the power from the POS BUS and all components are connected to the GND BUS. Please help this novice 79 year old electronics novice.

Welcome to the forum. 

I would have thought a battery would be more stable than the USB link to the computer.  Batteries have more stable DC power than about any AC transformed source and typically PC/USB's are only rated to 0.5A.  But, a capacitor does help to supply extra short-term current when a circuit might spike.  Something like this should do it.

https://amz.run/7TlM

image

These have a + and - side like a battery and you place it in parallel to your battery inputs (not in series) as if it was a second battery.

I'm not one of the hardware guys here, but if/when @davee or @inst-tech chime in, they'll be able to explain it better.  Me... I just do what they say. 😊 

VBR,

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech and Ron reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Oh... I just re-clicked on your post (not had my morning coffee yet) Servos take a lot of current and aren't 9V tolerant.  A 9V battery may not be able to supply enough current, EVEN WITH THE CAPACITOR but I'm surprised you haven't burned out your PC's USB port trying to power a circuit with multiple servos.  I think you need to show us your whole wiring diagram.  

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


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

@mikel @inq Dennis is correct, although, as he says, it does seem strange to do that for a battery. The battery may be close to dead. Just place it across the power rails, capacitor + to the + rail, and capacitor - to the - rail.

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
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

I just looked it up!  The typical 9V "transistor" battery is a high voltage / low current source.  Various references show it can only supply < 400 mA when new.  RC airplanes can typically run with 4 x AA making 6V and is the preferred voltage for servos anyway.  The AA's can supply the current your circuit needs.  The capacitor won't cut it on the 9V battery.  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@mikel)
Member
Joined: 4 years ago
Posts: 3
Topic starter  

Thanks for all your responses.  I have swapped the battery for 4 AA giving 6v. No Change. I have inserted the capacitor as suggested. No Change. Not sure how to attach the circuit diagram as there is a not under this box saying "No More attachments are allowed today. I'm sure it must be something to do with how the battery is connected but I cannot see what. I have tried taking the power directly to the VIN on the NANO and then connected the 5v supply from the NANO to to the positive Bus. No Change. Thanks for trying. Any further suggestions will be gratefully received.


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

@mikel If you are powering the board from the VIN pin it requires 7 to 12 volts. Find a 12V wall wart and try that, as long as it has at least 1A output it should be ok, but even better if 2A.

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.


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

@mikel If you can't do something with VIN and USB is out (I often use a USB connector (unwired) that I wire up to a 5V wall wart) there are 2 other possibilities for genuine NANOs that I have NOT tested. You could use a 5V wall wart to power the 5V USB pin, but it may be possible and easier to use the wall wart on the ICSP pin 2. I have attached a pic of the ICSP header.

EDIT PLEASE let me know if any of that works so we know for next time.

Screenshot 2023 12 07 at 11.43.09

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

Hi @mikel,

  re: Not sure how to attach the circuit diagram as there is a not under this box saying "No More attachments are allowed today.

I am not sure of the exact rule, but the result of a few undesirable postings in the past, is that newcomers are limited in what they can post, until they have reached the threshold of a certain number of posts.

If you make a few more posts, describing your system and its problem, as best you can, the attachments should soon magically become possible.

I would normally try to comment on your problem, but on the limited information, I don't think I can add much to the present feedback. So please keep trying, with a few more posts.

Best wishes, Dave


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

@davee He is feeding a 7v-12v pin with 6V, that will not work. Before that it was a 9V battery, but the current was too low.

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

Hi Ron @zander,

  If "He is feeding a 7v-12v pin with 6V, that will not work.", then that is certainly not a wise move.

  Sorry, but I didn't have the time or patience to try to work out what was happening on the basis of the limited description. In reality, I would almost certainly guess something wrong.

I understand the issues and difficulties, but I think he just needs to send a few more clues, and at the same time pass Bill's, very understandable and reasonable, acceptance test for new contributors.

Best wishes, Dave 


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

@davee Maybe you missed a post? I know I have been having all kinds of issues with the forum recently. He has some NANO-based project that works fine on USB power, but when he switched to a 9V battery, it was erratic. Someone posted that the 9V battery was only capable of some number of amps, which was not enough for the servo. He then put together a 6V AA battery pack. At that point, I noticed that the VIN pin needs 7 to 12 volts, so the 6V would never work. This appears to be a simple case of not having enough power. 

I noticed that the ICSP header accepted 5V, and he has yet to report back if that worked. There is also the obvious possibility of applying 5V to the relevant USB connector, but that is tricky due to tight spaces and soldering skills.

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
(@mikel)
Member
Joined: 4 years ago
Posts: 3
Topic starter  

Hi Guys, Thanks for all your advice. I will attempt to use the suggestion of using the ICSP but as I am going away and I wanted to take this with me for the Great Grandchildren and the need (I don't think I said this before) for it to be portable I twigged that if I gave the servos there own power supply everything works. Not sure I understand why's and wherefores but I suppose this is all part of the learning curve. Thanks again and will get back to you when I try the ICSP suggestion.  


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

@mikel Sometimes we assume things like the servo motors have their own power supply.

You are missing one key point, these little MCU (micro controller units like a NANO or UNO) or MPU (micro processor units like a Strawberry Pi) are used to control very large (current in AMPS) using a pin that can carry a few thousandths of an AMP called milli-amps..

Your solution is YES a separate power supply for the servos MOTORS, then go back to your original 9V battery supplying VIN.

See Bill's video

and pay special attention at 43:05. ONE battery (lantern size?) to power the servo, and a UNO or NANO to power the servo control line. For remote usage, a 9V battery attached to VIN and G.

Good luck.

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 1 / 2