In this week we were asked to design, mill and program a board that gives a tangeable output, such as: moving a motor (Physical), making sound using a speaker (Audio) or maybe control a LED (Visual).
Furthermore, I decided to make my own board in order to control my RGB strip LED tha will be used in the final project.
I'll talk briefly about my process,using Eagle software as usual.
I connected the wires as shown below after reading schematics of the voltage regulator and the N-MOSFET.
In order to export the board WITH the holes drew you have to make sure those layers are the visible ones:
You might wonder why I added or how I added the holes?
Why? Because later on I believe I'll need to fix the board into any material using wood. How?
1- search for hole tool.
2- right click on the hole you made and click on properties.
3- change the dimension as you want it (Make sure from the grid that you're working with the unit desired for example mm) (2.9 to make sure that the hole is tight for a 3mm screw )
I used arduino to program my board as usual like I did in my Electronics Desgin week.
My code purpose was to get the minimum to maximum range of colors using the 3 colors in the LED strip, so I made a code that increments 1 in each color every 0.25 sec. until it gets the maximum brightness.
#define R_PIN 5 //Pin coming from the N-MOSFET to the ATTiny pins. #define G_PIN 6 //Pin coming from the N-MOSFET to the ATTiny pins. #define B_PIN 7 //Pin coming from the N-MOSFET to the ATTiny pins. int R=0, G=0, B=0; //initializing 3 varibales for the (Red, Green, Blue) variations void setup() { pinMode(R_PIN, OUTPUT); //Defining the LED strip pins as output pinMode(G_PIN, OUTPUT); //Defining the LED strip pins as output pinMode(B_PIN, OUTPUT); //Defining the LED strip pins as output } void loop() { for(int i=0; i<250; i++) // loop that increments the value/brightness of each LED strip pin simultaneously by 1 { analogWrite(R_PIN, i); analogWrite(G_PIN, i); analogWrite(B_PIN, i); delay(250); // delay to observe the change of brightness. } }
Note: The fingers on the board is used to sense the heat in case of any high temperature occurance from the MOSFETs or the Voltage regulator.