✨MY OUTPUT DEVICE🎀
Hey there sis, welcome to this week's assignment where we're gonna learn everything about output devices. Let´s do it together!
For this week’s dazzling project, I’ll design a chic electronic board featuring an ESP8266 microcontroller that will turn on a lamp with the help of a relay. I won’t use the WiFi on the ESP8266, just its microcontroller capabilities.
So I know what y´all are thinking WHAT IS AN OUTPUT DEVICE?!!💻
An output device is a component or module that receives electrical signals from a microcontroller or microprocessor and translates these signals into a specific physical action or response. This action can be visual, auditory, mechanical, or any other form that provides tangible feedback.
So for this week´s assignment🌸✨I´m doing a sleek, elegant setup where the ESP8266 microcontroller, though not flaunting its WiFi powers this time, commands transistors and relays with the grace of a runway model. This board will turn on and off a lamp with such sophistication, it’ll be the envy of all my tech friends.
An output device is all about taking commands from the microcontroller and translating them into real world actions. Here’s why our setup fits the bill
This sleek electronic design features the ESP8266 at its core. While it's not using its WiFi capabilities this time, the ESP8266 skillfully controls a lamp, making it shine brightly. Here's how it works The ESP8266 sends 3.3V signals to an optocoupler, which isolates and protects the microcontroller from the high power components. ▶️Control with Precision --> The optocoupler activates a transistor, which acts as a switch for the relay. The relay, in turn, controls the lamp, deciding when it turns on and off. ▶️Reliable Protection --> Protection diodes are added around each relay coil to safeguard the transistors and the ESP8266 from voltage spikes, ensuring the components remain safe and functional. ▶️Programming with Ease --> The ESP8266 is programmed using a board with a CH340 chip, which allows for easy and reliable programming. This setup ensures that the lamp operates smoothly, turning on and off as desired.
OH HONEY AND HOW DO U KNOW ALL THIS? WEEEEEELLL..... TAKE A LOOK AT THE NEXT LINK
Our group weekly task ---->
How does this work?
So this is a pretty cute summary about how this is going to work guuuuuurl👩🏽💻
- Sophie´s Fab academy ✨NETWORKING and COM
🧚🏼♀️ Optocoupler 🧚🏼♀️ 🌷Function: An optocoupler (or optoisolator) is a component that transfers electrical signals between two isolated circuits by using light. It provides electrical isolation and protection for sensitive components. 🌸Working: Inside an optocoupler, an LED (light-emitting diode) is turned on by a signal from the microcontroller (ESP8266). This LED shines on a phototransistor, which then conducts current in the isolated part of the circuit.
🧚🏼♀️Relays🧚🏼♀️ Transistors amplify these signals to control the relays. 🌸Function: A relay is an electrically operated switch that allows a low-power control signal to switch a high-power load, like an AC lamp. 🌷Working: When the phototransistor in the optocoupler conducts, it activates a transistor that powers the relay coil. This coil generates a magnetic field that closes a switch, allowing high-power current to flow and power the AC lamp.
🧚🏼♀️HOW THIS WORKS🧚🏼♀️ 🌸Control Signal: The ESP8266 sends a low-power control signal (3.3V) to the optocoupler. 🌷Isolation and Activation: The optocoupler activates, allowing current to flow through its phototransistor. 🌸Signal Amplification: This current activates a transistor, which amplifies the signal enough to power the relay coil. 🌷Switching the Load: The relay coil, now powered, closes its internal switch, allowing AC power to flow to the lamp, turning it on. 🌸Safety and Protection: Diodes are often used across the relay coil to protect against voltage spikes, and the optocoupler provides isolation to protect the microcontroller.
🧚🏼♀️MANAGING DIFFERENT POWER LEVELS🧚🏼♀️ 🌸Low-Power Side: The ESP8266 and the optocoupler operate on low power (3.3V from the ESP8266). 🌷High-Power Side: The relay handles high power (typically 5V for the coil and 120/220V AC for the lamp). The transistor helps bridge the low-power control signal to the high-power relay coil.
MY SIMPLE DIAGRAM ISH 🌸ESP8266 (3.3V output) → Optocoupler (input side, LED) 🌷Optocoupler (output side, phototransistor) → Transistor (base) 🌸Transistor (collector) → Relay Coil (one end) 🌷Relay Coil (other end) → 5V Power Supply 🌸Relay Contacts (COM and NO) → AC Lamp
- NET AND COM WEEK
POWER SETUP ----> 🎀Connect the 5V power supply to the input of the AMS voltage regulator. 🎀Connect the output of the AMS voltage regulator to the VCC pin of the ESP8266 (3.3V). 🎀Connect the ground (GND) of the power supply to the GND of the ESP8266.
ESP8266 CONNECTION ----> 💞Connect GPIO pins D1 and D2 on the ESP8266 to the anode of the 4N25 optocouplers through 1k resistors. 💞Connect the cathode of the 4N25 optocouplers to the GND of the ESP8266.
OPTOCOUPLER AND TRANSISTOR CONNECTIONS ----> 🌸Connect the collector of each 4N25 optocoupler to the base of the 2N2222 transistors through 1.2k resistors. 🌸Connect the emitters of the 2N2222 transistors to the GND.
THE RELAY CONNECTIONS ---> A relay is an electrically operated switch that uses a low power signal to control a high power circuit. Here are the main parts of a typical relay
NEXT UP LAMP CONNECTIONS ----> 💝Connect the common terminal (COM) of each relay to the AC power supply. 💝Connect the normally open (NO) terminal of each relay to the lamp’s AC input.
PROTECTION DIODES ----> 💖Connect diodes across the relay coils for protection. The cathode connects to the side of the relay coil that’s connected to 5V, and the anode connects to the side connected to the transistor collector.
PRGRAMMING PINS ----> 💗Connect the four extra pins for programming the ESP8266 (TX, RX, GND, VCC) to a CH340 programmer.
INITIAL SET UP ▶️ ESP8266Powered by the AMS regulator at a fabulous 3.3V ▶️ Resistors Protecting and limiting current to keep everything chic and functional ▶️ Optocouplers Elegantly isolating control from power ▶️ Transistors Acting as glam switches for the relays.
BLINK CYCLE ➡️Turning On The ESP8266 sends a HIGH signal (3.3V) to the optocoupler.Activation: The optocoupler activates the transistor.Relay On: The transistor allows current to flow, activating the relay.Lamp On: The relay closes the AC circuit, turning the lamp on.Wait: The system pauses for a glamorous second.Turning Off: The ESP8266 sends a LOW signal (0V) to the optocoupler.Deactivation: The optocoupler deactivates the transistor.Relay Off: The transistor cuts off the current, deactivating the relay.Lamp Off: The relay opens the AC circuit, turning the lamp off.Wait: Another fabulous second of pause.
🐽Begin with the smaller components like resistors and diodes.
🐽Place the resistors (1.2k, 1k, and 10k) into their designated positions, bend the leads, and solder them in place. Trim excess leads.
🐽Solder the diodes in place, ensuring correct polarity (cathode to the marked side) → Solder the transistors (2N2222) ensuring correct orientation (emitter, base, collector) → Place and solder the optocouplers (4N25) → Solder the flyback diodes across the relay coils.
🐽Place the AMS voltage regulator, ensuring correct orientation, and solder.
🐽Place the AMS voltage regulator, ensuring correct orientation, and solder.
🐽Insert the ESP8266 into the PCB, soldering each pin carefully.
🐽Solder the relays into their positions.
🐽Solder the extra programming pins (TX, RX, GND, VCC) to the ESP8266 for future programming.
🐽Connect the 5V power supply input to the AMS regulator.
🐽Ensure all GND connections are properly connected to a common ground.
🐽Connect the CH340 programmer to the programming pins.
🐽Write and upload the Arduino blink code to the ESP8266 to test the relay operation → Power up the board and observe the relays clicking on and off as per the blink code.
🐽Connect the AC lamp to the relay’s NO (Normally Open) and COM (Common) terminals.
🐽 Ensure the lamp blinks on and off in sync with the relays.
-
1. ESP8266 12-F Microcontroller: Used purely as a controller. 🌟
-
ESP-12-F: The microcontroller🧠
-
3. Relays (x2): To control the lamp with signals from the ESP8266. 🔄
-
4. Transistors: To activate the relays with 3.3V signals from the ESP8266. 💅
-
5. Protection Diodes: To protect the transistors and ESP8266 from voltage spikes generated by the relays. 🛡️
6. Resistors and Capacitors: For proper operation of the transistors and signal filtering. 📏
7. Power Connector: (I USED AN AURDINO SOURCE OF 5V)) To connect the 5V power source. 🔌
8. Programming Board with CH340: To program the ESP8266. 💻
TO KNOW ALL ABOUT THIS NETWORKING AND COMMUNICATION BOARD PLEASE GO TO -->
So as we know... an output device is all about taking commands from the microcontroller and translating them into real world actions. Here’s why our setup fits the bill:
❥All about the connection diagram❥
For this PCB design I used PCB wizard because she´s my girl and the cutting software I used was V-Carve, programmed my PNG file at MODS and that was the deal.
TO SEE ALL ABOUT THE NETWORKING COMMUNICATION WTH THE PLUG CLICK HERE---->
NOW THAT WE KNOW ALL ABOUT THE RELAYS LET´S CONTINUE WITH THE DIAGRAM:
SO IN A NUTSHELL....This chic setup ensures your ESP8266 can control an AC powered lamp elegantly. The optocouplers gracefully isolate the control signals, the transistors switch the relays on and off, and the flyback diodes protect your components. The result? A glamorous and perfectly functioning lamp control board! 🌟💡✨
Here's how to connect all these components in a chic and fabulous way
STEP BY STEP GLAMING PROCEDURE WORKING
IN A NUTSHELL...This board uses the ESP8266, optocouplers, transistors, and relays to control a lamp powered by AC. The chic Arduino Blink code sends the perfect signals to turn the lamp on and off, showing how our design acts as an elegant output device. It's the perfect blend of glamour and functionality
And what about the assembly? ...
And now HOW I SOLDERED EVERYTHING WITHOUT DYING IN THIS PROCESS...First I started by preparing my workspace. Ensured it was clean and gathered all my components, including a soldering iron, solder, flux, etc... Began by inserting the 1.2k, 1k, and 10k resistors into their designated PCB spots, bending the leads gently and securing them in place. Heat each connection point with your soldering iron and apply a small amount of solder, trimming excess leads with a cute wire cutter for that perfect touch. Next, place the diodes in the correct orientation (cathode to the marked side) and solder them with precision and grace, ensuring each joint is smooth and shiny. Insert the 2N2222 transistors, making sure the emitter, base, and collector are correctly oriented, and solder them carefully while maintaining your fabulous composure. Install the 4N25 optocouplers to separate the power section from the control section, soldering them into position as flawlessly as your favorite outfit. Attach the flyback diodes across the relay coils to protect your components, soldering them neatly to avoid messy connections. Place and solder the AMS voltage regulator to convert 3.3V to 5V, ensuring the joints are tidy and sparkling. Insert the ESP8266 into the PCB and carefully solder each pin, checking that all connections are solid and secure. Place and solder the relays, ensuring they are properly aligned, and double-check that each relay is firmly in place. Solder the extra programming pins (TX, RX, GND, VCC) for future programming, ensuring these connections are accessible and beautifully done. Connect the 5V power supply and verify all connections using a multimeter to check for shorts and ensure continuity. Finally, connect the CH340 programmer to the programming pins, upload the Arduino blink code to the ESP8266, and test the relay operation. Ensure the lamp blinks in sync with the relays, indicating successful functionality. With these steps, you'll create a fabulous, sparkling lamp control board that's not only functional but also dazzlingly chic✨
/p>So for the electronic design software, like I said before, I used PCB wizard cuz honestly I don´t like at all KiCad, for me it was so much easier to draw what I wanted for the components disposure and to draw lines between them so I understood it better. I used the Roland SRM for the milling process and used obviously MODS for the programming, Vcarve for the cutting process software.
All about the programming
Okay so for the programming you can see all about the plug I made to program this esp board on week 6 and now everything I talked about was all bout this board I made for using the programer that has the relays on it!
I did this code in week 6 Week 6 embedded programming for the plug to pass it on this board, I tried it and it was just perfect, this was the code:
And the components honey?
All you need to know about what I used and why is above👇🏽
My gorgeous table of components
SOPHIE´S OUTPUT DEVICE🎀 |
Where to buy? | Amount | Price | Total price |
Relevador 5V DC SRD-5VDC-SL-C | UNIT electronics | 2 | $15.00 MXN/unit | $30.00 MXN |
AMS1117 3.3V | Digikey | 1 | $12.80 MXN/unit | $12.80 MXN |
1.2 k capacitor 122 | Amazon | 2 | $122.00 MXN/unit | $1.00 MXN |
ESP-12-F | Mercado Libre | 1 | $90.00 MXN/unit | $90 MXN |
1k resistor 1001 | Mouser Electronics | 2 | $1.14 MXN/unit | $2.24 MXN |
10k resistor 1002 | Mouser Electronics | 4 | 1.60 MXN/unit | $6.40 MXN |
Diodes | Mouser electronics | 2 | $0.25 MXN/unit | $0.50 MXN |
transistor 2n2222 | Tostatronic | 2 | $2.00 MXN/unit | $4.00 MXN |
Male pins | Tostatronic | 2 | $7.00 MXN/unit | $14.00 MXN | Optoacoplador 4n25 | Tostatronic | 2 | $16.95 MXN/unit | $5.00 MXN |
Total cost | $165.94 MXN |
Now look at how it worked out and the cute pics