# Simple circuit design and build help required

#### judders76

Mar 24, 2022
8
Hello,
First of all, please excuse me for barging into your forum but I am in need of some assistance.
I have no experience with electronics but need a simple circuit designed to control some 12v LED lights in an artwork that I am making. I have no idea where to start and I was hoping someone could point me in the direction of a company, individual, service who would be prepared to design and build me a one off circuit. Obviously I would be willing to pay for this. I think its a pretty simple circuit (but I don't really know) I have described it below. if anyone thinks that can help or knows someone who can I'd be really grateful.

It is essentially 3 separate 12v LED lighting circuits A,B,C with 3 possible selectable Positions of off, on, cross fade dimming.

Position 1:
Circuit A and C on. Circuit B off

Position 2:
Circuit A and B on. Circuit C off

Position 3:
20 second cross fade between positions 1 and 2 with 20 second hold in each position 1 and 2.

I hope this makes sense. If anyone is interested or needs more information please get in touch.

Thank you.

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,102
Welcome to our forum.
I can't build this for you, but it shouldn't be difficult.
For one: Circuit A is always on, so it is out of the equation. Simply connect circuit A permanently to power.
This leaves these 3 scenarios:
1. circuit C on, circuit B off
2. circuit C off, circuit B on
3. fade between 1 and 2.

This can easily be done wirh a simple microcontroller. The artist's controller of choice would be an Arduino, e.g. an Arduino Nano or an Arduino Uno.
- the LED circuits. Do you have any idea which LEDs you are going to use? Single color or multicolor? Number of LEDs?
- depending on the LEDs you may possibly require driver circuits (or not, see below).
- a suitable power supply.

I'd recommend you use addressable RGB LED strips (based on WS2812B LEDs). These can be driven directly by an Arduino without extra driver circuits. The length of the strips can be adjusted by cutting the strips. The color can be adjusted in software. All you need then is a 5 V power supply that can supply enough current for the LEDs and the Arduino.
Plus a few lines of code. Someone here may have the time to put together the code or look on an Arduino forum. You should be able to do some from examples available on the internet. Most of the work already has been done, look up the FastLED library which is available for exactly the kind of LED strips I recommended.
You may want to have a look at what can be done and how easy it is here.

#### judders76

Mar 24, 2022
8
Thank you so much for this. Arduino looks incredible. Although I'm not sure I have the time/headspace to learn a new skill for this project, you have piqued my interest for further projects! Exciting possibilities.

LED wise, for reasons of cost and ease, I was planning on using off the shelf, single colour, 'fairy light' string LEDs as they allow me to describe complex shapes and are cheap and bright. They require 32v DC which is presumably stepped down from 240v AC in their plug/transformer. Do you think that is a daft idea?

Welcome to our forum.
I can't build this for you, but it shouldn't be difficult.
For one: Circuit A is always on, so it is out of the equation. Simply connect circuit A permanently to power.
This leaves these 3 scenarios:
1. circuit C on, circuit B off
2. circuit C off, circuit B on
3. fade between 1 and 2.

This can easily be done wirh a simple microcontroller. The artist's controller of choice would be an Arduino, e.g. an Arduino Nano or an Arduino Uno.
- the LED circuits. Do you have any idea which LEDs you are going to use? Single color or multicolor? Number of LEDs?
- depending on the LEDs you may possibly require driver circuits (or not, see below).
- a suitable power supply.

I'd recommend you use addressable RGB LED strips (based on WS2812B LEDs). These can be driven directly by an Arduino without extra driver circuits. The length of the strips can be adjusted by cutting the strips. The color can be adjusted in software. All you need then is a 5 V power supply that can supply enough current for the LEDs and the Arduino.
Plus a few lines of code. Someone here may have the time to put together the code or look on an Arduino forum. You should be able to do some from examples available on the internet. Most of the work already has been done, look up the FastLED library which is available for exactly the kind of LED strips I recommended.
You may want to have a look at what can be done and how easy it is here.

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,102
32 V LEDs will require additional driver circuitry. It can be done but is probably beyond your current skills.
5 V monochrome LED strips are available (example) but will also require a (simple) driver as the Arduino can't supply enough power. This is an example of a simple driver board (1 per LED strip required)

You could use ws2812 RGB LEDs and use them in monochrome mode only, then you will not need additional drivers. The circuit becomes really simple (at the cost of a higher price for the LED strips, but imho still reasonable):

Here the LEDs for group A need to be initialized to be ON in software, the LEDs for groups B and C are controlled according to the scenarios you described.
You will have to add a means to select one of the 3 scenarios. You could use a 3-position switch as input to the Arduino or you could use a single pushbutton to cycle between the scenarios. Or 3 pushbuttons to select one of the scenarios.
Or without any input to the Arduino let the Arduino cycle automatically between the scenarios.

#### judders76

Mar 24, 2022
8
Thank you again, this is really useful. I've been looking more at the Arduino and may have a go at this myself but still really have no idea what I'm doing!
I just have a small issue with the LEDs. The particular effect I am going for requires me to have very small point sources that I can inset in a board (see attached image example) which I can't do with LED strips. I have looked at LED strings (like
WS2811 RGB Full Color 12mm Pixels digital Addressable LED String DC 5V) but each LED is too big. Could I power the 'fairy light' 32VDC LED's from their native, supplied transformer and still control them using the Arduino?

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,102
You will need a suitable driver module, one for channel B, one for channel C. This module can be used.

You do not need a driver or a connection to the Arduino for channel A as channel A is always on. Connect channel A directly to the LED power supply.

#### judders76

Mar 24, 2022
8
Once again, thank you!

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,102
Have you decided how to switch between the 3 scenarios?

#### Simon mugo

Mar 27, 2022
4
Hello,
First of all, please excuse me for barging into your forum but I am in need of some assistance.
I have no experience with electronics but need a simple circuit designed to control some 12v LED lights in an artwork that I am making. I have no idea where to start and I was hoping someone could point me in the direction of a company, individual, service who would be prepared to design and build me a one off circuit. Obviously I would be willing to pay for this. I think its a pretty simple circuit (but I don't really know) I have described it below. if anyone thinks that can help or knows someone who can I'd be really grateful.

It is essentially 3 separate 12v LED lighting circuits A,B,C with 3 possible selectable Positions of off, on, cross fade dimming.

Position 1:
Circuit A and C on. Circuit B off

Position 2:
Circuit A and B on. Circuit C off

Position 3:
20 second cross fade between positions 1 and 2 with 20 second hold in each position 1 and 2.

I hope this makes sense. If anyone is interested or needs more information please get in touch.

Thank you.
Of course this is a simple task although I cant do it for you. You need to learn some few basics about KiCAD schematic maker check this link https://www.pcbway.com/blog/PCB_Design_Layout/step_by_step_on_introduction_to_KiCAD_6b13ce2d.html which will help you understand how to make this schematic. You will also need to learn how to code an arduino board which will be the best controller board for the project. With arduino you can be able to even do a simple simulation on KiCAD. To learn basics on Arduino click on the link https://www.theengineeringprojects.com/category/arduino-projects
Thank you!

#### judders76

Mar 24, 2022
8
Have you decided how to switch between the 3 scenarios?
No I haven't. I think maybe a single push button which cycles between scenarios?
I'm going to buy the necessary components and read up and try my best to work this out.
If I get stuck would it be ok to ask for guidance?

#### judders76

Mar 24, 2022
8
Of course this is a simple task although I cant do it for you. You need to learn some few basics about KiCAD schematic maker check this link https://www.pcbway.com/blog/PCB_Design_Layout/step_by_step_on_introduction_to_KiCAD_6b13ce2d.html which will help you understand how to make this schematic. You will also need to learn how to code an arduino board which will be the best controller board for the project. With arduino you can be able to even do a simple simulation on KiCAD. To learn basics on Arduino click on the link https://www.theengineeringprojects.com/category/arduino-projects
Thank you!
Hi,

Thanks for responding. It's clear the consensus is Arduino all the way. I'm going to have a go.

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,102
If I get stuck would it be ok to ask for guidance?
Of course, that's what we're here for.

#### judders76

Mar 24, 2022
8
Hi all,

A while back you were all kind enough to point me in the right direction for a simple circuit control device (Arduino) for an art project I am working on. I have made some progress but have an issue which I can't seem to resolve.
After much struggling and little progress I employed the services of someone on Fiver who kindly wrote some code for me.
On the simulation they provided the code works perfectly BUT when I wire it up to my Arduino there is a strange bug which I cannot seem to pin down and I wondered if anyone can cast their eye over the code/my wiring and see if they can spot the issue.

The code is supposed to do the following:

I have 3 LED circuits: on outputs 9,10 and 11 respectively.
I have 3 states/options: 0,1 and 2
I have a toggle button that should toggle between the three states.

The three states are as follows:

State 1: Outputs 11 and 9 @ 100% brightness. Output 10 @ 0% brightness.
State 2: Outputs 11 and 10 @ 100% brightness. Output 9 @ 0% brightness.
State 3: Output 11 remains @ 100% all the time. Output 9 begins at 100% ,holds at 100% for (x) seconds and then over a period of (y) seconds output 9 fades down to 0% WHILE over the same period output 10 fades up to 100%. Once that stage is reached there is a hold for a further (x) seconds and then the process reverses ie Output 10 fades down to 0% over a period of (y) seconds WHILE at the same time output 9 fades up to 100%. This state is held for (x) seconds and the loop begins again ad infinitum.

The issue:

When I begin from a cold start and newly load the code State 1 is called. This works fine

When I press the toggle button once State 2 is called BUT instead of remaining in State 2, after about 4 seconds it appears to move on to State 3. It then remains in State 3 until the button is pressed again.

I have added a link to the code and simulation. It is more than likely my error but I am flummoxed.

https://wokwi.com/projects/328315144940552788

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,102
after about 4 seconds it appears to move on to State 3.
It is supposed to do that and the simulation shows this clearly:

This is where it happens in the code:
Code:
 else if (option == 2) {

if (check == false) {
Serial.println("A to 100% and C to 100%");
analogWrite(11, 255);
analogWrite(10, 0);
analogWrite(9, 255);
Serial.print("delay ");
Serial.print(delaytime / 1000);
Serial.println(" seconds");
check = true;
myMillis = millis();
}

if (check && millis() > myMillis + delaytime) {
check = false;
pwmvalue = 0;
pwmvalue2 = 255;
option = 4;
Serial.println("fade B to 100%, C to 0%");
}

}

#### judders76

Mar 24, 2022
8

You are quite right. Based on my explanation it does look like that. However I realise I haven't been very consistent or clear about the labelling of the states/options so I'll try and be a bit clearer.

What I should have said is:

When I begin from a cold start and newly load the code, Option 0 is called. This works fine

When I press the toggle button once Option 1 is called BUT instead of remaining in Option 1, after about 4 seconds it appears to move on to Option 2. It then remains in Option 2 until the button is pressed again.

So essentially on my board when I run it there is no break between option 1 and option 2. Option 1 just appears to run into option 2. This is what the serial monitor shows on a cold start and a single button press.

I hope this makes more sense. Thanks for being patient!

Replies
6
Views
1K
Replies
45
Views
8K
Replies
9
Views
743
Replies
18
Views
1K
Replies
7
Views
907