John Public
Posts: 90
Joined: Thu Jan 16, 2014 2:16 pm

step-up regulator, buck converter 5V->3.3V

Tue Jun 20, 2017 4:56 pm

I have an RF transmitter and a receiver https://goo.gl/ymf1ca. Their operating voltage is 3.5V-12V and transmit power: 10mW.
I uppply them 3.3V and got them to work on Raspberry GPIO. I'd like to test them using 5V. Since RPi 3 GPIO uses 3.3V how do I step down voltage?
I don't know if down conversion will affect affect transmit speed. I am bit banging at 500 microseconds

User avatar
davidcoton
Posts: 5861
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: step-up regulator, buck converter 5V->3.3V

Tue Jun 20, 2017 5:15 pm

It depends if the logic levels from the receiver and to the transmitter are fixed, or follow the supply voltage. Most likely the latter. On receive it's easy -- just use two resistors as a voltage divider for 5V in, 3V3 out. Try 3K3 and 1K8.
The transmitter is a little harder. It might "just work" with a 3V3 GPIO signal (use a 1K series resistor for a little protection from wiring errors). If not, you will need a single transistor circuit to shift 3V3 up to 5V.
The voltage conversion should have no effect on the maximum transmit data rate.
Location: 345th cell on the right of the 210th row of L2 cache

John Public
Posts: 90
Joined: Thu Jan 16, 2014 2:16 pm

Re: step-up regulator, buck converter 5V->3.3V

Tue Jun 20, 2017 7:54 pm

How did you come up with the receiver (3.3 kOhm + 1.8kOhm) to get 5v down to 3.3V.
I tried an online calculator http://www.gtsparkplugs.com/Dropping_Resistor_Calc.html
Just trying to learn something useful.

Actually I got the Receiver and Transmitter work on the same Raspberry using just the 3.3V (although both are rated to work with 3.5V-12V) . When I tried the transmitter on Orange Pi I could not get it to send on 3.3V

User avatar
davidcoton
Posts: 5861
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: step-up regulator, buck converter 5V->3.3V

Tue Jun 20, 2017 9:30 pm

John Public wrote:How did you come up with the receiver (3.3 kOhm + 1.8kOhm) to get 5v down to 3.3V.
3.3+1.8=5.1 (near enough 5), so 5V across the two resistors in series will leave 3.3 V (slightly less) across the 3.3K resistor. As long as you connect them correctly, job done.
To make sense of that, remember the GPIO input current is negligible, all the current through one resistor also goes through the other, so the voltage across each resistor is proportional to its resistance. The resistance ratio is equal to the required voltage ratio.

As to why I suggest resistors in the range 1K to 10K, that combo gives enough current to swamp the GPIO input current, but not enough to overload the receiver output. Rule of thumb, from experience. To be rigorous the receiver output characteristics and GPIO input characteristics need to be determined and the entire subsystem analysed. Life is too short for that, and the chances of the guesstimate being wrong enough to cause problems is extremely small.
Location: 345th cell on the right of the 210th row of L2 cache

btidey
Posts: 1639
Joined: Sun Feb 17, 2013 6:51 pm

Re: step-up regulator, buck converter 5V->3.3V

Wed Jun 21, 2017 8:46 am

Most of the simple transmitters use a simple transistor oscillator with a transistor switching the supply current to it to turn it on and off.

The switch is a common emitter with a limiting resistor to determine the base current. So the input on/off level is just what is needed to turn this transistor on hard enough. Note that it is pointless and counterproductive to put an extra limiting resistor in the input.

The 3.3V logic level from the Pi is normally enough if the TX is powered from 3.3V or 5V. However, one can significantly increase the transmit power and range by using higher TX voltages up to 12V.

The problem then is that the oscillator current increases with the TX supply voltage (more power) and the base limiting resistor used (typically 18K) can then mean there is insufficient base current to turn the switch hard on. A simple solution is to either replace the base resistor (or wire another in parallel) to increase the base current when using the 3.3V logic levels. I replace mine with a 4.7K resistor and get reliable operation at 12V TX power and 3.3V logic input.

User avatar
davidcoton
Posts: 5861
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: step-up regulator, buck converter 5V->3.3V

Wed Jun 21, 2017 11:13 am

btidey wrote: Note that it is pointless and counterproductive to put an extra limiting resistor in the input.
It is not pointless, it significantly increases the protection of the Pi's GPIO output in the case of a wiring error. 1K in series with 18K will not make a significant difference unless the design is altready marginal*


* It isn't. In the worst case, 3V3 switching a higher voltage for the transmitter. Assume a transistor gain of 100, base resistor of 20K at 3V3 allows about 15mA transmitter current. No problem unless transmitter input power exceeds 180mW. The rather vague spec says 4mA and 10mW.
Location: 345th cell on the right of the 210th row of L2 cache

btidey
Posts: 1639
Joined: Sun Feb 17, 2013 6:51 pm

Re: step-up regulator, buck converter 5V->3.3V

Wed Jun 21, 2017 8:42 pm

davidcoton wrote:
btidey wrote: Note that it is pointless and counterproductive to put an extra limiting resistor in the input.
It is not pointless, it significantly increases the protection of the Pi's GPIO output in the case of a wiring error. 1K in series with 18K will not make a significant difference unless the design is altready marginal*


* It isn't. In the worst case, 3V3 switching a higher voltage for the transmitter. Assume a transistor gain of 100, base resistor of 20K at 3V3 allows about 15mA transmitter current. No problem unless transmitter input power exceeds 180mW. The rather vague spec says 4mA and 10mW.
Wiring errors can always put things at risk including mis-wiring a series resistor from a GPIO pin. A series resistor might be an additional safeguard during bread-boarding and fiddling with wiring.

The transmit supply current I have for the simple modules I use is
3V 13mA
5V 25mA
9V 49mA
12V 55mA

That matches what I see when I measure it.

The base current with 3.3V logic and 18k and gain 100 is already marginal at 3.3V although in practice the gain is 100-400 for the typical switch transistor used. Plus it is normally good practice to overdrive a switching transistor by about 4x the nominal base current to ensure it is well saturated. For operation at 12V my suggested 4.7k may be a bit on the high side for a conservative design; 2.2K might be a better choice and still a modest load on a GPIO pin.

User avatar
davidcoton
Posts: 5861
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: step-up regulator, buck converter 5V->3.3V

Wed Jun 21, 2017 10:24 pm

btidey wrote: The transmit supply current I have for the simple modules I use is
3V 13mA
5V 25mA
9V 49mA
12V 55mA

That matches what I see when I measure it.
That does not, in any way, match the spec given. The spec may be wrong, in which case I would look for another supplier. If there is any truth in the spec (and it is not clear exactly what the spec means, so we can't be certain) then the higher base resistor is OK.
Suck it and see, I guess. Experiment and measure. Start with the higher base resistance and reduce it if necessary.

We are of course assuming something as yet unproven about the circuit for this transmitter. It would be as well to check that the transmiiter, when supplied from 5V but before connecting to the Pi, does not put 5V back on the input pin -- if it does a transistor will be required to shift the Pi's 3V3 to 5V.
Location: 345th cell on the right of the 210th row of L2 cache

btidey
Posts: 1639
Joined: Sun Feb 17, 2013 6:51 pm

Re: step-up regulator, buck converter 5V->3.3V

Thu Jun 22, 2017 9:48 am

davidcoton wrote:
btidey wrote: The transmit supply current I have for the simple modules I use is
3V 13mA
5V 25mA
9V 49mA
12V 55mA

That matches what I see when I measure it.
That does not, in any way, match the spec given. The spec may be wrong, in which case I would look for another supplier. If there is any truth in the spec (and it is not clear exactly what the spec means, so we can't be certain) then the higher base resistor is OK.
Suck it and see, I guess. Experiment and measure. Start with the higher base resistance and reduce it if necessary.
The transmit modules come in various flavours. The numbers I quoted were from a spec for TX01 units which are the 2 transistor type which I think match the picture given in the first post. I have a number of this type and measurements with TX on at 12V give supply currents 30 - 45mA, a little less than spec but in the same ballpark. They would not work reliably for me with 12V supply and 3.3V logic with the base resistor as supplied. Reducing it fixed the issue.

There are other simple transmitters which are based on an ic (F113) instead of transistors and these are only intended to be used at lower supply voltages (<5V). I have some of these and current consumption at 5V measures at 10mA (spec 12.5mA). These have a high impedance logic input so driving base current is not an issue. They are pretty good but power out is maybe 6db less than a 12V version so less range.

John Public
Posts: 90
Joined: Thu Jan 16, 2014 2:16 pm

Re: step-up regulator, buck converter 5V->3.3V

Sun Jul 09, 2017 9:43 am

Just to recap: I used an inexpensive pair of 433MHZ sender & receiver (http://bit.ly/2sCDikI). I connected both to a single Raspberry (RPi3) and used two GPIO pins. One gpio would send and the other would receive. It worked reasonably well - not too much noise.

However, when I plugged the same sender RF module to an Arduino I would get nothing on the receiver at RPi. I also tried an Orange Pi as a sender but I still get nothing on the receiver at RPi. Just to be sure that I had not broken anyhing I re-connected the sender back to RPi and all worked as before.

Why can't I use another SBC to send to RPi? Thinking that the sender/receiver are rated for 3.5V-5V and RPi GPIO uses 3.3V I though perhaps that is the cause. So I bough a superhet sender and receiver (http://bit.ly/2tVZw4Y) which are rated at 2.0V-3.6V and 3.0V-5.0V. Unfortunately when I connect the receiver (using RPi's 3.3V) I get a constant stream of noise even though I haven't connected the sender yet.

OK, not to be let down I've bought a couple of step-up and step down converters (http://bit.ly/2tCFgme). I've connected the step-down converter to RPi 5V and setting the rotary dial to receive 3.2V (teh best I could, the dial is a bit finicky). My next test plan is to supply the original RF sender and receiver with 5V and step-down it's data pin to 3.2V so that RPi's GPIO does not break. I am thinking I get better signal or less noise with 5V (am I on the right track?). My question is this: I don't know how much amps are coming down this way (ie. am I safe and within RPi tolerance)?

I've posted a number of questions and will take advice in general. I've seen a number of tutorial but unfortunately they are not that helpful since I am trying to send small packets of data using RF. On the code side I supply my own and do not want to use other packages (they are too hard to follow and way complicated for my project).

btidey
Posts: 1639
Joined: Sun Feb 17, 2013 6:51 pm

Re: step-up regulator, buck converter 5V->3.3V

Sun Jul 09, 2017 11:10 am

Receivers whether they are simple regenerative or superhet will always generate noise o/p even when there is no signal being transmitted. That is because they have automatic gain control so that they step up the gain in the absence of real signal and are then detecting ambient noise. As soon as they start to receive a real signal the gain will drop and you get a clean signal.

You do need to have antennas on the rx and tx units, either coiled spring type or 17cm straight wire. Without those the range will be very limited and the superhet type which normally come with a screened can enclosure will see no signal at all.

As you are using your own protocol. It is probably good to start with a test signal of just a burst square wave, say 20 cycles of 1msec on 1 msec off followed by 40msec off and repeat the whole cycle. This should be easy to detect and ensure your basic transmission is Ok. Typically you should n't be using pulse widths less than 250uSec in your real protocol.

John Public
Posts: 90
Joined: Thu Jan 16, 2014 2:16 pm

Re: step-up regulator, buck converter 5V->3.3V

Sun Jul 09, 2017 11:54 am

When I used the "regular" receiver that noise was far less, an occasional beep evry 10 secs or so. The superhet on other hand is just a constant stream of noise, ups and downs.
What about the amperage from a step down?

btidey
Posts: 1639
Joined: Sun Feb 17, 2013 6:51 pm

Re: step-up regulator, buck converter 5V->3.3V

Mon Jul 10, 2017 9:33 am

Noise is not the problem. Getting random ups and downs with no transmission is an indication the rx is doing its job. Once a transmission starts then receiver gain turns down and you get a clean signal.

I don't think converters or level shifters are your problem. I use these devices attached to Pi or other controllers without issues. The TX can be powered to start with from +5V and switched on and off with the GPIO signal directly. When you want more power and range then one can use higher supply voltages on the TX but 5V is fine for bench testing with rx and tx fairly close. The superhet receivers normally work fine from the 3.3V supply and data can go straight in to GPIO. The regenerative receivers are normally happier run from +5V and then one should tap the output down from +5V to 3.3V through say a 2.2K / 3.3K divider into the GPIO.

As I said you must have antennas on these things to get any sensible results.

Return to “General discussion”