PicAxe controlled voltage output required

Simmicht

Senior Member
I need to stun a fish ... ok, let me back up a bit, I have a request from a PHD student who is working with Zebra fish and he needs to provide a stimulation voltage to make the fish do something sciencey ...

Anyway the Picaxe stuff is easy, but what I can not think of is a neat way to provide a voltage that is set by the Picaxe and in the range of 0 to 9V.

I thought I could use a LM317 regulator, but the resistor value needs to be selectable, or under Picaxe control. I thought I could use a digital Potentiometer to set the output voltage of the LM317, but I have not seen one of these for years.

A resistor divider, I think will not provide fine enough control, though I guess with good design I could use all 8 bits of Port B on a 28X2 to provide a 8-bit resolution voltage from 0 to 9V, that would be 9/256 = 40mV each step...hmmmm maybe.


Any ideas guys? Any off the shelf widgets?

I will probably switch the final voltage to the probes via a relay.

Cheers and thanks
 

Grogster

Senior Member
If all you need to do is vary the voltage between 0v and 9v, I would just use a simple 548 + BD139 or 2055 power transistor in a darlington arrangement in series with the power supply, and vary the output voltage between about 0.6v and 9v with a pot on the base of the 548.

If you wanted accuracy, you could have course and fine pots.

No need to use PICAXE at all for something like that, IF that is what you are trying to do...

If you HAVE to use a PICAXE, then the first thing that comes to mind is PWMOUT driving diode-pump(charge pump) which then has a smoothing cap on the final output - others here will no doubt have some other ideas. :)
http://en.wikipedia.org/wiki/Charge_pump

These are only good for relatively low current - how much juice does he need to zap the fish with?

EDIT: Put up wrong link - fixed.
 
Last edited:

Grogster

Senior Member
ANOTHER THOUGHT: Use PWMOUT to control a pass transistor, which is connected to a 9v supply - that would be dead easy, I would think. You still need a 5v supply for the PICAXE, but both could run from the same supply easy as pie. You have a 9v supply(or whatever), and a 5v regulator such as an 78L05 and associated caps to provide a 5v rail for the PICAXE, but it's output will effect the pass-transistor output voltage would could be right up to supply rail less about 0.6v...
 

BeanieBots

Moderator
Grogster's suggestion in post #2 of a diode pump was my first thought.
You'd get 10-bit control and a well designed doubler would only need a single stage to get close to 10v output.

If you do need to pull a few mA, then you'll need two stages but that would limit the max current to under 5mA.
 

papaof2

Senior Member
My off-the-cuff guess is that the voltage is more important than the current Considering how little current is fatal to a human, the current needed here is probably in the microamp range.

If the tests are being done in a glass fish tank - a reasonable assumption, as you want to see the results of the experiment - the resistance of the water might be of interest. Zebrafish are typically freshwater creatures, so the resistance of the water itself isn't a major factor but the pollutants (uneaten food, fecal matter, etc) might be.

Will the fish under test be confined in some manner with electrodes attached to its body or will it be swimming between charged plates/grids? Electrodes attached directly to the body would require minimal voltage/current from the excitation source, but plates/grids would require more more voltage to get the same potential per unit of surface area and would require higher current because of the lower resistance (a grid needs more than direct electrodes, a plate needs more than a grid).

The usual response is to ask for more information about how the PICAXE will be applied and I think a modified version is appropriate here. How will the voltages be applied to the fish?

John
 

hippy

Ex-Staff (retired)
My off-the-cuff guess is that the voltage is more important than the current Considering how little current is fatal to a human, the current needed here is probably in the microamp range.
Though such currents are only fatal to humans if applied in the right way, though perhaps that should be "wrong way" ;-)

We've all probably done the 'tongue test' on a PP3 and lived to tell the tale and even throwing a powered toaster into a bath isn't necessarily fatal though our advice will be to never try that.

As you say, more information is required.
 

fernando_g

Senior Member
I second the motion about a voltage-doubler charge pump...
In the past, I built several using the 555, to a 08M it should be a piece of cake.

For the rectifiers, us schotky diodes to get the output voltage as close as possible to twice the input voltage.
 

Simmicht

Senior Member
I shall ask more questions. The fish is really only stimulated by the voltage, and the time taken to respond is measured via a high speed camera. As the fish in under the microscope, literally, there is less than 10ml of water/agar involved. Petri dishes are small. Electrodes will be up close and personal... but not in the fish.

The main requirement is that the voltage is selectable, controlled by the Picaxe, as in the Picaxe will receive a command from the computer via serial port to say, produce 5V fro 2mS, or 6.9V for 1mS. The voltage and time are determined by the researcher...

I am going to try the MAX5312 chip See datasheet
This has a SPI interface, and can produce any voltage from 10V down to 0V with 12 bit resolution.
Thanks for the ideas.
 

Simmicht

Senior Member
The fish is unharmed, and the main reason the voltage is adjustable, so it can be ramped up to the point where the response required is achieved but no damage occurs, after all, no point frying the fish after all the months of breeding to get the perfect specimen ...

And have we not all played with DC shocks, or is that just me ... :-0
 

Grogster

Senior Member
And have we not all played with DC shocks, or is that just me ...
Well, maybe not with DC, but I do remember playing with a tape deck in my youth - I put 12v AC onto the PCB, which was connected to the secondary of the power transformer, but left the mains switch on.

This turned the power transformer into a beautiful little inverter, then I touched the power plug by accident.

A very serious lesson...
 

hippy

Ex-Staff (retired)
Playing with chunky mains power line filters for my Hi-Fi ( dual cylinders about 7" long and 1" diameter ), I had the mains unplugged and then banged my bare toe into Live and Neutral of the plug. Didn't do that a second time.
 

AndyGadget

Senior Member
Playing with chunky mains power line filters for my Hi-Fi ( dual cylinders about 7" long and 1" diameter ), I had the mains unplugged and then banged my bare toe into Live and Neutral of the plug. Didn't do that a second time.
I think most of us have had experiences like that which are a one-shot lesson to treat electricity with respect.
Mine was back at school when I used to do the stage lighting. We'd found a very old valve driven resistance meter under the stage, plugged it in and it was 'Me first! Me first!' to check my resistance. I took a probe in each hand and WHOMP! Lesson learned.

Andy.
 

Jaguarjoe

Senior Member
Worst for me happened at an early age too. I was disconnecting the HV clip from the side of a television CRT. I thought the CRT was discharged, but it wasn't. When I got bit, I quickly jerked my arm out of the chassis by natural reaction. It scraped against a corner of the HV cage on the way out and ripped my arm to shreds. I learned about HV and capacitors all in one painful lesson.
 

BeanieBots

Moderator
Most voltage generators (no matter what method used) take quite a while to settle. Certainly in the order of 10's of mS.
If you are after timings in the order of 1mS, I would suggest using whatever method you decide upon to generate it and feed it into a failrly large cap (~470uF) and then switch it on/off using a reed relay using pulsout.
 
Top