Led lamp with pre-register colors

Hello, I am new here.

We have a project to make chromotherapy lamps. We are already using standard led lamps that we find in the shops, but want to do something more professional.

The idea is to put a led in a box and add a fiber optic cable to conduct the light.

I'm an electrician, so I have a good knowledge of electricity, but I don't know which components I should use and how to connect them.

We need to be able to operate an RGB led and change colors. We need to be able to do this with a remote control and a DMX interface.

I have seen many post from Adafruit, and i thing i can do that with Neopixel and Arduino.
This project is like i need, but seems to simple : Software | BLE Feather Lamp | Adafruit Learning System.

I really have to pre-program colors (12-15) and just have to push a button to choose colors.

So, how to make these leds work, change color and power them?

My problem is that I don't know which component to order to do all this. Here is our project, if someone can help us to find the right drivers, etc...

This is not to complex. Do you want to use individually addressable LEDs or simple RGB leds ?

A remote DMX control or an individual controller ?

Hi,
the goal is to be able to pre-program led colors. Actually with the controller we have we can manage by DMX. But it is not really important, the important thing is we have to program exact RVB color (ex. 255,255,255) for each color (actually we do with DMX). Once programmed, we just have to select the colors.

The choice of the led is not important too. We just want one RGB led per lamp. We put on the led a optic fiber cable to conduct the light.

Here is our actual lamp : Lampe de chromothérapie

The choice for a PWM or addressable LED may not be all that important, but a WS281x has the color shades calibrated, whereas for a PWM driven LED, you may have to tweak the shades yourself, which i guess you will have to do anyway. It is not complex to create a series of specific colors and you could select them by something as simple as a button press. If you want a more complex remote control that may complicate things, but not impossible. In the end it's up to you what you want and many ways lead to Rome.

WS281x use PWM to do the intensity.

Are you saying that a WS281x has some kind of adjustment curve or compensation that makes 0..255 mean anything different to using 0..255 with PWM?

In any case, it seems that in a medical or scientific context, any way of producing a color would have to be calibrated, so it doesn’t seem to me it would matter where you start.

WS281x do operate the PWM at a higher rate.

a7

OK, imagine that is a portable lamp. So i need a quick way to save for ex 12 colors.
Once saved, i need a quick way to select the colors.

In fact, after the right colors saved, i dont have to modify that colors. Only be able to choose the colors.

So that i dont know, is how i can do that ?

If i understand, i can buy an Arduino (but what model ?) and program 12 colors with a PC ?
So if i can do that, how to select the colors ? Is there additional panel with button i can connect to the Arduino ? Or is there a remote control i can use ?

Or it can be a simple button that change the colors at each pressing. For ex, 1 press = color 1, and at each other press switch to color 2, 3 etc.

This is my questions.

I read that somewhere, but of course i can not find where that was. From driving a RGB leds with PWM i found that similar brightness is achieved with a significant curve (about 3/4 of a 1 - cosine + 1/4 linear)

Absolutely !

Well they tend to operate at above 2KHz, but you can increase the PWM frequency on most boards to be higher than that too.

Well is that something for which you will need a practical UI, or could you just determine what the RGB values are (8-bit per color channel) , write them down and program them into the sketch for the portable light ?

Many choice here, but yes, it can be done fairly easy. The board depends a little on your other requirements.

That would be the easiest. and can be done on pretty much any board, in fact that can be done on the smallest MCU i use, an ATtiny13, will suffice for that.
The way you set and adjust the '12' (or more) standard colors is what can be done in many ways.

  • You could send DMX values and receive them on a board and once the perfect color has been set, press a button and store the value in EEPROM for easy retrieval through the press of a button.
  • You could do the same, but send a message over 'Serial' to adjust the color, and save (either through a command or a button press)
  • You could use an ESP with Wifi and create a UI that will let you do all those things
  • You could just include the color values in the code at compile time, and just use a button to click through these colors, this is the simplest method and an ATtiny will manage this already, though this is not very flexible and it may not be very practical to found the correct color values.

You could of course use some kind of remote control, but it would over-complicate both the programming and usage, id' say.

OK, first, thank you for your time and explanations.

We want to try with the simplest handler.
That is to say:

  • Programming all the colors to be sent once in the board.
  • Selection of the colors by pressing a button, which switches to the other colors at each press.
  • And if needed, be able to re-program all the colors and send again.

So if I understand correctly, ATtiny13 is a microcontroller and Arduino is an interface to program and manage it ?
So I would need an ATtiny13, an Arduino Uno, and a LED, but I don't understand what kind of LED... Is the Neopixel OK ?

I would also need the whole thing to be battery powered, is that possible or do I need to add another component?

And finally, how to program and connect the whole thing.

In short, this is a lot of questions, but I would really like to learn and be able to realize it.

I founded that :

For programming : https://create.arduino.cc/projecthub/taunoerik/programming-attiny13-with-arduino-uno-07beba

Welcome to the forum.

Someone needs to say this. Clearly you are all beginners to electronics and coding. But you will need both these skills to achieve this project. You are facing a step learning curve and quite a lot of work. The forum will help you as much as you need but only if you are seen to be genuinely trying hard and making effort. The forum will probably not design whole circuits or write entire code for you.

Think about the effort that will be required compared to the value of the results. Chromatheraphy is an Alternative treatment will no scientifically proven beneficial effects.

You need an Arduino or an attiny13, but not both. I would not recommend attiny13 to a beginner because a complete Arduino board is easier for a beginner to use. I would not recommend an Uno unless you plan to use a "shield" and I see no need for a shield here. I would recommend a Nano 3 for most beginner projects.

What you have not described yet is how much light power is believed to be needed. A single rgb led or ws2812 has only a low power.

Hello and thank you for the advice.

First of all, we have been giving chromotherapy classes for over 20 years. This technique is recognized in Switzerland as a continuing education course by authorities such as health insurances, for people who have completed a complete training course in alternative medicine (anatomy, etc). It is therefore not really the question here to have a debate on its effectiveness, its proofs, etc.

We have been working with standard flashlights and color filters, and are now moving on to LEDs with fiber optics.

I'm not asking for someone to do the work for me. I'm just asking for leads, examples. I would then order the components and do my experiments, but I need to have a red thread to know which way to go.

I am self-taught and learn very quickly, when I am passionate about a subject.

That being said, I need to power a single led per lamp. If I take the example of the Flora 1260 led (Flora RGB Smart NeoPixel version 2 - Pack of 4 : ID 1260 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits), it needs 5V DC - 18.5mA.

Ok, we have dealt with those important points and now we can progress.

How many of those LEDs do you plan to use in 1 lamp? If only one, or perhaps up to 4~6, an Arduino like Nano3 can provide the power when connected to pc/laptop or an ordinary 0.5A phone charger.

An ATttiny is a microcontroller and so is an Arduino.

Agreed ! I would recommend an Arduino with an onboard USB port, which is easy to program using the IDE. An ATtiny needs an ISP programmer of some kind, not that complex, but a Nano is small enough and more practical.

I think a neopixel would be the easiest yes. Brightness is of course an issue, but i think a WS2812b will be fine, either as part of a strip (minimum length a meter with 30 leds) or just a single LED + capacitor.

That should be fine. A single LED + MCU should be easy enough, but there are some buts.
A 16MHz Arduino runs on 4.5v - 5.5v and also a neopixel has that as the optimum, batteries have different voltages.
Personally i avoid **non-**rechargeable batteries, 4X AA rechargeable 1.2v will provide approximately 4.8, but when fully charged they will exceed 5v which we want to avoid. Easiest would be to use a rechargeable 9v block, but good chargers for them are not easy to come by (there are loads of bad ones out there)
Then you can power a Nano through the Vin and if it is only a single neopixel, you can power that from the Nano's 5v pin using the regulator that is on the Nano. That regulator does not provide a lot of current, but for a single LED it should suffice.

That would be fine if you decide on an ATtiny, keep in mind that if you do decide on an ATtiny, you will need some way of programming it, and you may need to add a 5v regulator if you power it with a 9v block

Yes that fully explains how to program an ATtiny, but you see the complications compared to just using an UNO (or Nano)

Connecting is simple, and programming is not too complicated, though for an ATtiny13 the neopixel control is different than with the bigger boards, with which you can use any of the common libraries (adafruit or FastLED)

If you intend to make many of these kind of units, you could consider to first develop the code and tune the colors using a 328P based board like an UNO or Nano, and then migrate the program to an ATtiny to produce a series of units.

Yes, as i said, even the internal regulator of a Nano will provide you with that (and of course for sure when you power the board with 5v. These Flora leds are WS2812b's with a capacitor and it appears a 220R resistor on both Din and Dout,

Now i hope you will be able to keep answers apart, and not mix them up.

Ah, I missed that, sorry.

I agree with @Deva_Rishi about 4x AA NiMH rechargeable batteries, I would also recommend that as an option. With most good quality battery chargers, 4x fully charged cells will not exceed 5.5V and so can be connected directly to the Arduino's 5V pin. The danger with that arrangement is that someone might accidentally replace the rechargeable cells with non-rechargeable cells, which would be around 6V and would damage the Arduino if connected directly to the 5V pin.

However I would not agree with using a 9V block battery. These have very low capacity, especially rechargeable ones, and a significant percentage of that already low capacity will be wasted by the Arduino's regulator as heat when it regulates 8~9V down to 5V.

OK, thanks all for your responses.

@Paul_B
I just need one led per lamp.

@Deva_Rishi
Thank you, it is more clear now.

So i will begin with that :

  • 1 Arduino Nano 3
  • 1 Led Flora
  • 1 breadboard and cable to play before soldering :slight_smile:
    I will begin to play with that, learn the bases and will probably come back for coding question, but i will try to learn first.

For the battery, do you know if it can be charged by the Arduino if i put the usb cable or i have to charge separately ?

I also saw on the Adafruit website how to wire the led on the Arduino.
In their example it is an Arduino Uno, but it should be the same with the Nano I guess. I might order both (Uno and Nano), just to have fun and learn.

Then a simple RGB led is easy to wire up and cheaper. They come in common cathode or common anode types, either ok. You will need 3 resistors, suggest 2x 100R (for blue and green) and 1x 150R (for red).

Separately. Some more advanced and expensive Arduino models have the ability to charge a li-ion or lipo battery pack.

Seriously, don't buy Uno. Uno and Nano 3 are basically the same, but only Nano is truly breadboard compatible.

OK, thank you.
So I will start playing with the Nano.

It is not easier to wire up. and when buying barebones ws2812b's the price difference is marginal.
In the end it's either/or.

I avoid putting them on a breadboard though. It is so tempting to try and lift it out by putting pressure on the USB port, but it is not strong enough for that.

Yes it's the same.

Again i more or less agree, though i do have an UNO for most testing purposes and uploading. I have made adapters for the boards i upload to, and then the difference between the male and female header pins is none, and with an UNO at least the female headerpins face upwards, which makes it easier to insert the males.

OK, well, I'll stick with my first idea, and test both.
I'll take a Flora LED.