Jump to content
Coral Vue Hydros

Modifying Mars Aqua light for raspPi


tarunteam

Recommended Posts

The goal of this project is to convert a Mars Aqua 165w LED light to a programmable light. I currently have a rasp pi that i want to use to control the light so i can do cool stuff like thunderstorms and day and night cycles.

 

Basic Idea so far:

The dim pot, according to people run from 0 to 10 volts with 0.5 amps. There is a 12V+ and an on and off switch. I figure what i'll need to do is convert the PWM into some sort of analog signal and then boost that to 0.5amp with a voltage scaled to 10 volts from 3 volts.

 

What I've learned:

I can convert the signal from pwm to analog using a PWM DAC. Then I can connect that output to a OPamp to have it scale in voltage and amperage.

 

For the DAC:

Found this on ebay seemed like it should be simple. Can someone please explain the data sheet in simple terms ? What learning do i need to do to make it work?

 

https://datasheets.maximintegrated.com/en/ds/MAX5661.pdf

 

for the OPamp:

 

http://www.daycounter.com/Circuits/OpAmp-Level-Shifter/OpAmp-Level-Shifter.phtml

 

I think its fairly straight forward I just need to reverse it from bucking to boosting. Should be just simple resistor change. This should also solve my amp problems? Anything i should note?

Link to comment

Well you have a couple of simple options.

First, change out the drivers in the unit for ones that are designed for PWM dimming. Then you can just hook your signal cable up and connect the Pi to ground on the unit.

Second you could use something like this, https://www.robo-tank.ca/en/Break-Out-Boards/16-Channel-Digital-to-Analog-Signal-Converter-p138c63.html

There are other more basic PCB's available that will only do one type of conversion so you'd have to find a PWM - analog one, but the Robo-Tank one gives you scope for expansion etc.

Link to comment
jedimasterben

I've found much better luck feeding the drivers an analog signal. The fans are also RPM controlled by the driver and those do not respond well to a PWM signal and are extremely noisy at 520Hz.

Link to comment

Well you have a couple of simple options.

First, change out the drivers in the unit for ones that are designed for PWM dimming. Then you can just hook your signal cable up and connect the Pi to ground on the unit.

Second you could use something like this, https://www.robo-tank.ca/en/Break-Out-Boards/16-Channel-Digital-to-Analog-Signal-Converter-p138c63.html

There are other more basic PCB's available that will only do one type of conversion so you'd have to find a PWM - analog one, but the Robo-Tank one gives you scope for expansion etc.

It seems like it would work, but comes out more expensive than just building the circuit on my own.

I've found much better luck feeding the drivers an analog signal. The fans are also RPM controlled by the driver and those do not respond well to a PWM signal and are extremely noisy at 520Hz.

Agreed.

Link to comment

It seems like it would work, but comes out more expensive than just building the circuit on my own.

 

 

Yeah you'll find cheaper boards that do the same thing, it's just I knew where to find a link for what I meant. It would also be perfectly possible to make a signal converter yourself if you knew what bits you needed.

Like Jedi is suggesting it's probably best to convert the PWM to analog than change out the drivers.

Link to comment

Before you do any of this, you need to measure a few things and don't make assumptions based on what you have read from others anecdotal evidence.

 

First thing you want to do is to measure the source voltage from the driver going into the potentiometer. Make sure that it's 10v and not something else.

 

Next, you will want to measure the current draw on the pin that is connected to the wiper of the potentiometer. This will show you how much current the driver will draw, and will show you whether you need to add complexity to the circuit or not. The 0.5A number you posted above seems all wrong for a driver like this. It's more likely a few milliamps rather than a few hundred.

 

Once you have that information, then you can start building your circuit. I think you don't need to make it as complicated as all this though. All you should need is an NPN transistor, an electrolytic capacitor, and three resistors. Take a look below:

 

RPi%20Low%20Pass%20Filter.png

Keep in mind that this is assuming that you are using the default Pi pwm frequency of 585Hz, and the current draw of the driver dimming circuit is actually reasonable.

 

This circuit takes your pwm output from the Pi and applies it to the base of an NPN transistor (take your pick here, but a 2n2222 should be plenty unless the current draw at the driver is really high). This does your voltage increase, and current handling increase. The output from that is passed into a low pass filter to convert pwm to analog. With the values listed above, you should get about a 0.01v ripple, and about a 1 second setting time. Sounds slow, but it's plenty fast for this.

 

This is a starting point. Please tweak the values as you see fit, but this will be far cheaper to build, as well as simpler to build than what you were planning. The transistor will provide enough isolation from the load to protect the Pi IO. this whole circuit will also be powered from the 10v output from the driver, so you won't need to provide additional power to make it work.

Link to comment

Before you do any of this, you need to measure a few things and don't make assumptions based on what you have read from others anecdotal evidence.

 

First thing you want to do is to measure the source voltage from the driver going into the potentiometer. Make sure that it's 10v and not something else.

 

Next, you will want to measure the current draw on the pin that is connected to the wiper of the potentiometer. This will show you how much current the driver will draw, and will show you whether you need to add complexity to the circuit or not. The 0.5A number you posted above seems all wrong for a driver like this. It's more likely a few milliamps rather than a few hundred.

 

Once you have that information, then you can start building your circuit. I think you don't need to make it as complicated as all this though. All you should need is an NPN transistor, an electrolytic capacitor, and three resistors. Take a look below:

 

RPi%20Low%20Pass%20Filter.png

Keep in mind that this is assuming that you are using the default Pi pwm frequency of 585Hz, and the current draw of the driver dimming circuit is actually reasonable.

 

This circuit takes your pwm output from the Pi and applies it to the base of an NPN transistor (take your pick here, but a 2n2222 should be plenty unless the current draw at the driver is really high). This does your voltage increase, and current handling increase. The output from that is passed into a low pass filter to convert pwm to analog. With the values listed above, you should get about a 0.01v ripple, and about a 1 second setting time. Sounds slow, but it's plenty fast for this.

 

This is a starting point. Please tweak the values as you see fit, but this will be far cheaper to build, as well as simpler to build than what you were planning. The transistor will provide enough isolation from the load to protect the Pi IO. this whole circuit will also be powered from the 10v output from the driver, so you won't need to provide additional power to make it work.

I had some stupid questions. How would the analog signal change voltage with the pwm signal? How much flicker should i expect?

Link to comment

This circuit (at least the resistor (R2) and cap (C1)) is called a low pass filter. The analog output voltage changes based on the duty cycle of the incoming pwm signal. With this setup it should be pretty linear. 100% duty cycle, 10v output (or slightly under it just due to losses in the circuit). 50% duty cycle, ~5v output. 20% duty cycle, ~2v output.

 

As I mentioned before, there is about 10mv ripple in this circuit. This shouldn't show up as flicker per se, as that's normally only noticed when there is a much larger swing in the voltage. If you can see any kind of flicker from this, you have better eyes than I do.

 

If you want to reduce the ripple, increase the cap size. This will have the effect of slowing the rise time though, so changes that you make to the duty cycle will take longer to settle.

 

I use this type of circuit all the time and it works quite well.

Link to comment

I think i sorta got it to work on simulator. Just gotta figure out where to dump the output. Maybe just back into the power supply?

Link to comment

Umm, what? What are you talking about "dump the output"? Everything you need to connect is shown above.

  • +10v comes from the 10v output of the dimming circuit on the driver
  • Driver Analog Input goes to where the wiper on the pot was connected
  • Ground will be connected to the ground connection for the dimming circuit (pot had three wires going to it: 10v, signal, ground). The Raspberry Pi ground needs to be connected to this also
  • RPi pwm obviously comes from the Raspberry Pi

What more do you need?

Link to comment

On the simulator you don't need to connect the output to anything. You could attach a multimeter unit or oscilloscope unit on that point to measure the analog voltage. The input impedence on the driver input should be quite high (100K or higher), so if you wanted to, put a 100K resistor between the output and ground.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recommended Discussions

×
×
  • Create New...