Home        Store        Learn        Blog

Lights will not change intensity

I have a connected pair of the subsea lights. I can turn them on from my arduino, and I can turn them off, but the brightness never changes. Any value I send via servo.writeMicroseconds: 1200, 1700, 1900 etc gives them same intensity.

The ground from the arduino and the ground from the power supply are connected. The light is connected to pin 9 on my Uno

Are you using servo commands to turn them on and off, or something else?

Have you checked to make sure the servo object in your code is configured to use pin 9? If you’ve got access to an oscilloscope it might be worth checking that the output changes correctly when you tell it to - otherwise connecting up an LED should have at least some visible change in brightness between the minimum and maximum.

Hi,
Both the lights and Arduino have common ground?

yep!

ooh good idea. Yes it’s on pin 9 but I like the LED idea

hmm, that had no effect either. However, would setting a LED to a range from 1100 to 1900 microseconds work?

when I change it from pin 9 to pin 2, the LED pulses. However, I’m changing the PWM from 1827 to 1180 and back and see no change in the pulse speed or brightness on the led. I did hook up an oscilloscope, which is only the third time I have done so and I see pulses, but they do not seem to change regards of the gpio pin output

Interesting. What’s your PWM frequency? If you have a 50Hz frequency then 1100-1900us pulses are likely too short to display with the LED (1.1 ms vs 1.9ms in every 20ms is 5.5% and 9.5% duty cycle respectively, which may not be enough to turn on the LED, and would likely be difficult to see a difference between regardless). If you had something like 200Hz then you get 22% vs 38% duty cycle which should be noticeable for your LED, and also easier to see on your oscilloscope

The width of the ‘on’ portion should be changing from 1.1 to 1.9ms (or 1100 to 1900us depending on the units of your scope). If that’s not happening then the PWM signal isn’t being updated.

Not sure how you’ve been testing on your scope, but try using cursors if you’re not already - if you trigger on the wave so you get stable pulses, then set two cursors to the on width for 1100us, then run the command on your Arduino to change to 1900us and you should see the cursors are now thinner than the on portion.

I’ll have to go back and check. And I’ll plug in the light not the led / resistor combo

Thanks for the oscilloscope info too,