Controlling a 3v device from a 5v output.

steliosm

Senior Member
Hello all.

I have a small project I'm working on these days. The idea is to combine a automated aquarium feed system with a PicAxe.

The PicAxe will have it's normal 5v power from a regulated power supply. The feeding devices uses 3v from 2 AA batteries which turns on a motor every 12hours. What I would like to do is to turn on and off the device using a PicAxe pin. I don't want to have to put batteries to the device and use a relay to turn it on of off.

I tried using a voltage divider to drop the voltage at 2.5v but it didn't work. Any change I can place a resistor in series with the device for the rest of the volts (5-3=2) that the device doesn't need? Would that work?

Thanks
 

kevrus

New Member
you could use an LM317 adjustable voltage regulator on the output to drop the voltage to 3v. If I remember correctly, they only require two external resistors to set the output voltage and is available in a small TO92 style case which would easily handle the 20mA max output current from a picaxe. Larger current rated LM317s are available if required as are LM337s whichdoes the same job but on the negative line.
 

steliosm

Senior Member
Intreresting... the LM317 can handle up to 1.5Amps.

As for the resistor in serial would it work? My electronics background just doesn't exists...
 

womai

Senior Member
Several methods are possible. Assuming(!) that your 3V device inputs have high input resistance, i.e. source/sink only negligible current, the two easiest are:

(1) divider: use a 3:5 voltage divider, e.g. 680 Ohm on top of 1 kOhm, Picaxe is driving the top of the divider, 3V reveiver is hooked up to center of divider.

Picaxe output - 680 Ohm -x- 1 kOhm - Ground
Receiver connects to -x-

(2) level shifter: use a 2V zener diode (pointy end towards Picaxe output) in series with a 1 kOhm resistor - this time Picaxe is driving the top of the diode, 3V reveiver is hooked up to the connection between Zener diode and resistor. I.e.

Picaxe output - Zener diode -x- 1 kOhm resistor - Ground
Receiver connects to -x-

If the receiver does draw significant current, you can either reduce the resistance values above (up to maximum 20mA current draw from the Picaxe output), or keep the same setup ((1) or (2)) and buffer it with a voltage follower - simple op-amp, -x- hooked up to the "+" input, output connected to the "-" input as well as to the receiver. Use a rail-to-rail op-amp like e.g Maxim MAX492.

Alternatively, run the Picaxe from the same 3V that the controller is running off. I have been doing this in many projects (actually 3.3V, because I am using 3.3V PECL devices) successfully. The only issue I encountered so far was that the 28X1 Picaxes have a problem writing to the internal EEPROM reliably at that voltage. Also the margins for serial connections to the PC are reduced but so far that never cause any issues for me.


By the way, just using a single resistor usually WILL NOT WORK. The resistor will only limit current but not voltage. If the receiver has high impedance then it will get the full 5V. It is possible that it has internal ESD clamping diodes that cut off any excess voltage (that's the trick the Picaxe uses for its serial receive from the PC, and it's the reason for the 22 KOhm resistor in the download circuit). Also, if the receiver does draw current then you'll get a voltage drop across the resistor, but you'd have to play around to find the right resistance and it will not be a very reliable design.

Wolfgang
 
Last edited:

hippy

Technical Support
Staff member
And another solution to add to Wolfgang's list .... use a non-inverting ( or two inverting in series ) 74HCxx gates powered at 3V driven from the PICAXE through an R ( can usually be quite large, 22K+ ).
 

BCJKiwi

Senior Member
If your feeders can tolerate 3.3V then you could use one of the '3pin' regulators with a 4th on/off pin like the Sharp PQ3RD23.

Then you could use the PICAXE to turn the regulator on/off as required which will then deliver the 3.3V. The on/off pin switches on at 2.0V and off at 0.8V and will handle up to 20V - more than enough for the 5V picaxe output. Current draw on the Picaxe is micro Amps
 

sghioto

Senior Member
Can probably isolate the "feeding device" with a transistor or mosfet, but will need to see the specs on the "feeding device" or a wiring layout. You say you have a 3 volt motor running on two batteries, but how is the motor turned on and off ? If you can explain this then I can help you.

Steve G.
 

steliosm

Senior Member
Thank you all for your replies and analysis on the resistor issue.
The second part of the project is the wireless receiver that the PicAxe will be connected to in order to receive 'feed orders' from the pc. The receiver needs 5v to operate, so I will have to have 5v rail on the board.

As for the resistor in series I was thinking the way LEDs work, by using ~1.6V and dropping the rest of the voltage to the resistor.

Actually, I ended up having a dump automatic feeder that feeds the fish every 12 hours and I wanted to make is a bit more clever by using a PicAxe and a pairs of wireless modules. I can then write a small daemon program to transmit data from the pc at predefined times of day.

The LM sees like the way to go, since I will need several mAmps to make the cheap DC motor turn.
 

ljg

New Member
Another solution is to chain a series of diodes between the devices.
Each Diode will drop the voltage .6-.7v

Three diodes in series should do it.
 

moxhamj

New Member
If you have a 5V regulator anyway for the picaxe (7805, not 78L05) and the motor draw is only a few hundred ma then I'd go with Larry's idea. Use 3 4001 diodes to drop 1.8V to the high side of the motor and drive the low side with a BC337 driven via 1k on the base. That is <50c worth of components. Maybe run the picaxe via a 10R and 470uF cap which will act as a low pass filter and keep interference from the motor at bay.

Or if you want to use the batteries to power the motor, BC337 and 1k to the base.
 

andrew_qld

Senior Member
Are you trying to drive the motor direct from the Picaxe? You have to use a transistor, relay, or FET to switch power to the motor as the picaxe can't provide enough current.
 
Top