Wireless On/Off Toggle: Possible with RF receiver?

Apologies for jumping in with a new thread as a new user, but having spent hours searching the forums to no avail, I thought it time to simply ask!

I am brand new to PixelBlaze (though have been coveting one here in the UK for ages), and relatively beginner with code, so apologies as well if this is a silly and obvious question. I don’t THINK it is, but I could be wrong!

I am looking to make a simple wireless on/off trigger with a button to turn my LEDs on and off remotely. I had been looking into using an RF transmitter and receiver as they are cheap and low power, and have got this successfully working on an Arduino.

The big question: is it even possible to get the Pixelblaze to recognize signals being received on the RF receiver and translate that into turning the lights on and off? My research seems to be pointing me towards ‘No’ but also ‘Maybe but it’s complicated’.

My Arduino board DOES have an ESP32 chip and therefore could probably theoretically do the same functionality over WiFi instead, but I know this to be a much more power hungry option and thus wanted to see if it’s possible to make a lower power wireless remote for the Pixelblaze.

Frankly, any further information or help in getting set up to trigger the animations wirelessly would be SUPER appreciated!

To the best of my knowledge wifi is the option, but @zranger1 has put together a Python client: GitHub - zranger1/pixelblaze-client: Python 3 module for controlling Pixelblaze (unsure if it works with CircuitPython) and I’ve made a Kotlin version: GitHub - hkolbeck/kotlin-pixelblaze-client: Kotlin client for the Pixelblaze LED controller. I’m in the process of writing one targeted at the Arduino C++ ecosystem, but it’s slow going because it’s been 12 years since I wrote any significant C++.

My work is directly targeting the creation of a standalone remote control, but some of your concerns are concerns there as well. It’s just so hard to do low-power over wifi.

1 Like

Hi @katzcreates!

No apology necessary, we love hearing from new users. Thanks for searching the forums first, but you’re right, I don’t think I’ve seen a thread tackling this exact question.

It’s good timing too since I was just looking into remote relay control for another project last night. I searched Amazon for “remote control relay” and found a bunch of good options, some of which I bet are similar to what you found. I needed a 4-channel one that would be powered off 12V, but I saw ones that have the receiver and relay powered off 5V as well.

Since it sounds like you don’t have a Pixelblaze in hand yet, first let me tell you that if you can afford the power budget to keep the Pixelblaze controller board itself powered continuously, it’s already very easy to remote control your patterns over WiFi. You can use a laptop or mobile browser to select different patterns, start a playlist, pause it, or turn the brightness down to zero, etc. This option requires that the Pixelblaze can consume about 160mA @5V, or you can reduce the clock speed setting and lower the current draw.

It sounds like you might be concerned with how much power the remote receiver uses while it’s listening for a signal; that is something I think you just need to search through specs for various remote relays. If 160mA is too much ambient power consumption, you might compare it to these specs for a relatively low-power remote-controlled relay. For example, this one says that the quiescent (background use) current draw is 5mA.

Big picture, there are three ways you might consider using a remote relay near the Pixelblaze:

  1. To interrupt or connect power to the whole project - if your LEDs and controller are powered by a battery, this is the way to save the most power when the LEDs should be off
  2. To remotely trigger the controller’s onboard button. You’d solder the relay outputs to the pads on the underside. This button lets you advance the pattern in a playlist when you push it momentarily. You can also use this as a clever on-off hack if you like by interspersing your playlist with patterns that just have no LED output.
  3. To connect ground or 5V to a GPIO pin. This results in a value that you can read as 0 or 1 in any pattern’s code. You’ll need to copy-paste this code to any of the patterns you want to use it. So, for example, if you wanted the currently playing pattern to overlay a white strobe for a second when you triggered a remote button, you could do this but would need to incorporate that code into each of the patterns you plan to use on the board.

Hope this helps! Let us know where you end up :slight_smile:

1 Like

Hi @katzcreates,
Welcome to the forum!

Yes, over WiFi, the websocket API can control pretty much everything. There’s a few other ways that this could be done that don’t involve WiFi, with some other radio and some external circuitry, signaling to the Pixelblaze via some GPIO.

Since you have an Arduino with an ESP32, the websocket is the way I’d recommend.

For low power, that would mean leaving your remote’s wifi off most of the time, and connecting as-needed long enough to send over a command over the websocket. That should give you decent battery life, but at the cost of a delay in responsiveness during the wake-up-and-connect process. That would save your remote’s power.

On the Pixelblaze side of power things, the WiFi radio is the main power draw, and you can expect it to draw 72-145 mA in client mode, 150-172 mA in AP mode. Turning off WiFi is possible, dropping power usage considerably, but then you lose the ability to control it remotely.

LEDs themselves usually have a fairly significant idle draw too, often 0.5-1.0mA each.

If you want to conserve as much power as possible on the Pixelblaze side of things, that probably means some external circuitry to cut power to both PB and the LEDs, and would have to happen outside of the PB itself. (I see @jeff has some awesome advice here).

Once connected, you have two main options for turning things on/off. You can set the brightness to zero, and back again, or switch to a pattern that is drawing black.

More details on the websocket API can be found here:

The tl;dr is that you can send a text frame with something like this JSON:

{
  "brightness": 0
}

and then to turn it back on:

{
  "brightness": 1
}
2 Likes

Ahhh, sweet relief! I’m glad this isn’t something that has been tackled before and I just missed it. I know it’s always annoying to have the same question asked over and over again…

So I quickly realised upon re-reading your response that a remote relay makes much more sense…and isn’t what I have or was trying to use. :joy: At the recommendation of a friend I was trying just straight up RF communication modules, which absolutely 100% could work with two Arduinos but require a decoder to do anything of use, and I get the impression that the Pixelblaze just cannot do that kind of decoding. That said, as soon as you mentioned the relay, I was like, “Wait a minute, that’s a much better idea…”

I DO actually have a Pixelblaze to hand (thanks to the amazing @GeekMomProjects hooking me up) but I’ve really only just started playing with it, really. I have gotten it connected and showing gorgeous patterns on a single strand of LEDs (spoiler alert, the project will end out having about 600 LEDs before I’m finished) and I had just started playing around with connecting the RF receiver to the GPIO and tinkering with the code in the editor to see if could get it to respond.

My concern around the power draw was mostly because I noticed the Pixelblaze getting REALLY warm when it was actively connected to WiFi, and both the remote and thing being controlled by the remote will be portable, and with limited battery life, so I wanted to prolong the battery life as much as possible. That said, both will have rechargeable batteries, so this isn’t the end of the world.

Honestly, I really love the idea of using the remote relay to switch off the power entirely, but the more I look at remote relays available to me in the UK, the more I think it might end out being more effort than simply going with the Wifi and websockets. My primary concern around it is that it seems that it really only works with the pre-paired transmitter, which would likely be an immense pain to get working with the awesome RGB LED Metal Button I have for the trigger. (Of course, if I am way off and you have insight into this, please say!)

I am still SUPER open to ideas for some kind of remote switch that would allow me to use an Arduino for the remote side! But WiFi is PROBABLY simplest.

1 Like

Hi Ben! :smiley: Thank you so much for the welcome and for helping me get set up with some Pixelblaze finally!

This is KIND of what I was hoping was possible, though I get the feeling the setup might be a lot more complicated than I was initially thinking. Simply connecting the RF receiver via the GPIO and trying to get the Pixelblaze to do some TriState decoding on the fly doesn’t appear to be working as I hoped.

This is an interesting prospect and worth testing to see how much of a delay there is on it!

This definitely feels like it could significantly impact the battery life I have, given that this project will ultimately contain 600 LEDs and be fully portable and thus dependant on the batteries I have to hand. They are easily rechargeable obviously, but if I am carrying this around at an event, it’s nice if it can last most of it! My hope had been to be able to trigger the lights as desired, conserving power the rest of the time when nothing is lit up.

I feel like this is the direction I’d ideally like to go, but figuring out the best route is feeling a bit overwhelming! I am rather wondering if another Arduino may be necessary to control the wireless signal/power connection for the Pixelblaze?

I’ve taken a look at this page a few times, and I didn’t see much about how to connect via an Arduino and I’m guessing this may be a bit above my knowledge. :sweat_smile: I wouldn’t have any kind of visual interface here to work with, simply an Arduino with a button attached! I’m sure there’s a way to make it connect via the WiFi in code and send the command when I push the button, but at the moment I’m not entirely sure how to set that up!

That reminds me … when brightness is 0, does the PB constantly refresh the LEDs, or does it just send one set of 0’s and then save power by not sending any more signal?

Come to think of it, this would help save power with non-black states too. I have some static patterns and it would be great if I could tell the PB to only render one frame then stop updating the LEDs.

1 Like

There are a lot of people here much smarter than I am about buttons and control schema, however if you are considering your power budget as an important factor, I just wouldn’t worry about it. While PixelBlaze do get warm, and leaving the Wi-Fi on is a factor, because you say that you will have 600 LEDs involved the total power draw of the PixelBlaze with Wi-Fi enabled is a rounding error on your overall power budget.

Check my post here for more on battery power management — Beginners Guide to Making a LED Festival Coat — I would only consider the WiFi turning off tricks if you’re thinking more like 50 LEDs or less, not 600+, unless you expect a vast majority of them to be turned off at any given time.

3 Likes

You know what, you make an excellent point and that’s totally fair enough! I do tend to over worry about things. :sweat_smile:

1 Like

Pixelblaze continues to send data, however the power draw of these communications is minimal, and as far as I know, does not contribute to the quiescent current draw of addressable LEDs.

Some LEDs, notably GS series will do undesirable things if they don’t see data for a while.

That might change at some point though, possibly to support an idea for an LED power saver circuit that could cut power if no data was transmitted for some period of time. Could be made with something like a 555 and a power mosfet, where data keeps triggering the 555 to turn on the mosfet. Might add power relay control to PB as well.

2 Likes

It took a bit of doing (I am not code savvy) but I have finally got the websockets connection working from my Arduino and successfully able to turn the whole strip on and off with just the push of a button. Sounds simple, has been surprisingly complicated! :joy:

A huge thanks to everyone for the help, thoughts, and insight! These things are always awesome learning experiences and I cherish them greatly.

I’ll make a little video assembling the remote and showing it functioning shortly, and I’ll be sure to share it here when I do! :smiley:

Now to just solder together 10 strips into a spherical grid… :joy:

4 Likes

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