Maker Pro
Maker Pro

Eye Movement Desensitization Rehabilitation device

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
I need to make an EMDR device for my mum because they cost £125 to buy, she is fully qualified.

I have the vibrating pods that the patient holds in their hands they have a standard 3.5mm stereo jack and use 0.1 amp at 4.4v, they need to vibrate 1 at a time left right left right and so on at approximately 0.5 second to 2 seconds per pod and with variable intensity.

You can see the circuit I've come up with in action on the Falstad circuit simulator here.

I need to know if theres a simpler way of doing it and without a 555 timer.

P.S. turn on European resistors in the options menu.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That link doesn't take me to your schematic. It probably does on your machine because you have cookies that tell the site which circuit you are working on, but we don't have those cookies, so you'll need another way to direct us to the schematic.

Or you could take a screen capture, crop it, convert to 16-colour GIF and post it here. To attach it, click the Go Advanced button, click the paper clip icon and upload the file.

For circuit simplicity your best option would be a small microcontroller such as a PIC. These are available in some really tiny 6-pin packages, which would be enough to control two vibrating pods with one or two I/O pins to spare for other functions. But of course that means you would need to learn about programming them. Usually they're programmed in C or assembly language. You also need a USB programming pod to actually get the program into the device. The one for the PIC is USD 50.

I would be happy to help if you can describe what the controller needs to do, in a lot more detail. I had a look on emdr.com but couldn't find information on the equipment used.

Edit: Here's an example of a suitable microcontroller: http://www.digikey.com/product-detail/en/PIC10F200T-I/OT/PIC10F200T-I/OTCT-ND
 
Last edited:

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
You need Java installed so the applet can start.

I have experience with a picaxe I was just exploring other options but it looks like the picaxe will be the best choice.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I thought I had the Java plugin installed, but you're right, I didn't.

That's a strange looking circuit! Oh, I see it now. Yes, I agree that a micro would be the best choice, especially if you have programming experience. You'll still need the transistor buffers, but you could do the voltage control using PWM, which would simplify the hardware a bit, although then you need a way to tell the micro what intensity to use.

Your circuit should work OK though, and would save some development time. Why don't you like it? Do you just want to make it smaller?
 

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
I was looking to see if there were a simpler circuit possibly avoiding logic components.

I know I can use 2 op-amp's to generate a square wave but since the pods have a common ground at the connector I would have to use a PNP BJT for one pod and an NPN for the other but then the pod on the NPN BJT would get a volt drop making them uneven.

If I use a picaxe I'd prefer not to use PWM so if I control the supply to the outputs with a pot and BJT like in the circuit I showed you is it ok if the collector voltage is lower than the base on the output BJT's?
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I was looking to see if there were a simpler circuit possibly avoiding logic components.
But you don't want to use a 555?
I know I can use 2 op-amp's to generate a square wave but since the pods have a common ground at the connector I would have to use a PNP BJT for one pod and an NPN for the other but then the pod on the NPN BJT would get a volt drop making them uneven.
True. But you can make a square wave oscillator with one op-amp and use the other to invert the signal. But that requires about 5 external components.
If I use a picaxe I'd prefer not to use PWM so if I control the supply to the outputs with a pot and BJT like in the circuit I showed you is it ok if the collector voltage is lower than the base on the output BJT's?
Are you talking about the two PNPs? They will be OK. I'm not sure what you mean. Assume the intensity potentiometer is adjusted so the emitter of the NPN, and the emitters of the PNPs, are at 2.5V. When the oscillator side of a base drive resistor is low, to turn on the PNP that it drives, that PNP will have its base at around 1.8V (about 0.7V lower than the emitter because of the Vbe voltage of the PNP) and its collector at about 2.3V (the 2.5V emitter voltage minus the Vce(sat) of the PNP). This is all normal and good. When the oscillator side of the resistor is high, the PNP's base will be pulled high and its collector will be at 0V. This is also fine as long as you don't reverse-bias the PNP's base-emitter junction by more than about 7V. That's because the base-emitter junction behaves like a ~7V zener diode and the device will actually be damaged by reverse base-emitter current. But with a 5V supply you're safe there.

You might find it's tidier to switch the positive outputs with PNPs with their emitters tied to the positive rail, and put the emitter follower in the common return path from the loads to the 0V rail. You would use a PNP with its collector connected to 0V and its emitter connected to the load common return collection. Add a 0.1 µF capacitor across the transistor. Drive the base from a pot across the supply, as before. This is a bit tidier IMO and is fine as long as the load is fully insulated.

You should add a diode reverse-connected across each load because motors are inductive and can generate back EMF spikes. These won't interfere with the circuit's operation.

A better option for the oscillator is a hex inverting Schmitt trigger. The CMOS version is available under various names: CD4584, 74C14, and CD40106 (probably the most common name). It contains six inverting gates with Schmitt trigger inputs. One gate implements the oscillator (see http://datasheetoo.com/?attachment_id=836 for the circuit), a second one provides an inverted output, then you can use the remaining four gates as two pairs of gates "paralleled" (I don't like that word for gates wired with their inputs connected together and their outputs connected together) to buffer the true and complement signals, to drive the PNPs. This isolates the oscillator from the transistors and increases the available drive current.

Let me know if any of this is unclear and I'll draw it up.
 

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
When I tried the 555 in the circuit simulator I got the impression that holding a 50% duty cycle at the right speed is not easy but if theres a good way of doing that it might be an option.

I can make an oscillator with a single op-amp and a symmetrical supply but is it possible with a single supply?

Putting a PNP on the common return is a good idea, whats the 0.1uF for?
I was concerned about the reverse bias thing because I accidentally fried a couple of relatively expensive NPN's before by putting a 2200uF cap on the base it took a few minutes before the BJT shorted I only figured it out after frying a second one.

The circuit simulator doesnt have a Schmitt so if I cant simulate it I wont be very confident with that idea.

After all that, the picaxe has ADC's that can be read as 8 or 10 bit,
so if I have a value between 0 and 1023 how do I use that to get a pause between 500 and 2000ms?
 
Last edited:

jpanhalt

Nov 12, 2013
426
Joined
Nov 12, 2013
Messages
426
First, it is quite simple to get exactly 50% duty cycle with a 555, if you operate the 555 at 2X the desired frequency and follow that with a divide by 2 SR flip-flop. You may also consider inverter oscillators such as described here: http://www.fairchildsemi.com/an/AN/AN-118.pdf

All of that is with a single supply.

I am not advocating medically doing what you are trying to do.

Regards, John
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
When I tried the 555 in the circuit simulator I got the impression that holding a 50% duty cycle at the right speed is not easy but if theres a good way of doing that it might be an option.
It depends how accurate you need the duty cycle to be. You can get close to 50% using a relatively low value resistor from pin 7 to VCC and a higher value for the other resistor.

Also you can take the feedback from pin 3 instead of pin 7 if there's a good symmetrical voltage swing at the output. The original 555 has an output stage that doesn't pull all the way to VCC, but various improved versions do, at the expense of having a lower output current rating. If it will only be driving transistors, it doesn't need a high drive capability.

But you still need an inversion stage. A Schmitt trigger oscillator using a CD40106 is probably the simplest option.

And as John says, you can use a flip-flop to divide the frequency by 2 and produce a perfect 50% duty cycle. But that requires an extra IC. It does produce true and complement outputs though, which is convenient. It's actually possible to make an oscillator with one half of a CD4013 dual D-type flip-flop IC, so you could actually generate the control signals with a single IC. That might be a good approach if you really need exactly 50% duty cycle.
I can make an oscillator with a single op-amp and a symmetrical supply but is it possible with a single supply?
Yes. The circuit uses three resistors to the non-inverting input - one from VCC, one from 0V, and one from the output - to create positive feedback and two different trigger points - a Schmitt trigger - and an R-C circuit from the output to the inverting input.
Putting a PNP on the common return is a good idea, whats the 0.1uF for?
To provide a low-impedance path to 0V for noise from the motor. It's not essential.
I was concerned about the reverse bias thing because I accidentally fried a couple of relatively expensive NPN's before by putting a 2200uF cap on the base it took a few minutes before the BJT shorted I only figured it out after frying a second one.
Yes, it's possible to fry them if you apply more than about 7V of reverse base-emitter bias. The magic smoke doesn't come out, but it loses its magical qualities.
The circuit simulator doesnt have a Schmitt so if I cant simulate it I wont be very confident with that idea.
You can be confident about a Schmitt trigger oscillator. And don't place too much confidence in any circuit simulator. Did it warn you that the emitter follower transistor would get hot?
After all that, the picaxe has ADC's that can be read as 8 or 10 bit,
so if I have a value between 0 and 1023 how do I use that to get a pause between 500 and 2000ms?
Various ways. This is how I would probably do it.

First calculate the amount of time that corresponds to an increment in the value from the ADC. I'll assume that your period range of 500~2000 ms relates to the whole cycle; you need to toggle the transistor control outputs twice in the cycle, so the period range you need is actually 250~1000 ms, because it is the period of a half-cycle.

An ADC value range of 1024 translates to a period range of (1000 - 250) = 750 ms. So an increment in the value from the ADC corresponds to (750 / 1024) = 0.732 ms. The base (minimum) period of 250 ms corresponds to an ADC value of (250 / 0.732) = 342 ADC counts. So start by adding 342 to the 10-bit value from the ADC. That gives you a value from 342 to (342 + 1023) = 1365. Each increment of that value corresponds to a time interval of 0.732 ms or 732 µs.

So you need to count off intervals of 732 µs. You need a counter variable that is set to (342 + ADC value) and you decrement it every 732 µs, using a timer as a reference. When it reaches zero, you toggle the outputs that control the transistors, re-initialise the counter, and go back to the wait loop.

Getting a 732 µs timebase from a timer can be done using an interrupt, or just by polling a timer in a loop. If your system clock is say 4 MHz and the timer has a divide-by-2 prescaler, the timer clock period is 0.5 µs, so you need to count (732 / 0.5) = 1464 counts. Exactly how you do this depends on which timer you're using. I can get into detail if you want.

Which option is best depends on your priorities. An MCU-based solution to generate the drive signals would be the most compact but it can be done fairly easily with CMOS logic, which gives you a wider supply voltage range and avoids the need for programming. A Schmitt trigger oscillator using a CD40106 is simple and generates both control signals, but doesn't guarantee exactly 50% duty cycle. You could reasonably expect 45~55% duty cycle, or as close as 48~52% with trimming (as long as the supply voltage is pretty constant). A CD4013-based design would provide exactly 50% duty cycle with five passive components. I think that's what I would go with personally.
 

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
Wow thanks for all that, I'm starting to like the op-amp idea quite a lot I found the perfect component values that allow for a small 1uF capacitor with practical resistor values and precise frequency control: LINK

Am I right in saying this BJT has a very low Vce(sat) and therefore a low power dissipation: http://www.farnell.com/datasheets/1689749.pdf check the graphs on page 4.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
The op-amp circuit is fine, though I'm not sure what value your positive feedback resistor is - is it 2.5 ohms? It should be around the same value as the other two resistors connecting to the non-inverting input.

The disadvantages of the op-amp are that you need an op-amp with a full output swing if you want an accurate 50% duty cycle - most op-amps (especially older ones) don't pull their output equally close to the positive and negative rails - and you will need an inversion stage. That can be done with the other half of a dual op-amp, of course. And a comparator can be used instead of an op-amp.

The ON Semiconductor MC33202 is very symmetrical and perfect for this application, but Digikey only have it in SMT: http://www.digikey.com/product-detail/en/MC33202DR2G/MC33202DR2GOSCT-ND

The Texas Instruments TLV2372 is also good and Digikey have it in 8-pin DIP (http://www.digikey.com/product-detail/en/TLV2372IP/296-12219-5-ND) as well as SMT (http://www.digikey.com/product-detail/en/TLV2372ID/TLV2372ID-ND).

Those transistors are rated at 10A - a bit of an overkill! A Vce(sat) of 1V at 8A is good, but irrelevant in this circuit position, and its current gain is good for a power transistor, but not as good as a BC327-40.

It's only the emitter follower transistor that has an issue with power dissipation, and Vce(sat) isn't a factor because the transistor is not saturated. It operates with a Vce voltage between about 0.7V (at maximum motor speed) and 5V (at zero motor speed). The greatest power dissipation into a resistive load occurs around half way between those two. For example at 2V across the motors, whichever one is enabled will draw about 50 mA (actually probably not, because a motor is a lot more complicated than a resistor, but let's assume that) and the emitter follower will have about 3V across it (from emitter to collector). Power P = V I = 3 * 0.05 = 0.15 watts. A TO-92 plastic package dissipating 150 mW will get hot to the touch but not too hot - about 20 degrees Celsius above ambient. You could add a small heatsink (http://www.digikey.com/product-detail/en/575200B00000G/HS251-ND) but I don't think you'll need it.

BTW I just re-read your first post. You want 500~2000 ms per motor, so my calculations relating to the MCU timings in post #9 are out by a factor of 2.
 

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
Why is 2.5 ohm too low, those values allow for a smaller capacitor and resistor on the negative feedback side.

I get my stuff from farnell its much more user friendly than digikey, is a comparator basicly an op-amp thats made to output rail to rail and nothing in between?

I think the Vce(sat) of the D45H11 at 0.1a is about 0.1v check out figure 7 on page 4 I was going to put a small heat sink on that anyway. Oh and its TO-220 not TO-92.

Slight change of spec, it has to switch between 0.25s to 2s per side.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
It's a long story to explain why 2.5 ohms is too low. Simply put, it makes the upper and lower voltage thresholds equal to the output voltage swing, which is (a) variable, depending on temperature and other factors, and (b) too close to the positive supply for most op-amps to deal with. Even if you used a true rail-to-rail-input op-amp, you would find that very small variations in supply voltage and temperature would have a very large effect on the frequency.

The only reason it works at all in the simulator with that value is because the simulator uses an ideal op-amp. This is another reason why I say that you shouldn't have blind faith in a simulator. You need to understand their limitations.

Yes, a comparator is designed to be used to compare two voltages for greater/lesser. Comparators don't work well as amplifiers, but in this circuit, either an op-amp or a comparator will work fine. As it happens, op-amps are available with better output stages than comparators I looked at. The output needs to pull symmetrically nice and close to the rails.

I found a very nice dual op-amp available fairly cheaply from Farnell: the Texas Instruments OPA2170. See http://uk.farnell.com/texas-instruments/opa2170aidgk/op-amp-dual-36v-1-2mhz-8msop/dp/2099891. It's only available in SMT (surface mount technology) though. The SO-8 package has pins at twice the density of through-hole IC packages, so they can't easily be used on stripboard, but there are prototyping and adapter boards available for SMT packages.

As I explained, Vce(sat) is not important when choosing transistors. I think BC327-40 is your best option. Farnell also have the NTE NTE129P which comes in a TO-92 package with a tiny little tab sticking out the top, and has a slightly higher power rating. See http://uk.farnell.com/nte-electronics/nte129p/bipolar-transistor-pnp-80v-to-237/dp/4524159. But the BC327-40 will be fine. Farnell have a TO-92 heatsink: http://uk.farnell.com/aavid-thermalloy/575200b00000g/heat-sink/dp/1851648
 

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
I prefer the specs on the LM393-N it has a picture of the oscillator circuit you told me about in the datasheet now I know how to do it properly.

Have a look at my circuit (dont forget European resistors in the options menu)

If the emitter follower will generate some heat would not a TO-220 with a small heatsink be better?

Finally I need to figure out the cap resistor pot combination for a 0.25 - 2 second range.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That circuit won't work as designed. I don't know why the simulator thinks it will. The problem is the NPN you're using to invert the output signal to drive the second PNP. Its base will clamp the comparator's output to about 0.7V above the 0V rail. In the real world if you built this circuit, the oscillator would not run, and both of the PNPs would stay ON constantly.

BTW LTSpice from http://www.linear.com is a free simulator that matches reality a lot better than the one you're currently using. It doesn't have the pretty animation and it takes a little bit of learning to use it, but it's worth it.

Ignoring the problem with the NPN transistor on the output, an LM393 with a pullup resistor on its output will not pull low and high equally, so the duty cycle will not be 50%. It will be close though. The op-amps I suggested will be better.

You can fix the problem with the NPN transistor by adding a base resistor, but that will take the duty cycle further away from 50% because the output won't pull all the way to the positive rail. You could use a PNP to invert the signal, but the simplest option is to use the other comparator or op-amp in the package. Connect its non-inverting ("+") input to the non-inverting input of the first one, and connect its inverting ("-") input to the output of the first one.

TO-220 transistors (and other power transistors) have relatively low current gain. A reasonable compromise is MJE172 (http://uk.farnell.com/fairchild-semiconductor/mje172stu/transistor-bipolar-pnp-80v-to126/dp/2322568) which is in a TO-126 package. You can use a small heatsink (http://uk.farnell.com/aavid-thermalloy/577500b00000g/heat-sink/dp/1851644).

The time period of an R-C oscillator like this one is proportional to the resistance, so the resistance needs to be adjustable over a ratio of 2:0.25 or 8:1. So the fixed resistor you put in series with the potentiometer should be about 1/7th of the resistance of the potentiometer.

A good maximum resistance for that oscillator would be around 200~500 kilohms. Here's a suitable potentiometer: http://uk.farnell.com/vishay-sfernice/p10xxai204kb30/potentiometer-200k/dp/1714015. The tolerance on its end-to-end resistance is ±10%. The resistor should be about 29 kilohms; use 27k.

A Schmitt trigger oscillator with a rail-to-rail output swing and thresholds at 1/3 and 2/3 of VCC (all three resistors on the non-inverting input the same value) has low and high times of t = 0.7 R C. The maximum resistance will be about 227k and you want each period to be 2 seconds. t = 0.7 R C rearranges to C = t / (0.7 R) = 2 / 159,000 = 12.6 µF.

In the real world, most capacitors aren't very accurate. Aluminium electrolytics in that range are normally ±20% but there are some ±10% options. You could get one of each of these and connect them in parallel:

10 µF ±10% Nichicon KL electrolytic: http://uk.farnell.com/nichicon/ukl1h100kddanatd/capacitor-alum-elec-10uf-50v-10/dp/1823696
2.2 µF ±10% Nichicon KL electrolytic: http://uk.farnell.com/nichicon/ukl1h2r2kddanatd/capacitor-alum-elec-2-2uf-50v-10/dp/1823697

Film capacitors are available with tighter tolerance. They're physically larger and a bit more expensive.

Arcotronics 10 µF ±5% polyester: http://uk.farnell.com/arcotronics/r60er51005040j/cap-film-pet-10uf-100v-rad/dp/1679357
Epcos 2.2 µF ±5% polyester: http://uk.farnell.com/epcos/b32520c225j/capacitor-poly-film-film-2-2uf/dp/1792111
 

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
I was not intending to use the NPN I was just messing about, would not a simple inverter do the same thing as a Schmitt? I can simulate that fine but I didn't want anything bigger than an an 8 pin DIP and I can only find inverters in 14 pin DIP's.

Farnell has a minimum £20 order so I cant keep the price down too much.

Circuit
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
A "simple inverter" will not make an oscillator the way a Schmitt trigger will.

You could use a single-gate Schmitt trigger inverter: http://www.digikey.com/product-detail/en/TC7SZ14FU(T5L,JF,T)/TC7SZ14FU(T5LJFT)CT-ND but these are only available in SMT packages and you can't exceed 5.5V supply (6.0V for some types). You would need a trimpot to set the duty cycle to 50% because the input voltage thresholds of these devices are not quite symmetrical.

If you're talking about creating an inverted version of the oscillator output, to drive the second transistor, yes you could use a "simple inverter", or another one of those single-gate devices. If you want an inverter in a DIP package, you would have to use a 14-pin package - I don't know of any smaller option in through-hole.

But you can use the other op-amp in the dual op-amp package as an inverter to generate the complementary signal, as I described in post #15, paragraph 4.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That CD40107B has open-drain outputs, and it doesn't have Schmitt trigger inputs. I don't know what you would want to use it for.

Are you reading my posts fully? Try re-reading them carefully.
 

CommanderLake

Oct 2, 2012
227
Joined
Oct 2, 2012
Messages
227
You want me to use a Schmitt inverter yes I know I'm looking for 8 pin DIP alternatives.
 
Top