Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: BuddingContraptionist on November 14, 2008, 11:44:34 PM

Title: 2 voltages, 1 breadboard
Post by: BuddingContraptionist on November 14, 2008, 11:44:34 PM
I've succesfully spun my motor with a microcontroller manipulating an h-bridge circuit chip on a breadboard.  The problem is, I couldn't figure out how to use a second voltage for the motor.  It's rated at 9v, but i could only get it to spin if i connected the "motor power source" pin to my 5v supply.  Not good, i know.  I tried adding a 9v battery on the opposite rail of the breadboard, but i'm unsure how to ground it all out?  Do I connect the ground of the 9v rail to the ground of the 5v rail? ( i tried that with a 10 uF cap in between, no success )
Title: Re: 2 voltages, 1 breadboard
Post by: mbateman on November 15, 2008, 07:59:23 AM
You should have all grounds directly connected together. This is often called a "common ground" and is essential for avoiding many other issues.
Title: Re: 2 voltages, 1 breadboard
Post by: ArcMan on November 15, 2008, 08:39:17 AM
And you learned a basic lesson in electronics.  Generally, capacitors allow AC voltage to pass, but block DC voltages.  So connecting the 2 DC grounds together with a capacitor is like not connecting them at all.
Title: Re: 2 voltages, 1 breadboard
Post by: BuddingContraptionist on November 15, 2008, 01:49:39 PM
 ::) damn i could have sworn i tried a common ground multiple times with no success.  today i ground the 9v into the 5v's ground, plug a line from it to the chip instead of the 5v, and it works the motor perfectly.

thanks!
Title: Re: 2 voltages, 1 breadboard
Post by: Asellith on November 18, 2008, 08:01:34 AM
just to take this to the next level for you. Sometimes you want to isolate the grounds for noise issues. Specially when motors are involved. This can be done with what is called an opto-isolator. It is essentially a photo diode right next to an led inside an IC. This lets your microcontroller activate the diode without touching it electronically. The 5 volt side would fire the led and the 9v side would be on the diode side. This is really only needed when you are having issues with noise or are doing something crazy like building your own RF circuits. Some sensor problems can be fixed by checking for noise as well.