...

Audio modules


3W + 3W USB Power Supply Mini Digital Audio Amplifier Board:

DIY audio for your MP3, MP4, Laptop or any application which USB power can support. This one is built using the PAM8403 "Filterless 3W Class-D Stereo Audio Amplifier".

  • Power Supply: DC 3.6~5.5V.Do not use a power which higher than 5.5V.
  • Output power: 3W + 3W, SNR: 90dB, Efficiency: >90%

Got this from DealExtreme.


LM393 Sound Detection Sensor Module Sound Sensor:

  • When there is sound, outputs low level and the signal light
  • Working voltage:DC 3.3-5V
  • Main chip: LM393, Electret condenser microphone
Note: This sensor only recognizes the availability of sound (vibration principle) can not identify the size of the sound or the specific frequencies of sound.

Got from this sellers ebay listing.


Analog Sound Sensor Board Microphone:

  • With Power LED, Sensor Indicator LED
  • Pin1 AO (Sensor Analog Output)
  • Pin2 GND (Ground)
  • Pin3 VCC (3V~24V)
  • Pin4 DO (Digital Output)

Got from this sellers ebay listing.

Optical Interrupters


Here are some optical interrupters that were harvested from various pieces of junked electronics (printers, copiers and scanners are a good source, since they have quite a few moving parts). The body forms a "C" or an "U" shape, and the passing of a solid object between the arms triggers the interrupt. These interrupters are a good alternative to mechanical switches, more reliable because of the lack of moving parts, and in that they provide a nice crisp bounce-free switching action.

This is what the internal schematics usually look like. The housing should contain an IR (infra-red) emitter-detector pair, with 3 leads (we're calling these leads "E" for the connection to the Emitter +, "S" for the detector collector, and "G" for ground).

The emiiter is an IR LED, and we should put in a current limiting resistor. We're not sure what the specs of the LED are, but anything from 180 to 620 ohms should probably work. We picked a value of 470 ohms to be safe, for the 5V Vcc we are using, and we are getting good results with that. The 10K ohm resistor allows this to be used in a pullup switch configuration. This scehmatic shows how to add the resistors to the interrupter, and connect to a microcontroller pin for input.

Identifying the "E", "S" and "G" pins can be usually done by inspecting the traces on the PCB. Ground should be a trace connecting one leg from the emitter and another from the detector. In the image above, it is the trace that runs up from the bottom left, through the right leg in the middle, and on to the center pin of the connector at the top of the image. The emitter pin "E" is usually (not always, though) the one connected to the component farthest away from the PCB, and the remaining connection should then be "S".

Some interrupters come with built-in current limiting resistors already provided (see the 430 ohm SMD LED in the picture above).

We can use the folowing Arduino sketch, together with the schematic above, to see how to use these interrupters. "S" is connected to pin 4. The code prints "0" normally, and "1" when the beam is broken.

const int signalPin = 4;

void setup() {
  Serial.begin(9600);
  Serial.println("started...");
}

void loop() {
  Serial.println(digitalRead(signalPin));
  delay(500);
}
Here are the pinout values for some of the interrupters we had:
Component markingSignalGroundEmitterValue on interruptNote
K949whiteblackgray1 
ALEPHblueblackred1 
73whitecentergray1 
TP1217red (center)yellowbrown1 
OM1317red/whiteblackred0has a SMD resistor (marked "431", so value is 430ohm)
Omron 1230 KPC45 1 
2112A 1 
S58 1 

Interface code:

Here's some sample arduino code showing how an optical switch can be used to trigger a hardware interrupt. No need for hardware or software debouncing, in this case.
void setup() {
  Serial.begin(9600);
  // encoder pin on interrupt 0 (pin 2)
  // FALLING to trigger on transition from dark to light
  // RISING  to trigger on transition from light to dark
  // CHANGE to trigger on either transition
  attachInterrupt(0, handleInterrupt, RISING); 
  Serial.println("started...");
}

void loop() {
}

void handleInterrupt() {
  Serial.println("beam broken...");
}

And to use analog read...

int sensorPin = 0; //analog pin 0
void setup(){
  Serial.begin(9600);
}
void loop(){
  int val = analogRead(sensorPin);
  Serial.println(val);
  //just to slow down the output - remove if trying to catch an object passing by
  delay(100);
}

Steppers and Motors

See this faq for a nice writeup on using unipolar and bipolar stepper motors.


SCM-E040:

SCM-E040 is a takeout from an (Epson?) printer. It is a 6 wire, 2 phase Unipolar motor. The leads have 100 ohms between A and C (yellow and blue), and 100 ohms between B and D (white and red). I’m assuming the coil will handle atleast 500mA, so that means 10V should be ok per coil, given the 100ohm resistance?

To use with the A4988 stepper, leave the center tap (green) wires unconnected. Minimal wiring diagram for connecting a microcontroller to an A4988 stepper motor driver carrier (full-step mode).


Wantai 42BYGHM809:

  • Step Angle: 0.9 deg
  • Rated Voltage: 2.8V
  • Rated Current: 1.7A / Phase
  • Phase Resistance: 1.65 ohm
  • Phase Inductance: 4 mH
  • Holding Torque: 4200 g.cm (48 N.cm)
  • Rotor Inertia: 68 g.cm2
  • Detent Torque: 220 g.cm
  • Motor Weight: 0.34 kg
  • 5mm Diameter Drive Shaft
  • NEMA 17 form factor

Got this from Sparkfun.


Howard Industries 1-19-4201:

  • Type: 2 Phase Bi-Polar 5 lead
  • Class: NEMA 17, 24V, 3.6 Deg.
  • Coil : 24V/.16A/140ohm/68mH
  • Holding torque: 600gm/cm
  • Shaft: 3/16" dia. X 7/16"

Connections:

stepredbrownwhitegreen
1--  
2 -- 
3  --
4-  -

Sources: All Electronics, MPJA


12V Right angle worm drive motor

Got from All Electronics. Also, matching available with drive on opposite side.

  • No-load rating: 180 RPM @ 12Vdc / 1.3A.
  • 12mm diameter worm shaft is 89mm (3.55") long.
  • last 12mm of the shaft has a 6 x 1.0 reverse metric thread.
  • Heavy gauge U-bracket on back of gearhead, 1/4" holes with 7mm spacing.
  • 3/16" quick-connect terminals.
  • Designed for power seat adjustment in automobiles.
  • Also available with worm gear in opposite direction,
  • "... 1/2-8 ACME nut works on this worm screw. It's a little sloppy because the diameter is under sized. It's definitely not a M12 x 3mm metric nut..."

NMB steppers

PM35S-048PM35L-048PM35L-048
Step Angle7.50 deg7.50 deg7.50 deg
Frame Size35 mm35 mm35 mm
Max Holding Torque20 mNm45 mNm45 mNm
Steps per Rotation484848
Drive CircuitUnipolarUnipolarBipolar
Drive Voltage24 V24 V24 V
Coil Resistance per Phase50 Ohms30 Ohms6 Ohms

Mitsumi steppers


M42SP-7
Rated Voltage DC 12V DC 24V
Working Voltage DC 10.8~13.2V DC 21.6~26.4V
Rated Current/Phase 259mA 173mA
No. of Phase 4 Phase 4 Phase
Coil DC Resistance 50Ω/phase±7% 150Ω/phase±7%
Step Angle 7.5˚/step 7.5˚/step
Excitation Method 2-2 Phase excitation (Unipolar driving)
Insulation Class Class E insulation Class E insulation
Holding Torque 49.0mN·m 52.9mN·m
Pull-out Torque 23.5mN·m/200pps 33.3mN·m/200pps
Pull-in Torque 19.6mN·m/200pps 29.4mN·m/200pps
Max. Pull-out Pulse Rate 600pps 650pps
Max. Pull-in Pulse Rate 420pps 430pps

M35SP-5
Rated Voltage DC 12V DC 24V
Working Voltage DC 10.8~13.2V DC 21.6~26.4V
Rated Current/Phase 259mA 173mA
No. of Phase 4 Phase 4 Phase
Coil DC Resistance 50Ω/phase±7% 150Ω/phase±7%
Step Angle 7.5˚/step 7.5˚/step
Excitation Method 2-2 Phase excitation (Unipolar driving)
Insulation Class Class E insulation Class E insulation
Holding Torque 34.3mN·m 38.2mN·m
Pull-out Torque 21.6mN·m/200pps 24.0mN·m/200pps
Pull-in Torque 21.1mN·m/200pps 23.5mN·m/200pps
Max. Pull-out Pulse Rate 610pps 675pps
Max. Pull-in Pulse Rate 600pps 645pps

M35SP-8
Rated Voltage DC 12V DC 24V
Working Voltage DC 10.8~13.2V DC 21.6~26.4V
Rated Current/Phase 259mA 173mA
No. of Phase 4 Phase 4 Phase
Coil DC Resistance 50Ω/phase±7% 150Ω/phase±7%
Step Angle 7.5˚/step 7.5˚/step
Excitation Method 2-2 Phase excitation (Unipolar driving)
Insulation Class Class E insulation Class E insulation
Holding Torque 38.2mN·m 42.1mN·m
Pull-out Torque 23.0mN·m/200pps 28.4mN·m/200pps
Pull-in Torque 22.5mN·m/200pps 27.9mN·m/200pps
Max. Pull-out Pulse Rate 580pps 610pps
Max. Pull-in Pulse Rate 495pps 520pps


Viper

Vision Incorporated PPi Empowered Robot

Vector is a robot....


Chassis and Powertrain:

Vector


Vector:

Vision Enabled Cellphone Tricycle Oriented Robot

#include <Servo.h>

const byte MOTOR_PORT = 11; // port to drive motor (pwm)
const byte SERVO_PORT = 9; // port to drive servo
const int SERVO_MIN = 700;
const int SERVO_MAX = 2400;
char commandValue = '\0';// holds the command code, sent over serial
int dataValue = 0;// holds the data, sent over serial
Servo servo1;

//
void setup() {
    Serial.begin(9600);
    // setup pins for output
    pinMode(MOTOR_PORT, OUTPUT);
    // using a HS422 servo, was able to get 180 deg.
    // might have to tweak SERVO_MIN, SERVO_MAX to get proper rotation.
    servo1.attach(SERVO_PORT, SERVO_MIN, SERVO_MAX);
}

//
void loop() {
    // priority is for commands coming over serial
    if (Serial.available()) {
        char incomingChar = Serial.read();
        if ('\n' == incomingChar) { // eol recvd, so process command and value collected so far
            processCommand(commandValue, dataValue);
            Serial.print("(");Serial.print(commandValue);Serial.print(dataValue);
            Serial.println(") ok >");// reply back to calling device
            commandValue = '\0'; // reset
            dataValue = 0; // reset
        } else if (isDigit(incomingChar)) {
            dataValue = (dataValue * 10) + (incomingChar - '0'); // accumulate the data value
        } else { // non-digit, so consider as a command code
            commandValue = incomingChar; // set the current command
        }
    }
}

//
void processCommand(char commandValue, int dataValue) {
    if ('m' == commandValue) {// set motor speed
        analogWrite(MOTOR_PORT, normalize(dataValue, 0, 255));
    } else if ('s' == commandValue) {// set steering servo position
        servo1.write(normalize(dataValue, 0, 180));
    }
}

// returns true if 'digit' represents an ascii digit between 0 and 9
boolean isDigit (char digit) {
    return (digit >= '0' && digit <= '9');
}

// chops off valueToNormalize to be between minValue and maxValue
int normalize(int valueToNormalize, int minValue, int maxValue) {
    if (valueToNormalize < minValue)
        return minValue;
    else if (valueToNormalize > maxValue)
        return maxValue; 
    else 
        return valueToNormalize;
}








#!/usr/bin/python

from bluetooth import *
server_address = "00:12:05:11:90:32"
port = 1

print "connecting to \"%s\" on %s" % (server_address, port)

sock = BluetoothSocket( RFCOMM )
sock.connect((server_address, port))

print "connected.  ready for input..."

while True:
    data = raw_input() # read stdin, stripping the trailing newline
    if data == 'x':
        break
    data = data + '\n'
    print 'sending', data
    sock.send(data)
sock.close()

Data Ics


74HC595:

This is a 8-bit serial-in, serial or parallel-out shift register with output latches; 3-state.

Symbol Pin Description
Q1 1 parallel data output 1
Q2 2 parallel data output 2
Q3 3 parallel data output 3
Q4 4 parallel data output 4
Q5 5 parallel data output 5
Q6 6 parallel data output 6
Q7 7 parallel data output 7
GND 8 ground (0 V)
Q7S 9 serial data output
MR 10 master reset (active LOW)
SHCP 11 shift register clock input
STCP 12 storage register clock input
OE 13 output enable input (active LOW)
DS 14 serial data input
Q0 15 parallel data output 0
VCC 16 supply voltage

See this link for sample usage and arduino code.


7400 - quad 2 input NAND gate:


74164 - 8-bit parallel out shift register:


74165 - 8-bit parallel load shift register:


74240 - Octal buffer/line driver, 3-state, inverting:


74244 - Octal buffer/line driver, 3-state:

hold 1G and 2G low, to enable.


74245 - Octal bus transceiver, 3-state:


4011 - Quad 2-input NAND gate:


4013 - Dual D flipflop:


4066 - Quad bilateral switch:


MC1488 - Quad line driver:


MC1489 - Quad line receiver:


LM339 - Quad comparator:


LM386 - Low votage audio power amplifier:


555 - Timer:


NE556 - Dual timer:


ADC0804 - AD convertor:

Gen3 Filter


Time to upgrade the filter with a new design.

Gen2 Filter


Time for a new filter, this time building a sump type trough filter. The main compartment, made up of 6ft lenghts of 1x8 boards. We gave it a couple of coats of latex to minimize moisture absorption, and lined the inside with some scrap EPDM pond liner.
The plumbing and dissipator parts before installation. The plumbing is all 3/4"PVC. The water comes in from the riser feed pipe (far right in the picture), flows through the ball valve (the valve with the bar handle) and comes out of the spraybar on the top, which has slots cut lengthwise (along the bottom half only). The spraybar distributes water in the dissipator body, from where the water is broken up into tiny streams by the spray plate (the black rectangular sheet at the bottom sieved with 1/8" holes) that is held in place by the ledge on the bottom of the dissipator body. The dissipator body is made with aluminum flashing and pop rivets. The globe valve that is leading off the riser is to allow water to be diverted, for water changes. In normal operation, the ball valve would be open and the globe valve shut. To drain, we shut off flow to the filter using the ball valve, connect a drain hose to the globe valve and then open the globe. This way the main pump can also be used for draining.
The sump all connected and in operation. Filter media is plastic bath sponges bought in bulk from the dollar store.

Gen1 Filter


This is a Sterilite file box (18x14x12", Model 1878, about USD 9), planning to mod this for use as a filter.
Using 3/4" PVC pipe as a sprayer bar. (There's 3 rows of 5/64" holes drilled along the length of the pipe, which the picture doesn't show very clearly). Also, the locking notch on the front of the file box is cut away to form a spillway.
These are the components making up this gravity filter. $Store bath sponges are unbunched to provide the filter media. Quilt batting material used for the prefilter. The notched plastic sheet is to form a space between the filter and the spillway.
Filter assembled with media. The notched plastic sheet is bowed and placed in position (with the notches at the bottom) to create a space behind the spillway. This arrangement forces the water to flow from the sprayer bar through the media, and then rise up again through the notches from the bottom, and finally overflowing from the spillway.
Media topped with a couple of layers of the 1/4" batting, to act as a fine pre-filter.
Filter placed on ledge. Using a 700gph submersible pump to circulate the water.
Connected the pump to the spray bar inlet using 3/4" ID black vinyl tubing. Turned it on to test the flow, and we have a nice little waterfall. Now we wait for the pond to cycle so we can add fish.....
Wainscotting panels being installed to cover up the outside.
The waterfall in action, a nice tapering ribbon cascade. And that flash of orange in the water is...
...Blobbergills! He was just transferred into the pond from his old 10g tank.
And that's the gang on the prowl. Fireworks the Sarasa comet in the lead, Blobbergills our (un)common goldfish, and Al-Azrak the blue American Shubunkin.
We started building a new filter/waterfall because the previous design was just too loud was keeping us up all night. While that big cascade did look spectacular, the large drop had a lot of energy to be dissipated and was creating huge ripples on the surface, through which we could hardly see the fish. That's a ledge built with 2x6's and 3/4"plywood held together with galvanized angles.
Found a broken plastic box in the trash, planning to use that for a liner. That's an Ikea Antonius drawer, btw.
Cut the box and folded the edges over the wood using a heat gun to soften the plastic.The liner is secured in place with a few screws. A few more galvanized angles were added at the top edge, to help hang the ledge from a corner of the pond.
Started gluing some rocks to build up a wier for the waterfall. The adhesive used was GE Silicone I 100% silicone Door and Window type, with no added mildewcides. We're pretty sure that's safe for the fauna from all we've read on aqua forums, even though the cartridge explicitly says "not safe for use on aquariums" (that's there for liability purposes, we assume)
More rocks being siliconed on. We picked through a pile of rough granite and chose flat rocks of different sizes.
This filter is from a Rubbermaid 28qt bin. The spray bar is 3/4" PVC, with 1/8" holes (about 200 of them) drilled radially along the bottom half of the pipe. The far end is capped, to allow access for cleaning the inside.
We secured the rock ledge, and seated the filter assembly in an overflow tray. The water exits the filter from a 1-1/4" pipe coming from the bottom of the filter, through the overflow tray and out onto the rocks. The water pools before cascading over the wier.
Covered up the filter with some artificial foliage for now. We're planning on putting in some real plants soon.
They love to swim through the falls as they cruise the pond.