Pinball Optocoupler Cicuit

29 May 2011

Mbed community.

I would like to control pinball lamps with my mbed.

I have a MOC3021 opto coupler.

How do I wire the MOC3021 opto coupler to the mbed to control the lamp circuit?

/media/uploads/pinballer83/opto.jpg

The datasheet isn't very helpful.

The lamps are connected to 7.4 DC

Kind Regards David

30 May 2011

David

I dont think you can use that opto coupler, it has a triac output which means it wont turn off if your using DC. If im wrong, try connecting Pin numbers below are on the opto coupler. 1 A 68ohm resistor from pin 1 to the 3.3v vcc (power) limmits current to 50mA

2 An NPN 2N3904 transister collector to pin 2, emmiter to ground.

3 A 100 ohm resister or greater to the transistor base. (limmits the mbed digital sink current to 33ma.

4 connect one end of relay coil to pin 6, OR A RESISTOR SEE WARNING BELOW.

WARNING I DONT KNOW WHAT CURRENT YOUR RELAY COIL NEEDS SO FIND OUT BECAUSE YOU MAY NEED TO INSERT A RESISTOR BETWEEN PIN 6 AND THE COIL TO LIMMIT THE CURRENT.

5 Connect the other end of the coil to ground.

6 connect whatever supply your relay coil needs to pin 4.

7 Connect your bulb across ground and to one of two of the normally open relay contact pairs, with the other relay contact going to your bulb supply (not the bulb).

If you dont understand the issues above get somebody who does to supervise what your doing, as you can easly damage the mbed and yourself. Do not connect AC to the opto coupler unless you do know what you are doing. Also make sure all the grounds (0v) are retuned to the mbed ground. You may also need to connect a diode across the relay coil.

If you do have to use AC you will not need the relay.

Good Luck,

Dave F.

30 May 2011

David,

I am a software person and NOT an electrical engineer and I had a similar situation. This is what I am doing. I don't know if the 4N25 works like the MOC3021.

I have 2 boards. An mbed controller in one location and a coil board in another location (4 meters away). My design needs this set up. On the coil board I have a 4N25 optocoupler. The only interface between the 2 boards is 2 wires to drive the LED in the optocoupuler. One wire goes straight to ground on the mbed and connects to pin 2 on the 4N25. The other wire is controlled by pin18 (DigitalOut). Between pin18 and this LED anode wire is a 330 Ohm resistor to produce the 5mA for the LED inside the optocoupler. This gets connected to pin 1 on the 4N25. My 2 boards are otherwise electrically separate.

On the coil board, I have 24VDC. I needed a Darlington transistor, 2 resistors, the optocoupler and a rectifier diode to turn my coil on and off. The optocoupler completes the ground for the base circuit of the Darlington which drives the coil. The rectifier diode runs parallel to my coil and backwards to prevent a kickback from damaging the Darlington.

I have just started this project last night and have not connected the two boards yet. For testing, I put an LED in parallel with the optocoupler wires (mbed board). I cannot advise you on the choice of resistors etc on the "light circuit". For this you need to know electrical requirements for the lights.

My requirements could be serviced without a relay. Originally I googled things like "transistors as relay" but never found anything that worked.

Sorry I can't tell you more. I got some help from an EE that I haven't spoken to for 20 years. He doesn't know exactly what I am doing, but I think he understood enough that his info was reliable. Hope this helps

Anthony

30 May 2011

Try this : /media/uploads/iaghici/mbed_opto.jpg