Archive for Main Blog

DIY Optical Encoder

An optical encoder has some advantages over a mechanical encoder. One advantage is no bouncy or noisy electrical contacts that create false or extra pulses. Also, an optical encoder can operate at a higher rotation rate than a mechanical encoder.

I created a simple optical encoder from commonly available materials.

ENCODER HOUSING: I made the encoder housing from a 3/4 inch PVC pipe cap with a short length of 3/4 inch PVC pipe glued inside. The axle that supports the encoder disk was made from an inexpensive motor that I removed the magnets and the motor brushes from in order to allow the motor armature to spin freely.

The motor is then installed inside the PVC pipe. Since the fit was a little loose, I wrapped a couple of turns of tape around the body of the motor to make a tight fit. I also had to drill a small hole in the bottom end of the pipe cap to provide clearance for the rear motor bearing.

I sanded a flat spot on the outside of the pipe cap and drilled a small hole to accept a 4-40 flat head screw pointing out from the inside of the cap. This provides a threaded stud where the support for the encoder PCB is attached. The hole must be carefully located so that the opening in the photo-interrupters are at the correct level in relation to the encoder disk.

Finally I installed, with a press fit, a 1.5 inch diameter by 0.375 inch thick nylon disk to the motor shaft to which the encoder disk will be attached.

ENCODER CIRCUIT BOARD: I was able to fit the electronic components on a section of fiberglass circuit board that measured 1.375 inches by 1.625 inches. The photo-interrupters were located side by side and near the top edge of the PCB. The PCB also had a small hole drilled in it to allow mounting to the encoder support.

I installed two 0.1 inch spaced two position terminal blocks to facilitate the wire connections.

The encoder circuit uses two off-board 74HC14 Schmitt trigger inverters to clean up the pulses from the photo-interrupters and to drive two hi-efficiency blue indicator LEDs, one from each channel. This is not necessary for all applications.

The support for the encoder PCB was made from an approximately 1.25 inch long section of 0.375 diameter round nylon rod which was drilled and tapped at each end with a 4-40 thread.

ENCODER DISK: I designed the encoder disk by making a pattern using the spread sheet program Excel and then creating a pie chart with alternating black and white segments. The encoder pattern can be made with a variety of different diameters and with a different number of segments. It is important that the total number of segments used divide evenly into 360.

The artwork was printed out and then glued to a piece of thin cardboard with rubber cement. I used a compass to define the diameter of the disk and then cut it out with scissors. The notches at the edge of the disk were made with a 0.281 inch punch with the center of the hole located at the junction of the black and white segments.

This provides a total of 18 evenly spaced openings. The notches could also be cut out with a sharp x-acto knife instead of using a punch and cutting out the edge of either the white or black segment – but not both!

The finished disk was then glued to the nylon disk attached to the motor shaft.

The disk shown in the photos below had a diameter of 3.375 inches with a total of 36 segments – 18 black and 18 white.

More information on the encoder disk here: http://saroselectronics.com/create-encoder-pattern-using-excel/

 

PVC CAP WITH MOTOR AND MOUNTING STUD INSTALLED

 

ENCODER CIRCUIT BOARD

 

COMPLETED OPTICAL ENCODER WITHOUT DISK

 

COMPLETED OPTICAL ENCODER WITH DISK

 

ENCODER SCHEMATIC

 

CLOCKWISE PULSE OUTPUT FROM ENCODERS

 

COUNTER-CLOCKWISE PULSE OUTPUT FROM ENCODERS

 

End Post

Adjustable DC Power Supply

This is a variable voltage analog power supply based on the LM317 adjustable voltage regulator. The LM317 includes on-chip current limiting, thermal overload protection, and safe operating area protection. All overload protection remains fully functional, even if the ADJUST terminal is disconnected.

The LM317 can output up to 2.2 amps, provided the difference between the input and output voltage is less than or equal to 15 VDC. The output current drops dramatically to 0.4 amps if the input-output difference is equal to 40 VDC. These values give an indication of the “safe operating area” protection.

The voltage is adjustable from 1.2 VDC to 30 VDC via a “VOLTS ADJ” potentiometer. There is also a “MAX ADJ” trim potentiometer that can be used to limit the maximum output voltage. The input is protected by a 1.8 Amp auto-reset fuse. Input voltage can be either 6-24 VAC or 8-35 VDC.

AC inputs are rectified by four 1N5402 (3 amp) diodes in a full bridge configuration and filtered by two 2200uF electrolytic capacitors. The main output regulator (TO-3 package) is fan cooled allowing continuous operation at high current levels and high ambient conditions. The regulator has built-in thermal protection and current limiting. The maximum output voltage is 30 VDC (with an input of 24 VAC or 35 VDC).

The two 6 inch diameter component mounting disks are made of 1/8 inch Delrin and the four 5/8 inch diameter support spacers are also made of Delrin.

The power transformer is a Triad F8-24 with a output of 24VAC at 4 Amps. A 1 amp fuse is installed on the transformer primary.

 

VERIFYING COMPONENT PLACEMENT

 

TOP AND BOTTOM COMPONENT TEMPLATES

 

TRANSFORMER AND TERMINAL BLOCK WIRING

 

COMPLETED POWER SUPPLY

 

1 AMP POWER SUPPLY PCB ARTWORK

 

 

END POST

Roper Whitney Hand Punch

The Roper Whitney Model 5 JR hand punch is a very useful tool for anyone who builds electronic prototypes or works with thin plastic or metal. I have found that it also works well on fiberglass circuit boards.

The standard punch set comes with seven different punches sized from 3/32 to 9/32 in 1/32 inch increments.

There are a total of 16 punches optionally available sized from 1/16 to 9/32 in 1/64 inch increments – this includes the standard series of 3/32 to 9/32. All produce round holes only.

The punch has a one ton capacity. The variables that govern this capacity involve hole size, type of material, and material thickness. For an example, I can easily punch 3/16 inch holes in 1/8 inch plastic, a 3/16 inch hole in 1/8 inch aluminum is a bit more difficult, and most likely would be impossible in 1/8 inch stainless steel.

One excellent feature of all these punches is the center point machined into the exact center of the punch. This allows you to accurately locate the punch in a center punch mark on the material.

Website: Roper Whitney

 

ROPER WHITNEY NUMBER 5 JR HAND PUNCH

 

ROPER WHITENY NUMBER 5 JR HAND PUNCH

 

 

End Post

 

 

Alligator and Crocodile Clips

Some useful alligator and crocodile clips from Muller Electric.

MUELLER BU 60 ALLIGATOR CLIP WITH INSULATORS

 

MUELLER ELECTRIC BU 60 WITH BANANA PLUG

 

MUELLER ELECTRIC BU 85 CROCODILE CLIP WITH INSULATORS

 

MUELLER ELECTRIC BU 85 WITH RING TERMINAL

 

MUELLER ELECTRIC BU 85 CROCODILE CLIP WITH RING TERMINAL

 

MUELLER ELECTRIC BU 85 CROCODILE CLIP TEST LEADS

 

END POST

Simple Piezo Vibration Sensor

A simple vibration sensor can be made from some PVC pipe components and a piezo – ceramic disc. This sensor is designed to be used with an oscilloscope. An oscilloscope is also necessary to test the operation of the completed sensor.

PARTS LIST:

1.) 0.75 inch PVC pipe plug. (Actual O.D. 1.050 inch)
2.) 0.5 inch length of 0.75 inch PVC pipe. (Actual O.D. 1.050 inch)
3.) 1.5 inch length of 0.156 inch O.D. plastic tubing. Evergreen Scale Models #225.
4.) 2.75 inch length of 0.093 O.D. plastic rod. Plastruct #90272 or equv.
5.) 0.5 oz sliding lead fishing weight.
6.) 1.062 inch (27mm) diameter piezo ceramic bender disc.
7.) 2 x 6 inch length of 30 or 32 awg insulated stranded wire. (see note below).

Note: The piezo bender disc can be purchased with or without attached wires.

CONSTRUCTION:

1.) Drill a 0.156 (5/32) inch hole in the center of the top of the pipe plug. Insert the 1.5 inch length of 0.156 inch plastic tubing into the plug until the end of the tube is about 0.5 inches above the top of the plug. Make sure the opposite end of the tube is centered in the open end of the pipe plug. Verify that the inside end of the tube does not extend past the end of the plug. Apply a small amount of cyanoacrylate glue at the joint to help hold it in place.

2.) Lightly sand the open end of the plug until it is completely flat. Remove any sanding dust. Clean the piezo bender with alcohol. Using a small amount of either cyanoacrylate or epoxie, glue the piezo bender to the bottom of the plug. Make sure that the side of the piezo with the silver-ceramic disk is on the outside.

3.) If the piezo bender does not have any wires attached, solder them on now. Use a minimum amount of heat as possible.

4.) Take the 0.5 inch length of 0.75 inch PVC pipe and file a shallow notch on one end. This is to provide clearance for the wires. Attach this piece using cyanoacrylate or epoxie to the exposed end of the piezo bender, locating the notch end over the wires.

5.) Verify that the 0.093 O.D. plastic rod slides freely inside the plastic tubing located on the top of the PVC plug. Using cyanoacrylate or epoxie, attach the lead fishing weight to one end of the 0.093 O.D. plastic rod. Once the glue has set, install the weight assembly into the plastic tubing on the top of the plug.

Construction is now complete.

VIBRATION SENSOR MAJOR COMPONENTS

 

COMPLETED VIBRATION SENSOR

 

TESTING:

The sensor can be tested by connecting it to a oscilloscope. Set the vertical volts/division to 200 mv/div or 500 mv/div.

Lightly move the lead weight up and down, allowing it to tap against the piezo bender. You should notice an output voltage being generated on the oscilloscope display.

In testing the sensor, I have found it to be very immune to electrical noise. To establish a base line output simply remove the lead weight from the sensor.

VIBRATION SENSOR AMPLIFER

Here is an adjustable gain AC coupled op amp based amplifier that can be used to amplify the output from the vibration sensor, up to about 10X. A small value capacitor, generally 1000pf or less, can be connected across Pin 1 and Pin 2 of the op amp to filter the high frequency component of the output.

Be sure to decouple the power supply input to the op amp by connecting a 0.1uF ceramic capacitor between Pin 4 and Pin 8 as close to the op amp as possible.

 

AMPLIFIER FOR USE WITH THE VIBRATION SENSOR

 

VIBRATION SENSOR EXAMPLES

The first two examples are of two cordless drills, a Makita Model 6041 and a much larger Black and Decker Model 2665.

The sensor was set on the handle of each drill and both drills were run at 450 RPM. The sensor amplifier was used and the gain setting was set identical for both.

VIBRATION SENSOR OUTPUT OF A MAKITA 6041 CORDLESS DRILL

 

VIBRATION SENSOR OUTPUT OF A BLACK & DECKER 2665 CORDLESS DRILL

 

The next two examples are with the sensor located on a hardwood surface. I lightly tapped the wood surface with my knuckle. In the first example, the sensor was located one inch away. In the second example, the sensor was located forty eight inches away. Note that in the second example where the sensor is located forty eight inches away, there is an apparent delay in the first waveform peak.

VIBRATION SOURCE ONE INCH FROM SENSOR

 

VIBRATION SOURCE FORTY EIGHT INCHES FROM SENSOR

 

Ya Verks Good!

 

 

 

 

 

 

 

END POST