easy for you, difficult for me

hippy

Ex-Staff (retired)
Maybe I can find a 74HC14 and then figure out what exactly I'm supposed to do with it.
Or better still, figure out what you're trying to do and then determine what you need to achieve it :)


I mean, I would still only have the one PWM output. I don't see how just inverting it does me any good.
It'll give you an inverted signal, which, with a head between the two, will give an alternating current flowing in one or the the other direction, and gating both signals would allow both signals to be set to the same level stopping current flow entirely.

Somewhere in these four pages of postings I'm guessing there is a specification of what you actually want to achieve ? It may be worthwhile restating that so the tangentials can be pruned from the actual aim.

Once the goal has been defined, solutions can be presented to meet that goal, and ideas can be matched against that goal to see if they will work or not.
 

jwhooper

Senior Member
This is what I want to do, right from the Alpha Stim description:

CES device generating microcurrent pulses that are thought to reach the brain directly via ear lobe stimulation with 42% reaching the cortex through a perineuroal or vascular pathway via the auditory meatus. Frequency: 0.5 to 600 uA. Output: 4.0 mA maximum. Waveform: Bipolar asymmetric rectangular waves, 500/a duty cycle. 0 net current. Average current density in brain tissue: 1 mA: 5-18 uA per cm. Electric field in brain tissue at 1 mA: 2.8 to 8 mV per cm.

Method of Action: Cranial electrostimulation uses microcurrent pulsed high frequency carrier waves (15,000 Hz) which utilizes the bulk capacitance of the body and a modulating bioactive frequency at low current levels to reestablish optimal neurotransmitter levels and functioning in the brain.


From a lot of research (but not really a great deal of electronics knowledge) this is what I understand:

I need to make a 15 KHz rectangular carrier wave, pulsed at 0.5 Hz (and 100 Hz, which is also common) and direct these pulses first one way then the other, to the ears.

I take it that the duty cycle refers to the carrier wave.

I had this all working just fine without the "carrier wave" just using a simple Picaxe chip and setting two pins on and off, first to the left ear, then to the right.

Then I read about the "carrier wave" and decided to add that. Not so fast! The Picaxe only puts out PWM on one pin. It can do 15 KHz, but only on that one pin, and I need bipolar. OMG! The programmer needs to know something about electronics!

BeanieBots kindly suggested that I use an inverter (Schmitt trigger).


It took a bit of driving, but I now have 74HC14 chips.

I'm not sure what "asymmetric" rectangular wave means exactly.

This is an $800 device, or I would just go buy one rather than torture myself and everyone else.
 

Dippy

Moderator
Alpha-Stim "assymetric". Look part way down this page for a picture example...
http://www.alpha-stim.com/as100.html

A layman would almost think that those spikes were merely a side-effect of a reactive inverter... but , naturally, they are intentional and beneficial.

And just look what the effect of Alpha-Stim has been on Dr.Kirsch...
But I bet the effect on his bank balance has been slightly more positive :)
 

jwhooper

Senior Member
Once I managed to stop looking at that rather well-endowed young lady who is for all intents and purposes naked, I did finally find the waveform graph. That isn't what I was expecting to see. I doesn't look like a 15 KHz wave with the duty cycle modulated. It looks like pretty much everything is modulated, from amperage to frequency. I just don't know what to make of it.

Look at it this way, if the device is bunk, we can document publicly how to clone it for under $10. If it isn't ... we can document publicly how to clone it for under $10.

What is up with that waveform?
 

hippy

Ex-Staff (retired)
7414's being Hex inverters aren't easy to gate but that can be bodged. This configuration will allow a 15kHz wave to be set with PWM then O1 can be used to control the delivery of that wave; set O1 as an input to allow the wave, set O1 as output high to inhibit it.

While allowed ( O1 an input ), a bipolar current ( left to right, then right to left ) will flow, when inhibited ( O1 an output high ) the final buffer outputs will both be set low (0V) and consequently no current will flow.

The two 660R's will ensure the maximum current does not exceed 4mA. To limit to 600uA, replace each 660R with 3K9 and 270R in series.

Code:
                                                          nnnnn
.--------.         |\      ___          |\      ___      | _ _ |
|    PWM |----.----| >O---|___|---.-----| >O---|___|--> (| o o |) <----.
|        |    |    |/             |     |/      660      |  U  |       |
|        |    |                   |                      | --- |       |
|        |    |     ___           |     |\      ___      `-----'       |
|        |    `----|___|---.------|-----| >O---|___|-------------------'
|        |                 |      |     |/      660
|        |    .----|>|-----'      |
|     O1 |----{                   |
|        |    `----|>|------------'
`--------'     2 x 1N4148
Oh yes ... I take no responsibility whatsoever for that circuit nor any use of it.
 

jwhooper

Senior Member
I almost feel bad that I made you do my work for me. I actually do feel bad that I don't really understand a bit of it. If I bought the Picaxe VSM software, do you think that would help me understand how things work?

Is there a 7414 in that schematic?

I'm going to take a guess at what it means. You did the buffer thing, and those triangles are hex inverters. The square things must all be resistors, I guess. Diodes, got it.

Sigh. I just don't understand how that circuit works. I'm going to go read my basic electronics book for the 10th time.

Well, I'll probably just try building it as well. That guy looks just like me, the Forrest Gump of electronics.
 

Coyoteboy

Senior Member
Oh yes ... I take no responsibility whatsoever for that circuit nor any use of it.

Ahh don't worry, I put the 6ms 5kv output from my cars ignition lead through my left arm and out to ground through my top lip. Or at least thats what I deemed to have happened after picking myself up from a few feet away from the car. No permanent damage...<twitch>......<twitch>
 

inglewoodpete

Senior Member
From what I can see and have read on the subject, I can't see the need for most of the components in Hippy's circuit.

Why not have just the PICAXE and 2 resistors? Set the PWM at 15kHz and then toggle the O1 pin at 0.5Hz (or what ever). Surely this has the same effect, provided the subject(victim?) is not electrically connected to any other part of the circuit?
 

Dippy

Moderator
I thought he was trying to produce a genuine AC?
I get the feeling that a little more R&D and an oscillioscope is needed here.

But I hope you get it working (safely) as this will be an example of undercutting overpriced products as opposed to copying.

How r you going to control current?
 

jwhooper

Senior Member
From what I can see and have read on the subject, I can't see the need for most of the components in Hippy's circuit.

Why not have just the PICAXE and 2 resistors? Set the PWM at 15kHz and then toggle the O1 pin at 0.5Hz (or what ever). Surely this has the same effect, provided the subject(victim?) is not electrically connected to any other part of the circuit?
That would not result in zero net current.
 

jwhooper

Senior Member
I thought he was trying to produce a genuine AC?
I get the feeling that a little more R&D and an oscillioscope is needed here.

But I hope you get it working (safely) as this will be an example of undercutting overpriced products as opposed to copying.

How r you going to control current?
An oscilliscope would be nice. Are there any cheap ones worth having? I've seen some that work with the PC, but I wonder if they are any good.

Right now I am controlling current with resistors. I put my voltmeter to the leads before I attach them to my head, just to make sure I have no more than 1 mA. I bet that isn't what you are asking.
 

Dippy

Moderator
Well I'm glad you've got resistors. But at 5V I can't really see how it can fry the brain or even get some of the posters here so worried. If your head is a megohm to DC, for example, then you can do the maths concerning resistance/current @ 5 volts - not a lot, is it - and I simply don't know how that changes with an AC source. I don't know how the 'big boys' do it. Personally, I'd try active current limiting.
Have you tried a multimeter across your ears? (Remember to tale it off before you go out though otherwise you may end up being sent for electroconvulsive treatment :) )

Scopes, there are quite a few cheapies on the market that would be perfectly good for this project and others. I don't want to start a great protracted argument about my-scope-is-bigger-than-yours but when looking round keep in mind what you might be doing in future e.g. should I save up more pocket money and get a digital storage type.
PC types: well, I only briefly tried a PICO scope a few years ago. I must say it was pretty good and had logging and fft software bundled. Good value. Personally, I prefer a standalone bit of kit from a big manufacturer but that's just my preference.
 

jwhooper

Senior Member
I've actually worked on the software end of a lot of EEG and biofeedback equipment, so I know a many professionals in this field, and I have read most of the studies concerning CES. There has never been an incident of even a seizure at the 1 mA level. In fact, many of them used over 10 mA with quite good results and no side effects. Obviously even static electricity can put more than 1 mA through your entire body, including the brain, and people aren't going into epileptic seizures every time they walk across a carpet in their socks, so I think we are on quite safe ground here, even if the waveform is less than optimal.

There was a real scientific study that showed the 15 KHz frequency to be the best for working with the natural capacitance of cell colonies, which would include most human beings. However, I'm am not certain it is really necessary as many CES devices don't bother with it. The trouble is that there have not been dozens of large, standardized scientific studies on CES. Most of them are small studies done with different equipment and protocols.

The one thing that well over 100 studies have agreed upon is that there have been no adverse side effects. The overwhelming majority showed significant improvement for anxiety and depression.

The pills that people casually toss down do not have anywhere near as good a profile for safety or effectiveness.
 

Dippy

Moderator
That's good news.

I've just been investigating TENS machines, which (even) I realise are not exactly the same. I've also 'scoped my portable TENS. It chucks out 100V open circuit and appears only to be resistor/current limited. The more expensive ones appear to have current control. Some are assymetic wave and some simple PWM.
Mine seems to do either depnding on which part of my anatomy it is connected.
(I'm sure its a side-effect of an inverter/charge pump circuit , so lets give it a fancy name and look clever)

So, looks like you need a few more volts and current control in addition to limitng resistors. I'm not suggesting 100V btw as that would be stupid yet amusing. Can't yo hire one for a day, hire a cope and measure it?
Currently (no pun) it seems that no-one has a clue what the signal levels and control methods are (??)


PS. You PC experts. How do you stop your PC ignoring keystokes when typing into Iterne Text Boxes e.g. this and a thousand othe foums?? It's cking annoying.
 
Last edited:

BCJKiwi

Senior Member
"PS. You PC experts. How do you stop your PC ignoring keystokes when typing into Iterne Text Boxes e.g. this and a thousand othe foums?? It's cking annoying."

Interesting that you should raise this. I tried a while back to get some traction on this issue without success.

For me, I get intermittent issues with the Del or backspace not working after doing some editing in a message like this. Have found clicking the mouse in the editor panel livens up the keys again - go figure!
 

jwhooper

Senior Member
TENS devices, by design, use much greater current than CES devices. Most of the CES devices are battery powered and don't use much current. Why would I need more volts?

Back to something I actually know about, if your keyboard isn't working well, here are some tips:

If you are using a wireless keyboard ... don't.
If you are using a laptop ... attach a regular USB keyboard and use that.
If you have a cheap keyboard, spend a few more dollars and buy a good one.

If your keyboard isn't working well, just throw it away. I've been building computers for ten years. Trying to repair a keyboard is not a good use of time.

I have an HP multimedia keyboard -- works great, nice tactile feedback.
 

jwhooper

Senior Member
Can't yo hire one for a day, hire a cope and measure it?
Oh, I just finally figured out what you said here. That is a very good idea. I'm working on getting a scope right now, then I will try to get access to an Alpha Stim.
 

jwhooper

Senior Member
OK, I did a little research, and indeed IE7 does seem to be the culprit. Apparently it might have something to do with the password tracking and automatic completion features.

The only solution I have found so far is this one:

Go to Control Panel - Add/Remove Programs - select Windows Internet Explorer y and Uninstall (you will revert to IE6 then).
 

jwhooper

Senior Member
I know how I would like for it to work. I would like to output the 15 kHz as PWM. Then, I would like to split that output and put one part to the left, and one part to the right (for the left and right ear). Finally, I would like to allow one pulse (.5 or 100 Hz) to go to the left, and then one to the right in a mutually exclusive manner.

I can envision just setting the PWM once. Just 15 kHz output. One the split output, I could see setting a transistor on to allow the current on one side, while having another transistor off to not all current to the other. Hey, I could even use two more Picaxe output pins to turn them on and off.

If I could think of how to keep them synchronized, I would just use two picaxe08m chips. I have at least 5. In fact, this solution is starting to sound better and better. I don't even have to figure out how to split the outputs and all that mess.

While I am absolutely sure there is a simple and elegant solution, I only care about the end result. If I have to use a bazooka to kill a mosquito, that is fine by me.

Today I took out my worn Beginning Electronics book and tried to get a 555 chip to blink an LED. No luck.

Tomorrow, I'm going to try using two picaxe chips.
 

Mycroft2152

Senior Member
The simple and elegant solution is to use a second logic chip.

Sometimes, just becuase you have a micorprocessor, you over complicate things.

If you fed the one pwm signal into a couple of NAND gates or even 4066 Analog switches, and then use 2 other outputs on the PICAXE to turn on these gates at the appropriate times to feed each the the left and right, then you will have your simple and elegant solution.
 

jwhooper

Senior Member
OK, for my two chip design I burned these two programs:

picaxe8m #1
===
high 1
pause 50
low 1
main:
if pin3=1 then pulse
goto main

pulse:
'pmwout 2,66,133
high 2
pause 1000
low 2
high 1
pause 50
low 1
goto main


picaxe08m #2
===
main:
if pin3=1 then pulse
goto main

pulse:
'pmwout 2,66,133
high 2
pause 1000
low 2
high 1
pause 50
low 1
goto main

I commented out the pwm to make it easier to test.

Chip #1 was left in it's usual position on my common breadboard setup.

Chip #2 went beneath it, and I hooked up the power from the same supply.

As you might guess from looking at the code, I hooked up the Out1 of both chips to the In3 of the other chip. I have no idea how quickly the chips can read inputs, so I just gave them 50 ms, since it doesn't matter at .5 Hz.

This all works perfectly.

Naturally, before I go sticking something on my head, I like to do a little testing. I took the left output wire and right output wire, and tested the voltage. It bounced nicely from 5.0 to -5.0 volts.

Being the great electronics genius that I am, I went back to my book and revisted Ohm's Law. According to my calculations, I needed a 5k Ohm resistor to get my 1 mA. This worked when I was using two outputs from a single chip. It doesn't work now.

Now the amps sort of jump around, mostly hitting 1.5 mA and -1.5 mA, but going 1.8, 1.9, and occasionally over my 2 mA range. Because of this, I am not comfortable applying it to my brain just yet.

Why is the voltage stable while the amperage is not? Surely I've done something dumb.

I don't really know how to draw circuits, so I will just explain it:

The normal breadboard setup.

An extra picaxe08m, receiving power off of the same rails.

Each chip with a wire from Out1 to In3 of the other chip.

Each chip with a 5k Ohm on the Out2, and then a wire.
 
At such low current you can expect to have this jumping- 1ma is very little - try increasing resistor value or reduce tolerance of the resistor.
 

Dippy

Moderator
Maybe your DMM isn't being given enough time to 'settle'. Have you tried longer pauses?

I'm sorry, but I can't follow your 'current calcs'. Yeah, '5k' will give 1mA at 5V. But when it is connected to your head what then?
I= V/ (R + Rhead).
You'll never get 1mA going through your head at 5V.... maybe that's good thing. I mean that seriously as the thread so far indicates that maybe a little more 'reading-up' is required before tackling a thing like this.
Why not wire up a transformer back-to-front :) just kidding.

Stick a ohm-meter accross your ears (using medically approved conductive gel) and measure the DC resistance.


Suggest you have another revisit and get a 'scope. You'll never be able to check your 'final' circuit at 15kHz without one.
 

jwhooper

Senior Member
Oh, I see, the problem was my DMM range, which I had set at 2 mA. I set it to 200 mA and got a steady reading of +30.8/-30.8 -- hmmm, that isn't ideal. With my two picaxes I create some kind of parallel circuit I suppose. Time to up the resistors.
 

jwhooper

Senior Member
Well, instead of putting the resistor and then the output wire right next to the output pin on the same row of my breadboard, I bridged the resistor to another row and then put the output wire next to it. This makes all the difference, though I don't understand why.

Now I'm getting +/- 0.5 mA, which I think makes sense because I do have two 5k resistors in the circuit.
 

Dippy

Moderator
jw, with the greatest of respect, as:-
A) You haven't posted a schematic
B) No-one can see your breadboard
C) No-one can tell if your breadoard resembles your schematic

then people really can't help you.

Where did you get the 5k resistors from? Have you checked them? Have you connected them in correctly?

You ought to check and dubble-check before posting as it sounds like you're doing things at random with inadequate measuring devices.

Electricity doesn't ignore resistors.... if you stick them in correctly.
Good luck.
 

hippy

Ex-Staff (retired)
I know how I would like for it to work. I would like to output the 15 kHz as PWM. Then, I would like to split that output and put one part to the left, and one part to the right (for the left and right ear). Finally, I would like to allow one pulse (.5 or 100 Hz) to go to the left, and then one to the right in a mutually exclusive manner ...

While I am absolutely sure there is a simple and elegant solution, I only care about the end result. If I have to use a bazooka to kill a mosquito, that is fine by me ...

Tomorrow, I'm going to try using two picaxe chips.
You certainly have commendable enthusiasm and I am half expecting to soon hear, "I've found a source for an infinite number of monkeys and the typewriters arrive next Wednesday" :)

The two PICAXE solution isn't very good because, although they can be synchronised, they won't be absolutely synchronised, and it will be worse still with each running their own 15kHz PWM.

Everything you want to do described here can be done with a single 08M, that 74HC14 and a few more diodes and resistors, but how much more of the spec is going to change in the next few postings ?

I'm really not trying to be discouraging, but engineering is a discipline and things usually work much better when having well defined goals to work to, and a good design to build on.
 

BCJKiwi

Senior Member
"Well, instead of putting the resistor and then the output wire right next to the output pin on the same row of my breadboard, I bridged the resistor to another row and then put the output wire next to it. This makes all the difference, though I don't understand why."

If you place the breadboard with it's central long groove left to right in front of you, like this http://www.holtsoft.com/turing/resources/engineering/Appendices/Breadboard%20Basics.pdf, then the power rails (top and bottom in the pic) have all their pinholes interconnected - call these rows.
The columns of 5 holes above and below the central long groove are interconnected vertically but not interconnected horizontally.

So If I understand your description above, the resistor would have had both ends in the same interconnected column of 5 holes effectively shorting it out.
By moving it to a horizontal layout then it is no longer shorted.

Please ignore if you already understand this and I have misunderstood your description.
 
Last edited:

jwhooper

Senior Member
BCJ, thank you for the information. That is exactly what happened, and no, I hadn't figured it out, but now I understand.

Without a scope to check it out, I'm pretty well stuck now.

I'm not sure how much of a scope my feeble skills would warrent ... maybe a vibrating soup can with a firefly inside. I might spend a few hundred dollars on a USB scope, but then people say they are no good.

Hippy, I am striving mightily to understand the schematic you gave me. It is truly embarrassing how many hours I have studied and how many electronics books I have read over and over. Nobody ever seems to explain why. Why a diode here? Why a resistor there? The books just give formulas and test circuits. They use different analogies. They say flow, current, hole flow, electron flow, each going in different directions. I've heard that a diode cuts an AC wave in half, that it stop DC and lets AC go through. You are using them and I don't know why. Why are they there? Why are there always so many resistors?

No, I wish it were that I simply needed to study. I read Wikis for everything, to no avail.
 

Dippy

Moderator
Don't you have a technology teacher at school to explain these things?

You really ought to put this project onto the back burner until you've learnt the basics.

Sure people here can now write pages and pages doing analogies with water flow, but it sounds like you need one-to-one with a teacher/lecturer.

And sure people here might write pages and pages tutoring you in where/how/why to use resistors/diodes etc. but it sounds like it needs someone to go through things on a step-by-step basis.

And sure Stan can tell you how to wire up a breadboard, complete with his pictures :)

If it's a case of teach yourself then this is where basic BOOKS are better than Internet/search.

And, with your project, yes it can all be done on a single 08M with supplementary components as hippy says plus a few more components as I says. But as you don't currently (no pun) understand it then you'll learn nothing.

Start off small. Tell me; do you need a resistor in series with an LED?
 

hippy

Ex-Staff (retired)
I think it's really just a case of not having grasped the basics and more reading isn't turning the light on, and I agree with Dippy, the best thing would be just a chat with someone who can lead you through it and help illuminate the dark - and that's something a teacher should be good for as that's their stock trade.

One of the things you'll find is that once you have a good grasp of the basics everything else just cascades from that. Diodes in digital circuits are usually used as OR gates - this is where those water-flow analogies come into play - they let current through one way but stop it going the other, they can either provide current or not.

A normal OR gate would have two diodes ( and a pull-down R ), but in the diagram I gave the R it joins to allows the diode to override the output of the gate it OR's with without damaging that gate's output.

I don't know about anyone else, but I learned my basic AND and OR logic from batteries, switches in parallel and series, and a bulb. The "Ladybird Book of Electronics" was what taught me most ( it's not that, it's from another publisher but it frequently gets mislabelled - I cannot recall it's real title ), explaining how a transistor inverted, and, as the real world was using Diode-Transistor Logic it showed how diodes and transistors are the basic building blocks for everything digital. The actual implementations may be different these days but the principles still the same and Diode-Transistor Logic is still very easy to build by hand, inverters like the 74HC14 being a blackbox replacement for a transistor.

One thing I've learned is never be afraid of reading books which are targeted at people below your own age. Microsoft now produce a couple of books for "bright kids", which as it turns out are also great for "old duffers" :)

http://msdn2.microsoft.com/en-us/beginner/bb308754.aspx
 

premelec

Senior Member
OK Hippy I started learning logic with electromechanical relays and switches - this MS site you reference looks to be for software rather than hardware - have you a good site for the hardware issues? I think there was one on this forum earlier - and this fellow seems to need some hardware excercise....

We've all proved that a 1/2 watt resistor can't work well for long at 10 watts so empiricism is part of the learning and recognising the smell of the overheated compnent before overt smoke materialises saves some of them!

Anyhow I agree teachers and mentors are essential as is asking when you need to which this forum helps with...

Thanks to all of you for having the time and interest to assist me and others in their learning process...
 
Top