Hi, i've been working on a project with programmable LED strips attached to my Arduino, and need to create a wireless (not wifi) connection to it. It's the Arduino Uno and i've already created the code I want for how I want the LED strands to display. I want to have it be completely wireless and not need wifi to work. Do you have any suggestions for what I can use for this? I think I can figure out the code once I do, but I have no idea where to start in making this wireless and not be wifi related.
Wireless usually means radio, which includes WiFi. To send data between two devices wirelessly, you need a radio transmitter module and a matching radio receiver module.
There are a very large number of those to choose from, so think about how much data needs to be sent, how often and whether two way communications are required.
For short range on/off controls these can't be beat.
I'm not quite sure how much data needs to be sent. It's not a ton of LED's, i've got about 6 strands maybe a couple more of maybe 30-40 LED's each. That's just the remote, correct? Wouldn't I need something that I have to install/wire onto the Arduino for that to connect to it? And by not wanting wifi, I just mean I don't want to have to be connected to a wifi internet for it to work. I want to be able to take it outside and use it. I've got a battery pack attached to the arduino that will power it outside.
If you provide some actual details about the project, like links to the LED strands, and post the Arduino code you are using, you would get helpful, specific answers.
For example, Neopixel strands require "a ton" of data, delivered very rapidly, and can't easily be controlled by radio.
Have a look through the "How to get the best out of this forum" post, linked at the head of every forum category.
Of course, so sorry, it's the WS2812B Neopixel strands and using the Arduino Uno. The project is just a flowing sine wave for one program which switches slowly between two colors, the 2nd program in the same code (haven't combined them yet) is just a sine wave as well, but has about 3 pixels of a different color flow through at the same time as the normal sine wave. I'll post the one with the color changing sine wave. The end goal is to have both the color changing sine wave and the other combined, but working on that separately. For this part, i'm trying to be able to control the lights being on remotely while still being close-ish like within 30-40 feet. Here is the strand Strand
#include "FastLED.h"
#define NUM_LEDS_1 20
#define NUM_LEDS_2 20
#define NUM_LEDS_3 60
CRGB leds1[NUM_LEDS_1]; // First strand of LEDs
CRGB leds2[NUM_LEDS_2]; // Second strand of LEDs
CRGB leds3[NUM_LEDS_3]; // Third strand of LEDs
#define PIN_1 6 // Pin for the first strand
#define PIN_2 10 // Pin for the second strand
#define PIN_3 4 // Pin for the third strand
float intro = 0;
int light = 0;
CRGB startColor(255, 153, 0); // Define the start color for the first strand
CRGB startColor2(0, 255, 0); // Define the start color for the second strand
CRGB startColor3(0, 0, 255); // Define the start color for the third strand
CRGB endColor(255, 0, 0); // Define the end color for the first strand
CRGB endColor2(0, 0, 255); // Define the end color for the second strand
CRGB endColor3(255, 0, 255); // Define the end color for the third strand
float sineSpeed[] = { 0.2, 0.25, 0.3 }; // Sine wave speed for each strand
//float transitionSpeed[] = {1, 0.02, 0.03}; // Color transition speed for each strand
fract8 transitionSpeed[] = { 2, 2, 3 }; // Color transition speed for each strand
float sineOffset[] = { 0.0, 0.0, 0.0 }; // Sine wave offset for each strand
void setup() {
FastLED.addLeds<WS2811, PIN_1, GRB>(leds1, NUM_LEDS_1).setCorrection(TypicalLEDStrip);
FastLED.addLeds<WS2811, PIN_2, GRB>(leds2, NUM_LEDS_2).setCorrection(TypicalLEDStrip);
FastLED.addLeds<WS2811, PIN_3, GRB>(leds3, NUM_LEDS_3).setCorrection(TypicalLEDStrip);
}
void loop() {
RunningLights();
}
void RunningLights() {
float Position = 0;
fract8 position_strand_1 = 0;
int transition_down_1 = 0;
fract8 position_strand_2 = 0;
int transition_down_2 = 0;
fract8 position_strand_3 = 0;
int transition_down_3 = 0;
float sinePosition[] = { 0, 0, 0 };
while (1) {
if (intro <= NUM_LEDS_1) {
intro += 3.0;
}
CRGB currentColor = calcSineWave(&transition_down_1, &position_strand_1, transitionSpeed[0]);
sinePosition[0] += sineSpeed[0];
CRGB currentColor2 = calcSineWave(&transition_down_2, &position_strand_2, transitionSpeed[1]);
sinePosition[1] += sineSpeed[1];
CRGB currentColor3 = calcSineWave(&transition_down_3, &position_strand_3, transitionSpeed[2]);
sinePosition[2] += sineSpeed[2];
for (int i = 0; i < NUM_LEDS_1; i++) {
if (i >= intro) {
break;
}
light = sin(i * .4 - sinePosition[0] + sineOffset[0]) * 127 + 128;
if (light > 255) {
light = 255;
}
setPixel(leds1, i, currentColor.r * light / 255, currentColor.g * light / 255, currentColor.b * light / 255);
}
for (int i = 0; i < NUM_LEDS_2; i++) {
if (i >= intro) {
break;
}
light = sin(i * .4 - sinePosition[1] + sineOffset[1]) * 127 + 128;
if (light > 255) {
light = 255;
}
setPixel(leds2, i, currentColor2.r * light / 255, currentColor2.g * light / 255, currentColor2.b * light / 255);
}
Position += transitionSpeed[2]; // Use transitionSpeed for the third strand
for (int i = 0; i < NUM_LEDS_3; i++) {
if (i >= intro) {
break;
}
light = sin(i * .4 - sinePosition[2] + sineOffset[2]) * 127 + 128;
if (light > 255) {
light = 255;
}
setPixel(leds3, i, currentColor3.r * light / 255, currentColor3.g * light / 255, currentColor3.b * light / 255);
}
showStrips();
}
}
CRGB calcSineWave(int *transition_down, fract8 *position, fract8 transition_speed) {
if (*transition_down) {
fract8 previous_strand = *position;
*position -= transition_speed;
if (previous_strand < *position) {
*position = 0;
}
} else {
fract8 previous_strand = *position;
*position += transition_speed; // Use transitionSpeed for the first strand
if (previous_strand > *position) {
*position = 256;
}
}
// Calculate the color transition for strand 1
CRGB currentColor;
if (*position <= 0 + transition_speed) {
*transition_down = 0;
}
currentColor = CRGB(startColor).lerp8(endColor, *position);
if (*position >= 256 - transition_speed) {
*transition_down = 1;
}
return currentColor;
}
void showStrips() {
FastLED.show();
}
void setPixel(CRGB *leds, int Pixel, byte red, byte green, byte blue) {
leds[Pixel].r = red;
leds[Pixel].g = green;
leds[Pixel].b = blue;
}
WiFi doesn't mean you have to attach to a network and the internet. You could use an esp8266 or esp32 in independent AP mode where it is the "network". You attach to the device via SSID and password and it becomes your server.
See File->Examples ->ESP8266WiFi->WiFiAccessPoint for a simple example. Later you could add a DNS server to sign on with a URL rather than an IP address.
I use it as an HTML server so it can be accessed with a web browser.
What do you mean by "control the lights being on remotely"?
Neopixel strands require a direct, high speed connection to a processor, which could receive control commands from any source.
We are looking to control the lights from the push of a key fob from within ~50-60 feet away remotely on either the Arduino Uno or a Trinket.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.