Using AMS1117 3.3v Buck Module on a Serial port

Is it possible to use an AMS1117 Fixed 3.3v Buck Module to reduce the 5v serial signal (TX pin 18) on a Mega 2560 to 3.3v ? I am going into an HC-05 BTmodule, but the data being transferred is not correct. I have been using a 10K pot tuned to 3.3v, so I know the circuitry is okay, I just don't get the correct data values.

Shikues-AMS1117-1-2_C475600.pdf

If this is the wrong component, suggestions on a better solution would be appreciated. Thanks

I don't understand what you need to do. As far as I know, the HC-05 is a 5V module.

First of all that is a linear regulator not a buck-converter, but no ! it is a voltage regulator not a level shifter, and the response will be way to slow it is meant to provide a constant 3.3v output from a higher input voltage. Not convert transients.
The simplest way is to just use a voltage divider.

I think something like is maybe what is needed:

I would go for TX -> RX not TX -> TX

The device itself is 3.3v, but it says you can power it with 5v. However, the TX/RX signals must be 3.3v and that is what I am trying to fix.

Yes, it is TX->RX, RX-TX. Like I said, this works using the pot.

i assume that you are using the pot as a voltage divider, but in that case i would just use resistors to reduce the 5v Tx to 3.3v for the 3.3v Rx. For the other direction you don't have to do anything.

They are just signal names. I believe the circuit is bi-directional.

The answer to the question is implicit in the question.
The cited device is a regulator.
The needed device is a level shifter.
You don't use a regulator for level shifting. You use it for power supply voltages.
Use a level shifter like the one suggested or some other level shifter.
The question equates to "Can I use an orange to replace an apple ?"

Okay, so the Buck is a voltage regulator vs a level shifter. I just read a level shifter is used to "translate signals from one logic level or voltage domain to another", but being a software guy, I am not sure I understand what "translate" means in this situation. Can someone educate me on what the actual difference is so I don't make this mistake again ?
Thanks

Yeah, sure.
"TRANSLATE" (in electronics terminology) means CONVERT.
So you have an output that is voltage A but the device receiving the signal take inputs
that are voltage B. You need to get from A to B. The only way you can do that is with
a LEVEL SHIFTER (which, as you might imagine , SHIFTS UP OR DOWN, kind of like what
you do with the gears in your PORCHE but with voltage levels.)
One might wonder why a S/W guy is messing with electronics without learning electronics.

Thanks. And as for a software guy messing with electronics :zipper_mouth_face:

I suppose you can learn by trial and error...

Ummm. Nope!

Which circuit?

The one you cited is indeed bidirectional, which is unnecessary in this situation and thus, inappropriate - adding components that serve no purpose.

To derive a 3.3 V level from 5 V, a very practical way is to use a diode with cathode to the 5 V source and anode to the 3.3 V input, with a pull-up on that input to 3.3 V. If you are concerned about getting the 3.3 V LOW as low as possible, use a Schottky diode. Point is, you do not need to be concerned about exact resistor values and there is no problem if the 3.3 V device is not powered.

(Actually, just like the above circuit without R2 and only the diode part of Q1. :grin:)

When I connect to a HC-06 or HC-05, I use a simple voltage divider on the RX input to the module.
Never failed me yet.

But... I have also connected them directly before and had no issues.

Rarely is there a situation like this where there is only one solution. many ways to skin a cat :wink:

I actually changed my potentiometers to simple voltage dividers and it worked fine. When I first tried to do it that way I couldn't get it to work, so I was just looking for something that I now know is a "logic level converter". And now that I kind of understand voltage regulation vs voltage level conversion, I see why the Buck module did not work.
And yes, I am very good at learning by trial and error. Sometimes buy components on Amazon that sound interesting and use T&E to figure out how they work. Keeps me entertained, which makes my wife happy.
Thanks to everyone for their help.

When I was a restaurant line cook back in '79 and decided that I wanted to switch to electronics
I couldn't afford to go to school so I had to teach myself at night after work by building circuits.
I worked nights so my shift started between 4 pm and 6 pm depending on the day so I would
get home late and build circuits and read electronics cookbooks till sunup and go to sleep.
This method only works if you have access to an electronics store to obtain parts. (no internet
back then) so I browsed electronics stores in the day for parts and built circuits at night. I
remember browsing one day and seeing a post-it note on the cash register (LM307H Metal Can
High Performance Op Amps, Normally $3.95/EACH, On Sale $0.25/EACH. I remembered seeing
lots of book about Op Amps in the book section of the store (one in particular caught my eye:
The Op Amp Cookbook by Walter Jung ) so when I
saw the note I asked the clerk "How many of these Op Amps do you have", to which he replied:
"How many do you need ?", to which I replied "How many do you have ?" . He gave me a funny
look and then asked "You mean 'in the WHOLE store ?" and I said "Yes. In the WHOLE store."
He checked the computer (No PCs back then so it was probably a CPM business computer) and
replied "166". I said "I'll take 'em". He said "How many ?" ,"I said ALL OF THEM". He gave me an
even stranger look and asked "What are you going to do with 166 Op Amps ?" to which I replied
with hesitation "Well first of all, I don't even know what an Op Amp is, but you have a ton of
books on them so I'm sure I won't have any trouble figuring out what to do with them." . He
just shook his head and bagged them up and handed them to me. I gave $41.50+tax and went
over to the book shelf and grabbed that book I mentioned. Twenty years later I gave the last
66 op amps to a Stanford EE student. I had used 100. Built everything you can think of that
uses them. That experience got me an Electronics Engineering Tech job my second or third year in electronics. Eventually I went back to college in '92 and got a BSEET from DeVry (43 at the time).
That degree got me most of the rest of my jobs, including my current one. Yes, I'm 72 and still
working full time through the pandemic making more than I ever have before. So I know a
thing or two about trial and error. "Good decisions come from experience. Experience comes
from making bad decisions..."
(and yes I have Don Lancaster's TTL COOKBOOK)

That is a GREAT story. My story is good, but yours is better. Been a computer guy since 1967, and a software engineer since '74. Retired 3 years ago at 70, needed a hobby and decided to get into Arduino. Love It ! Makes me think and learn new things at the same time. And I probably understand why you are still working. Has to do with loving what you do. I only stopped because I got laid off, for the 7th time, and decided I'd had enough. So keep plugging and take care.