I've been wanting to build a robot that drove around and if it came to an object, it would sense it with a ping sensor and stop and turn the other way. I was in a hurry to build a circuit that would make a motor spin both ways, so it took a few hours to get it to work. I never looked to a schematic of an H-bridge. The hardest part was getting the transistors that controlled the two sets of transistors to work. The transistors do get hot, but I've never had one burn up.
Here is the schematic and the circuit on a breadboard on my robot.
On my YouTube channel I was asked to send the code to this 3 pin LCD project to a fellow YouTuber. I tried to put the code in the comments, but it did not work so I started this blog to post codes and schematics.
On this project I used 2 normally open switches, 3 resisters (2 for pull downs for the buttons and one for the LED), 1 3 pin 2x16 Parallax LCD, and 1 Arduino UNO. The LED is connected to pin 11. The button for turning the LED on or off is connected to pin 9. TxPin is connected to pin 6, that is what controls the LCD. The button for the LCD back light is connected to pin 4. The only trouble I had with this is I couldn't figure out how to not delay the code for 2 seconds for turning the LCD on then off automatically. So if anyone has figured that out, that would be cool and remember to share the code.
// made by birdshotbrad@youtube.com
//for the 3 pin Parallax LCD ONLY
int led = 11;
int button = 9; //button to turn on or off LED
int val = 0;
int oldval = 0;
int state = 0;
int TxPin = 6; //lcd pin
int button2 = 4; //lcd backlight
int val2 = 0;
int oldval2 = 0;
#include <SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(255, TxPin);