Control 3.3v switch using GPIO

Hi,

I have an FM receiver (EN803) module that works with 3.3V. I wanted to control the volume and seek pins using an Arduino Uno R3. Please see the image below. I want to replace the physical buttons with an Arduino Uno R3 GPIO. I can think of 2 ways to achieve this.

  1. Use a logic level shifter to the GPIO pins and use logic HIGH/LOW (digital output) and HIGH-Z (make digital pin to input).
  2. Use an NPN transistor with 3.3V Collector, 5V GPIO Base. (will it work?)

    Please suggest a better way to implement this. I can only use Arduino UNO R3 for some reason.

Thanks for the picture but lots is missing.
Words are not the way to tell.
Where's the trasistor You mention? Were are the level shifters?
Please creat real schematics. Pen and paper usually works well.

It’s an interesting circuit…
The VOL and SEEK inputs are tri-state (floating at ~Vcc/2)

The inputs need to be ‘pulled high or low to effect the desired input condition,

Almost a simple voltage divider.
There will be some neutral margin around vcc/2 where nothing happens

The 10K are there to limit the short circuit current if Up and Down are pressed simultaneously.

Did you buy some spare ones ?

No, I have only one currently. But I can get more if it is damaged.

Thanks @lastchancename for the hints! Now I am thinking to use a voltage divider to convert Uno 5V GPIO to 3.3V to connect with the SEEK or VOL pin. I guess NPN transistor is ruled out since this is a tri-state circuit.

@Railroader thanks for your guidance. The pen/paper actually made me think better.

Will the tri-state work as the following pin states?
Uno GPIO : HIGH (digital output)
Uno GPIO: LOW (digital output)
Uno GPIO: High Impedance (digital input)

That looks correct. The SEEK pin will feel a 10k resistor load to GND, if that's okey.

I think this would not work. When the Uno GPIO is at high Impedance the SEEK pin would be connected to Ground via the 10K resistor and it would trigger the SEEK in the lower frequency direction.

@yokonav
You can use an NPN for RST, VOL- and CH-.

For VOL+ and CH+ you will need to use a PNP.

If it was my EN803, I would try your plan #1. But I would run the UNO at 3.3V after the upload. So no level shifter. You disconnect the EN803 from the UNO, upload the sketch, and reconnect the UNO to 3.3V... I would try the ON/OFF button first.

#define onOff 4
void setup() 
{
pinMode(onOff,INPUT);
}
void loop() 
{
pinMode(onOff,OUTPUT);
digitalWrite(onOff, LOW);
delay(50);
pinMode(onOff,INPUT);
delay(5000);
}

How do you run an Arduino UNO R3 at 3.3V?

Connecting the 5V pin to a 3.3V source.(USB disconnected)

Never tried that before. I guess it would reduce the clock speed to 8MHz?

No, it would try to run at 16MHz, and that isn't guaranteed to work at 3.3V. It probably will work, but the only way to know is to try it.

You can run the Uno at 8MHz by changing the fuses, bit that's not beginner stuff.

Not automatically. If you want to try it, upload simple blink,disconnect USB, and connect the 5V pin from the UNO to a 3.3V source.

@yokonav

Connecting the 5V pin to a 3.3V source.(USB disconnected)

That's dangerous.
If you forget to disconnect the USB or 3.3V, or you connect anything to Vin, you will certainly burn something.
Much safer to use the NPN/PNP
Plus it will not run at 16MHz

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.