Showing posts with label relay. Show all posts
Showing posts with label relay. Show all posts

Monday, September 7, 2015

@Make: Electronics Experiment 32 Robot Cart - Together and Working, need to pretty it up

This took WAY too long, due to my fumbling.  Earlier posts and videos showed it working on a breadboard,  I needed to solder the components and circuit to a Perma-Proto Board, then connect the wires from the cart (motor + and -,  switches NO and GND).

Here's a top view of the working product:

Note the 4-pin connector I used to connect the 4 wires mentioned above through a hole in the Altoids tin to the circuit board.  That allows me to unplug the components on the cart to work on the circuit board if (WHEN) I need to, What look like stray wires are stubs for testing.  I'll reduce those during cleanup. The switched 9V battery holder is riding in the cover now.  I'll attach it to  the top of the tin with Velcro after I close it up.  I think I need a new Altoids tin--I kind of butchered this one making holes.

I added the rubber band around the driving wheel after the video for traction. It couldn't run on the hardwood floor without it.

Here's the video.

Stupid Soldering Tricks

There were reasons why it too so long.  I used 3 Perma-Protos. I would get it working, then something would go haywire.  I had a short someplace. I lost about a day fussing wit the power supply (see the right side of the photo above). I had been using 10uf and 1uf capacitors, but looked at the LM7805 datasheet and saw that the sample uses 33uf and ,1uf (same as in the book, p 182).  DUH. It said .33...so I chased that for a while, buit ibn the right components and still had a short.

I could not see anything wrong, so I decided to do a new board.  Worked OK for a while, but eventually wound up with another short.  I was ready to give up and just use a breadboard, but decided to try one more board.  After fussing with all kind of connections, I moved the 555 and reconnected everything pin by pin.  Of course, I started with pin 1 and the problem was on pin 8.  I had decided to use a 3-pin female header across pins 7-8 and the next row to connect the 33uf capacitor, so I could swap other values in and out to adjust the backup time (since I removed the pot).
I must have had a cross connection due to sloppy soldering under the header, because when I soldered in the cap direcly I had no  problem.

Now I was in business, but I had a couple of recurring problems.  I cleaned up some stray solder and it appeared to be OK.  It took a week, but I did it.

Finishing the Fabrication

I had everything working, connecting the cart to the circuit board with alligator leads.  I cut a 4-pin I2C cable in half to use as a connector to the cart, with the cut half to be soldered to the circuit board. I soldered the motor and switch wires to a strip of 4 extra long male header pins, and plugged that into the I2C connector. I tested the circuit after soldering each connection, and used head shrink to insulate the pins. The I soldered all the connections on the motor and switches.

What I need to do

  1. Screw the Perma-Proto to the standoffs and close the cover of the Altoids tin
  2. Velcro the 9V battery holder to the Altoids tin
  3. Use threadlocker on the wheels to keep them from wobbling
  4. Maybe screw the drive wheel to the motor (I would need to remove the motor to do that)
  5. Tidy up all the wires
  6. Put some WD-40 on the hinge so the tail moves more smoothly

 

Tuesday, August 18, 2015

@MAKE #Electronics Experiment 32: Robot Cart

I'm ready to start on this. First step was to gather the materials.  The parts list on page 268 is incomplete, although on p. 276 there's a "you will also need..." See the schematic on p.277 and this blog post by +James Floyd Kelly  (it's on experiment 31, but references shopping for 32). The 50K potentiometer shown in the schematic controls the time the motor runs in reverse before going forward again.
Make: Electronics by Charles Platt, Figure 5-98. p.277 (in the edition I have)

Also, the erratum on p. 277 mentions adding a diode or transistor. I'm going to try a diode (handsonelectronics says diode).

I found that my DPDT relays on hand are not appropriate. Some are latching relays bought for experiment 20, and the other was 12V, so I ordered two 5V DPDT non-latching relays from Amazon.

Charles spends a great deal of time on fabrication and not much on the circuit.  Since I care more about the circuit, and there are some issues with it, I'm going to build that first. I'm going to try to use plastic for fabrication. I have some 12"X12" pieces of ABS, and the shell of a multi-function printer that I tore-down.

Here's the concept:
When switched on, the cart moves forward until one of the microswitches hits something, it cuts power to 555 Trigger Pin 2, causing the the Output Pin 3 to pulse the relay, which then flops, reversing voltage to the motor, which reverses. The timer cycle (determined by 555 Threshold Pin 6 and Discharge Pin 7 as powered by the capacitor/resistor combination along with the Pot). When the cycle ends, the Output Pin 3 goes low and the relay flops back, causing the motor to reverse again (making it go forward).

The time it reverses starts at ~5 seconds (47uf cap*100000Ohm resistor = 47//1000000*100000 = 4.7). The Pot did not make much difference, if any. I thought it did, but it turned out that I had unhooked the 100K resistor. DUH.

I had other DUH moments in this, but I was helped immeasurably but people running into the same problems I did, particularly +James Floyd Kelly .  Thank you James. First, I bought a 5V gearmotor from robotshop .com. I fussed around for way too long trying to figure out how to wire it--then I noticed the two copper tabs on the neck.  Second, I was getting weird buzzing from the relay, and the motor was not reversing. I remember the symptoms from James' blog. My relay had different pinouts from the schematic. There are 8 pins. If you number them 1-8 starting with 1 at upper left and go counter clock-wise, I needed to switch pins 2 and 3 on one side and 7 and 6 on the other.  I could not find a datasheet for this relay, but I had a similar issue once before with another DPDT relay, so I guessed.

Third problem was the diode,  The motor would not reverse, but fortunately I had seen this before (thanks James), so I added the diode across pins 1 and 8 of the relay with the cathode towards pin 8.

I also struggled with wiring the switches.  I tested it with just the switches, power supply, and a meter, and came up with:
555 Trigger Pin 2  to switch1 NO prong, connected to switch 2 NO
Both NC Prongs connected to GND
Both COM prongs (on the side--at least on mine) connected to GND

If neither switch is pressed, current is flowing to the trigger pin through the 10K pull-up resistor making it high and thus the output pin is low. When either switch is pressed, the trigger pin goes low, making the output pin high, and flopping the relay and reversing then motor.  The output pin stays high until the 47uf capacitor dishcarges (4.7sec) to the threshold pin, making it high and setting the output pin back to low, flopping the relay back and the moving the motor in the original direction.

It works.  Here's the video.