Showing posts with label work. Show all posts
Showing posts with label work. Show all posts
4/18/2013
GP2D12 distance sensor 1N5819
During 250 ms, sensor is configured as a light sensor (powered), C1 charges through D1 up to SENSOR+ voltage. Low drop regulator U1 generates a 5V regulated supply. Q1 is blocked by D2 (D2 maintains base to a voltage higher or equal to its emitter voltage), so GP2D12 is not powered. Q3 is non-conducting too, preventing current flow through D3/R5/Q2. So the only significant current diverted from C1 charging is through R1 (less than 2 mA), and at the end of this phase C1 is fully charged.
During the following 50 ms, sensor is configured as a touch sensor (passive). SENSOR+ is now only pulled up to +5V through 10Kohm (inside RCX), insufficient to block Q1. Q1 and Q3 are then conducting, and GP2D12 is powered. Q2, mounted as an emitter follower, buffers GP2D12 output and its value is available to RCX through D3 and R5.
Sample code to read sensor:
SetSensor(SENSOR_1,SENSOR_LIGHT);
Wait(25);
SetSensor(SENSOR_1,SENSOR_TOUCH);
Wait(5);
SetSensorMode(SENSOR_1,SENSOR_MODE_RAW);
distance=SENSOR_1;
SetSensor(SENSOR_1,SENSOR_LIGHT); //Enable C1 charge as soon as possible
Component selection
D1 prevents destroying the sensor in case of reverse connexion. I didn't use the full bridge rectifier used in Lego sensor that enables sensors to work when connected backwards (number of needed diodes jumps from 3 to 8 !). I considered that someone able to build this sensor is also able to connect it in the right way... For those who want it, here is the diagram with full bridge rectifier.
I used 1 Amp. Shottky diode 1N5819 for D1, inexpensive and readily available. Its low forward drop foltage is less than 0.1V for the current that flow through it, this enables to charge C1 to the highest voltage possible.
C1 stores energy that will be used during measure phase, it must provide 5V at the end of this stage. Assuming typical values for GP2D12 (I=35mA, conversion time=50ms) and an initial 7.5V across C1, its value is C = I * dT / dV = 35 * 50 / (7.5-5) = 700 µF. Small margin with 1000 µF...
U1 is a low drop out 5V regulator in TO92 case. I used a Telcom/Microchip TC55RP5000, but other regulators will probably work, such as STMicroelectronics L4931-50. Standard regulators such as 78L05 will NOT work because they require more than 7V at input to get a 5V output. Take care with some low drop regulators such as LM2931 that require more than 25 mA when powered at 1V. With RCX current limitation, this hog eats all energy. (I was caught with this one...)
Q1 switches power on and off for GP2D12. At 35 mA current, I originally used a plain-vanilla BC548. My sensor began to work with it, but exhibited strange behavior. Looking to GP2D12 power supply I then discovered 2V dips ! I then looked at GP2D12 consumption and discovered that it was pulsed (220mA pulses 1/8th of time, supperposed to a 8mA constant current. See oscilloscope captures here). At such a current, BC548 has a low gain, and since I couldn't lower base resistor R1 (main current drain during capacitor charge) I used a high performance Zetex transistor, ZTX718 that offers high gain at high current (other similar devices can work!).
C2 stabilizes U1 and helps absorb peaks of current. A low ESR version would be better (see "grass" on 5V output when GP2D12 works).
3/27/2013
Final Project - Ping Pong Shooter L7805CV
The Ping-Pong shooter, as its name, is able to shoot Ping-Pong balls, and the machine can simulate a real-world situation that if there is a player in front of it, it starts shooting; otherwise, it stops working
Criteria of Success
1. A machine that can shoot
2. Able to control the machine i.e. control weather the ping-pong ball will shoot or not
3. Able to control the system with a laser dependent switch
How it works:
The ping-pong shooter mainly contains three parts
1. A switch that is depends on a photoresistor and a light source(laser beam)
2. Two DC motors to shoot the balls
3. Stepping mother which acts likae a gate to control the flow of the ball
Main Component
Photoresistor
DC motors
Stepping Motor (a8byj-48)
Micro controller (89S51)
Octal high voltage high current Darlington transistor arrays (ULN2803)
Voltage regulator (L7805CV)
A ULN2803 is an intergrated Circuit (IC) chip with a HIGH Voltage/High Current Darlington Transistor Array. It allows you to interface TTL signal with higher voltage/current loads
The chip takes low level signals (operate at low voltages and low currents0 and acts as a relay of sorts itself, witching on or off a higher level signal on the opposite side.
The 78xx family is commonly used in electronic circuits requiring a regulated power supply due to their ease-of-use and low cost
I.E. 7805=5V 7812=12V
Disadvantage: Input voltage always needs to be higher than the regulated voltage
Miscellaneous Component
Resistor (10k ohm *2)
Capacitor (33 pF*2,1000nF*1)
Oscillator(12MHz*1)
Wires
PVC tube (2" Diameter)
Subscribe to:
Posts (Atom)