Custom light controller for Spektrum receiver/ESC

This site may earn a commission from merchant affiliate
links, including eBay, Amazon, and others.

oops

Active Member
Messages
100
Reaction score
166
I've been working on adding lights to my Felony and wanted to have the lights remotely controllable via a spare channel on the transmitter and have working brake lights. I couldn't find anything existing that did exactly what I wanted, so I set about making something myself.

After a bit of investigation, I discovered that the Spektrum Smart ESC/receiver don't use normal RC servo control signals, but have 2-way digital communication. This makes things much more interesting, as you can use telemetry data to reliably tell when the ESC is braking (as opposed to reversing), and you also get access to control data for all RC channels on a single cable, not just throttle.

So, after a lot of tinkering, I have this:

IMG_20220102_123424.jpg


It's based on Raspberry Pi Pico microcontroller. It connects with a single Y lead to the ESC/receiver connection, and gives three independent lighting channels (although it'd be trivial to add more).

It has three modes that can be selected (off, mode 1 and mode 2), and you can independently set the brightness of each lighting channel for modes 1 and 2, as well as the braking brightness if applicable, so the rear lights can be on at a lower level or off when driving, and then go to high brightness when braking. There's also a "flash" function which changes the brightness of one or more channels when you hold the B button when driving.

I got a bit carried away and implemented a menu system for configuring the brightness settings via the transmitter. Hold down the B button for 5 seconds when the car is stopped and you enter a menu that you can program using short and long presses on the B button. The brightness level is set using the AVC level control on the transmitter. I've added the handbrake module to my Felony, and use the same channel for controlling that - A for handbrake, B for light control. I have the handbrake servo setup so it only has a tiny throw when you press B.

I'm planning to get a case for it 3D printed in due course and am also considering getting some PCBs made which should make it quite a lot smaller.

I'm very happy to share the code and schematics for the electronics if anyone is interested. The Pico microcontroller cost all of £3.60 (~ $5 US) and the other components were well under £10 in total.

Kudos to Horizon for making the details of the Smart ESC protocol freely available.
 
This is great, I was just looking at Pi projects for RC cars this morning.
 
Very interesting.

Excellent work!
Post a vid of the system in operation and the menu setup process, if you don't mind.

If you don't have a 3D printer at the moment, I'm willing to collaborate with you to design & print a custom case..
Just DM me.
 
Post a vid of the system in operation and the menu setup process, if you don't mind.
Will do - just need to find a bit of time to put something together.

Thanks very much for the offer of 3D printing, but I've actually got a printer on order, so I figure this will make a good first project.
 
I've been working on adding lights to my Felony and wanted to have the lights remotely controllable via a spare channel on the transmitter and have working brake lights. I couldn't find anything existing that did exactly what I wanted, so I set about making something myself.

After a bit of investigation, I discovered that the Spektrum Smart ESC/receiver don't use normal RC servo control signals, but have 2-way digital communication. This makes things much more interesting, as you can use telemetry data to reliably tell when the ESC is braking (as opposed to reversing), and you also get access to control data for all RC channels on a single cable, not just throttle.

So, after a lot of tinkering, I have this:

View attachment 189974

It's based on Raspberry Pi Pico microcontroller. It connects with a single Y lead to the ESC/receiver connection, and gives three independent lighting channels (although it'd be trivial to add more).

It has three modes that can be selected (off, mode 1 and mode 2), and you can independently set the brightness of each lighting channel for modes 1 and 2, as well as the braking brightness if applicable, so the rear lights can be on at a lower level or off when driving, and then go to high brightness when braking. There's also a "flash" function which changes the brightness of one or more channels when you hold the B button when driving.

I got a bit carried away and implemented a menu system for configuring the brightness settings via the transmitter. Hold down the B button for 5 seconds when the car is stopped and you enter a menu that you can program using short and long presses on the B button. The brightness level is set using the AVC level control on the transmitter. I've added the handbrake module to my Felony, and use the same channel for controlling that - A for handbrake, B for light control. I have the handbrake servo setup so it only has a tiny throw when you press B.

I'm planning to get a case for it 3D printed in due course and am also considering getting some PCBs made which should make it quite a lot smaller.

I'm very happy to share the code and schematics for the electronics if anyone is interested. The Pico microcontroller cost all of £3.60 (~ $5 US) and the other components were well under £10 in total.

Kudos to Horizon for making the details of the Smart ESC protocol freely available.
So in order for this to work does it need the smart ESC or can it work with a BLX 185 ESC? I'm interested in your project. Looking forward to seeing your results!
 
So in order for this to work does it need the smart ESC or can it work with a BLX 185 ESC? I'm interested in your project. Looking forward to seeing your results!
It needs a Smart ESC and receiver. If you don't have both, the receiver falls back to talking to the ESC with normal PWM signals, and the only thing you can read is throttle position.

Also, without a Smart ESC, it won't get the telemetry which it uses to activate the brake light.

To do it without the Smart connection, you'd need a separate Y-lead for each channel that you were interested in (primarily throttle and aux, although mine also uses an AVC aux channel for level setting in the menu), and you'd have to guess which throttle inputs correspond to braking - or put up with having the brake lights on when you're reversing.
 
It needs a Smart ESC and receiver. If you don't have both, the receiver falls back to talking to the ESC with normal PWM signals, and the only thing you can read is throttle position.

Also, without a Smart ESC, it won't get the telemetry which it uses to activate the brake light.

To do it without the Smart connection, you'd need a separate Y-lead for each channel that you were interested in (primarily throttle and aux, although mine also uses an AVC aux channel for level setting in the menu), and you'd have to guess which throttle inputs correspond to braking - or put up with having the brake lights on when you're reversing.
Alright that's fine. I could buy the receiver and transmitter but I'm not gonna get another ESC just for lights. That's Ok. Still looking forward to seeing your results!
 
This sounds pretty nice. It's way beyond my skillset, I'm more of a parts assembler not a developer guy. I might be able to tag my son into this, he's a devo guy.
So basically any Spektrum smart ESC should work as long as you are using a transmitter/receiver combo with telemetry capabilities?
 
So basically any Spektrum smart ESC should work as long as you are using a transmitter/receiver combo with telemetry capabilities?
Yes, although I've not tried it on anything other than what comes with the Felony.

The software side of things is straightforward as I can give you the files that you need to copy onto the Pico microcontroller to make it go.

The electronics is only actually a handful of components. I built them on a prototyping board which is designed to fit under the Pico like this and it was a pain to do, but the end result is quite compact. If you went with a larger prototyping board it'd be a lot easier.

This is the schematic for the circuit:

Screenshot from 2022-01-08 19-12-01.png


The Pico can't cope with more than 5.5V as input, so the stuff in the top left is a voltage regulator so I can run the BEC at 7.4V. If you run the BEC at 6V there's actually a much simpler solution that just uses a single diode. Beyond that, it's a resistor and a transistor on the input, and a transistor on each output channel.

I'm considering getting some custom, pre-assembled PCBs made up, although it's 25 years since I've done any PCB design and the world has moved on a bit, so it may take me a while.
 
Thanks! I had a chance to try out the battery voltage read-out feature yesterday, and it seemed to work well. Interesting to see how much different packs drop under load.

I've also got a plan for making it work with a bit less functionality on non-Smart kit.
 
Thanks! I had a chance to try out the battery voltage read-out feature yesterday, and it seemed to work well. Interesting to see how much different packs drop under load.

I've also got a plan for making it work with a bit less functionality on non-Smart kit.
My son is trying to make this same thing for his RC. 👍👍
 
Nice - is he using the circuit above, or doing his own design? Either way, very happy to collaborate and share what I've learned.
 
I've made some more changes to the code, and the controller now works with non-Smart receivers and ESCs too. At the moment you don't get brake lights except via the handbrake button, but pretty much all the other functions are there. Rather than using the AVC knob to set brightness, you can now step through five levels via the aux button.

I've just been sorting out a case and mount for the controller, so I took a few more pictures of the lower board it while I had it apart. Not my neatest work, but it does the job! Smaller capacitors and some thinner wire would have made it much easier.

IMG_20220114_140014.jpg


IMG_4532.JPG
 
I've made some more changes to the code, and the controller now works with non-Smart receivers and ESCs too. At the moment you don't get brake lights except via the handbrake button, but pretty much all the other functions are there. Rather than using the AVC knob to set brightness, you can now step through five levels via the aux button.

I've just been sorting out a case and mount for the controller, so I took a few more pictures of the lower board it while I had it apart. Not my neatest work, but it does the job! Smaller capacitors and some thinner wire would have made it much easier.

View attachment 192779

View attachment 192781
Are you going to have a custom PCB printed once you're done prototyping?
 
Are you going to have a custom PCB printed once you're done prototyping?

pdw_light_controller.png


Sent for production yesterday :)

Only problem is that the supplier is out of stock of the processors (the "big" black chip above C14). I can get them easily in the UK so I'm going to have to try and hand assemble that chip, which could be interesting - 56 pins in a 7x7mm chip :oops: No idea if it's going to work!

I've added a second input so you can have switch + throttle if you're on a non-Smart receiver, and also a 4th output because why not. Overall size is 41x23mm.
 
I've made some more changes to the code, and the controller now works with non-Smart receivers and ESCs too.
Just curious what you changed to allow non-smart receivers and ESC's ? Are you monitoring the PWM to the ESC?
 
Old Thread: Hello . There have been no replies in this thread for 90 days.
Content in this thread may no longer be relevant.
Perhaps it would be better to start a new thread instead.
Back
Top