RC electronic switch issues

Hi,

I have some of the following electronic switches:
https://www.aliexpress.com/item/32966528709.html?spm=a2g0s.12269583.0.0.1fb7310fZfw5Zn

I am using 3 of them in my project to power some LEDs. They work fine for the most part but sometimes they just turn off and refuse to turn on again (and ignore input) unless I power down the project and power it back up. Why is it acting this way; and how can I fix it? Cheers.

Thanks for the heads-up.

No problem :joy::joy:

Hi,
Can you please post a circuit diagram of your project?
Can you please post your code?

Are you just turning the LEDs ON or OFF, or are you using the flashing cycles programmed into the PWM Controlled Switch Receiver Control Module?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Hey Tom,

Here is the relevant code, I could post the complete code but it is of numerous files, don't want to overload you, but I could post the whole project if you want:

void loop()
{
  while (receiver.available())
  {
    receiver.read(&rx_data, sizeof(rx_data));
    
    rx_to_channel();
  }
}

void rx_to_channel()
{
  ch1.writeMicroseconds(rx_data.ch1);
}

Basically I have a custom RC receiver using the nrf24 modules. The receiver gets the channel values over the radio then writes then to the ESCs, servos, and electronic switches.

Are you just turning the LEDs ON or OFF...

Both, I have two switches blinking using the flashing cycles programmed in the switch, and one switch fully ON/OFF only.

I'm not sure how to post a schematic as I can't find the electronic switch part on easyeda (the software use for schematic and PCB design. Sorry about that.

Hi,

Picture of a hand drawn circuit is fine, you have all the library symbols in your head and hand.

Tom.... :grinning: :+1: :coffee: :australia:

I made my own symbol for the electronic switch. Here is the connection of the relevant bits. I have two switches controlling 4 leds each, and one controlling 8 (as in the picture).

Sorry if the image I provided isn't clear enough; but the switch is quite simple; it runs on the same 5V rail that powers the Arduino nano. The switch closes when the signal is >1800us, and opens when it is <1200us.

That's a servo compatible RC signal.
Five'll get you ten the GND wire is BLK , 5V wire is red and the SIGNAL wire is wht.

More than likely you are not maintaining the servo signal on them continuously.
If you connect an RC servo signal controlled device, the PPM signal cannot be
interrupted. It must be continuous because it does not speak any other language.
You cannot stop and start the signal or it will reset to the default state.
In other words, if you put an oscilloscope on it, the pwm signal (or PPM, depending
on device type) should be visible all the time and should not stop and start,
I can't tell from your code (I'm not a S/W person) if you are using the Servo library ?

Begs the question - what then are you doing on an Arduino forum?

Mind you, I avoid the strictly software fora such as "Programming Questions". :roll_eyes: Just don't sound that interesting. :grin:

Yes I am using the Arduino Servo library.

Paul_B
First of all, you don't need to know any code to consult on the General Electronics topic and secondly 99% of the 1000+ programs I have run in nine years were copied and modified to suit my application by changing I/O numbers , pwm values, etc etc. A S/W person is someone whose forte is code and has a minimal (certainly not formal BS in Electronics Engineering Technology) but nevertheless can breadboard arduino circuits. I'm the opposite. I build complex electronic circuits, including point to point soldered perfboard prototypes and HV equipment for a living but rarely code from the ground up because I don't need to. The code is already readily available. You of all people know that I had about 580 Karma points before the computer glitch that erased my account forcing me start from scratch. To ask what I am doing here is frankly insulting. I debug electronic circuits, not code.

I didn't know formal BS was an option :smiley:

I have a BSEET from DeVry
(Bachelor of Science in Electronics Engineering Technology)
Has gotten me most of my best jobs (AMAG, AMAT (3 times), Tesla (4 times) Varentec, Google, Apple, and my current job. It has been recognized as an Electronics Engineering Tech degree since before a PhD BSEE told me that when he recommended DeVry to me back in 1992.
FYI, I forgot to add the word 'Technology' in the name of the degree in my last post. Just corrected that.

I don't see any nrf24 in the schematic.
Is the Nano running the servo code or is it receiving the code from the nrf24 ?
You can easily verify that the issue is due to using the nrf24 modules by removing them and
connecting the arduino directly and running the Servo library code. I suspect that the problem
will disappear. Alternately, if you put an O-scope on the signal of the switch, if the servo signal is not continuous, it would indicate the switch is resetting because the servo signal is interrupted.
SERVO signal waveform
I can't tell how you have the nrf24 connected so the above is just a guess.

You meant BS, not BS, right ?

I assumed you meant BSc.
I know only one form of BS, and it's usually quite casual :wink:

Someone got out of the wrong side of the bed! :astonished:

A BS in BS a possibility? :rofl: