Using two power supplies with one on / off switch

Hi;

I have built a robot using the parts listed at the end of this post.

I have been having trouble with the code and getting the motors and the servos to work with the detector but I now believe that this is due to a lack of power.

I am only using 1 x 9v Non rechargeable battery. I can add another 9v battery or use 4 x AA 1.5v batteries.

The problem I have is how do I only use 1 x on off switch? Could I connect this to a common Gnd? 

Currently the 9v battery is supplies 9v to the L298N which powers the motors and also supplies 5v regulated to the Nano 

 

ATMega328 (CH340G) Clone bought here 

To an L298N Motor Driver here 

To control the DC Motors on this chassis

HCSR04 Ultrasonic Detector

9g Micro Servo

Iv'e found various builds but most use servos, like this one?

You want a DPST switch.

A DPST switch will do it.

But…

You may want to look at using Rechargable AA sized batteries or some other battery pack.

Look for batteries similar to: http://tinyurl.com/q6xu48c

 

 

Thanks for the info, having

Thanks for the info, having trouble finding DPST switches of a similiar size to the ones we have already bought though :frowning:

 

About batteries

Rechargeable NiMh AA can be re used. You can just buy them and resell once the club it’s finished, ask parents if they already have spare batteries. Or you can convince them that it’s a one for ever purchase, AA batteries are a common household item, and may also help to save money over alcalines.

And even AA alcalines go flat faster than NiMh, they just have more capacity, which it’s about 1800-2600mAh against the 500mAh of a 9v battery. By buying NiMh you can have more robot runs, you should go even and start saving money after the tenth recharge.