2016

AVR USB RGB LED Controller Project

This project uses an ATtiny45 microcontroller to control an RGB LED strip based on CPU usage. It’s a cool-looking project that uses the V-USB library to communicate with the PC without needing a USB-to-TTL serial converter.

AVR USB RGB LED Controller 

Hardware

The project uses an ATtiny45 microcontroller and ZVN4306A MOSFETs to control the RGB LED strip, with each color consuming only about 90mA of current. The MOSFETs are more efficient and produce less heat, allowing for more current to flow.

Firmware

The firmware uses Timer 0 and Timer 1 to implement PWM control of the LED strip at 500Hz, and Timer 0 also keeps track of milliseconds for idle timeout. The EEPROM saves the delay setting every 4 seconds, which helps extend the lifespan of the EEPROM and the LED color transition time. When the idle timeout is reached, the LED strip starts cycling through blue, green, and red colors until it receives USB data again.

Host Program

The host program is written in C and is compatible with Windows and Linux. It can set the LED color based on CPU usage or set a single static color. The setting is saved to the EEPROM, so it will restore to the previous setting when the PC is restarted.

Alternative

IR Interferer Circuit Based on 555 Timer: Notes on Power Supply Voltage and Transistor Selection

I built a simple circuit based on a 555 timer to interfere with infrared (IR) communications such as TV remote controls. When I first made it (October 2011), the circuit was unreliable in interfering with IR signals and eventually stopped working. It wasn’t until I recently bought a mini DSO that I discovered the circuit required at least 6.5V to reach the 38KHz frequency, while the 9V battery I was using was running out of power and couldn’t provide enough energy to reach 38KHz. After connecting it to a clean 9V power source and adjusting it to 38KHz with the help of the mini DSO, the interferer finally worked perfectly.

It’s worth noting that the transistor, 470R and 5R6 resistors, and 1N4148 diode form a constant current source of approximately 125mA to drive the IR LED. This will make the transistor quite hot. With a 9V power supply voltage and an LED Vf of 1.6V, the voltage drop across the transistor will be 6.8Vce, producing 850mW of heat at 125mA. This is actually higher than the rated 630mW of the 2N4401 transistor I used, so please make sure to choose the correct transistor to avoid problems.

[Schematic source (50 – 555 Projects on Talking Electronics)]

Microcontroller PWM Controller: A Design Based on ATtiny25 and MOSFET

I recently designed a PWM controller based on a microcontroller and MOSFET, which can control high-current loads. It’s a bit like a PWM controller based on a 555 timer, but now using a microcontroller and MOSFET instead of a 555 IC and transistor.

I made two versions, one with acceleration and deceleration switches, and another with a potentiometer. The controller uses an ATtiny25 microcontroller, running at 31.25KHz (8MHz internal RC/256 prescaler), powered by 3.3V. I used an STP36NF06L MOSFET, with a maximum 0.045Rds and 2.5Vgs, which is suitable for 3.3V power supply. The MOSFET produces only ~180mW of heat at 2A, which doesn’t require a heat sink.

In the circuit diagram, if using a 5V power supply, R1 should be changed from 100R to 150R to keep the current below 40mA. Zener diodes D1 and D2 are used for ESD protection, requiring a voltage rating above the uC power supply voltage and below the maximum gate voltage of the MOSFET. The STP36NF06L MOSFET can easily switch ~8A, but requires some heat sinks. The potentiometer selection also needs to consider the microcontroller ADC reading and current consumption.

Update – July 10, 2013

I recently designed a new …

From Arduino to AVR Microcontrollers: My Electronic Journey

I’ve been following Arduino and finally got my hands on an Uno and a 16×2 character LCD with RGB backlight. This new electronic world is exciting me. For years, I’ve been interested in digital control devices like LCDs, wondering how to use them, but was always blocked by the complexity of microcontrollers. However, using Arduino’s LCD library made it easy to connect the LCD, and I quickly made a stereo audio VU meter and a basic FFT spectrum analyzer.

Next, I started exploring wireless technology. I bought NRF24L01 wireless modules, a USBASP AVR programmer, a USB to UART converter, and an ATMega168 microcontroller from Ebay. Using the Mirf library, I successfully made one controller change the LCD backlight color of another controller.

After getting used to the Arduino IDE, I wanted to dive deeper into how the code truly controls the chip. So, I downloaded Atmel Studio 6, the ATMega168 chip datasheet, and followed tutorials on avrfreaks.net to learn the basics of AVR microcontrollers, starting from timers and interrupts. Now, I’ve grasped the basics of AVR microcontrollers and have many project ideas involving AVR uCs.

EaseHome: Unlock the Future of Smart Home Automation

EaseHome is a revolutionary smart home chatbot that lets you control and monitor your home with ease. Using natural language processing and machine learning, EaseHome understands your voice commands and responds accordingly, making it easy to manage your home’s temperature, lighting, security, and more. With EaseHome, you can experience the future of smart home automation today.

Getting Started

EaseHome Tutorial

EaseHome: Unlock the Future of Smart Home Automation

Welcome to EaseHome: A Smart Home Chatbot Tutorial

Imagine being able to converse with your home, effortlessly asking questions like “What’s the current temperature?” or “Are all doors locked?” and even controlling your home’s settings with simple voice commands like “Set the kitchen temperature to 19°C!” This futuristic vision, inspired by movies like “Minority Report,” is now within reach. In this tutorial, we’ll explore how to integrate a cutting-edge text recognition system into a smart home system using the Microsoft Bot Framework and Language Understanding Intelligent Service (LUIS).

The Dream of a Smart Home

Rev Up the Future: Building the Ultimate Autonomous RC Car with EaseCar

Get ready to revolutionize the world of remote-controlled cars with EaseCar, a cutting-edge project that’s about to take autonomous driving to new heights. Imagine a car that not only responds to your every command, but also navigates through obstacles with ease, all while live-streaming its journey to the world.

What sets EaseCar apart is its innovative fusion of multiple technologies, creating a seamless and immersive experience that tackles real-world challenges. This isn’t just about controlling a car with voice or gestures – it’s about creating a futuristic vehicle that can think for itself.

As a seasoned developer with a passion for IoT, I wanted to push the boundaries of what’s possible with intelligent hardware and software. I envisioned a project that would not only impress, but also provide tangible value to users. That’s why I embarked on this ambitious journey, combining the latest advancements in Intel Edison, computer vision, and machine learning to bring EaseCar to life.

In this series of tutorials, we’ll take you on a step-by-step journey to build EaseCar from the ground up. Whether you’re an experienced…

LED Flashing Circuits Design

Apart from using LEDs as power indicators or Joule thieves, I haven’t really used them much, so maybe it’s time to create something really fancy! 😊

I searched for some LED flashing circuits that can control at least 4 LEDs with minimal components, and finally found two circuits that I liked, both using Schmitt trigger oscillators, one that makes LEDs fade in and out, and another that feeds BCD to a 7-segment driver IC, making 7 LEDs flash randomly. 

Fader [HERE]
Random flasher [HERE]

Push-Pull Circuit

The push-pull circuit uses one Schmitt trigger for each LED, and since Schmitt trigger ICs usually have 6 triggers, it’s no problem to make 6 LEDs fade in and out at different rates. The downside of this circuit is that it will never fully turn on the transistor/LED, with a maximum current of only 4mA through the LED.

Since I want the LEDs to fade in and out at different rates, I couldn’t use the same resistor/capacitor values for all oscillators. Here is the table of resistor values used for each oscillator, with all capacitors having the same value (2.2uF / 22uF).

LeadR1R2R3
1100k4.7k47k
215k+27k2.2k15k
327k+47k4.7k47k
447k+100k4.7k47k

PWM Fan Controller Design Based on 555 Timer

I designed three slightly different PWM fan controllers based on the 555 timer, used to control a large server fan – Delta FFB1212EHE, with a peak current of 3A and a normal load of 2A. The other features of these controllers include: boosting the fan to 100% for the first few seconds after power-on, and a “turbo” button to set the fan speed to 100% while pressed.

Version 1 (July 2010) of the controller did not work as expected during startup, staying at 0% instead of 100%. Another problem was that it would occasionally slow down to almost stopping, and I had to reset it to recover normal operation. I don’t know what caused this problem, but it seems to have no effect on later versions.

Version 2 (January 2011) fixed the startup boost problem by using a PNP output transistor. I changed the startup boost timer to reduce component count, but now the timer capacitor has a slow discharge time. Because of this, turning the controller off and back on too quickly would bypass the startup boost, as the capacitor voltage would still be above the 555 reset voltage threshold (~0.7V).

Version 3 (February 2011) is the same as Version 1, but with a PNP output transistor instead of …

Joule Thief Circuit: A DIY Experiment and Comparison

If you’ve never heard of a Joule Thief, it’s a simple voltage booster circuit that can power small loads like LEDs using a single battery, even ones that other devices consider “dead”.[Wikipedia article]

I built two versions of the Joule Thief circuit. One is the common version, using a single transistor, resistor, and coil, as shown in Wikipedia articles. The other version uses 2 transistors, 3 resistors, a capacitor, and an inductor, which I found online.[Here]

Both versions work well, but there are differences between them. The common version can operate at a lower voltage, around 0.6V, but consumes more current. The other version consumes much less current, 12mA, and 60mA at 1.3V, resulting in a slightly lower brightness, but with a small difference. In the common Joule Thief, I used a 2N4401 transistor, and in the other Joule Thief, I used a 2N3904 transistor.

During the experiment, I also tried to optimize their efficiency, observing their performance at different voltages. I found that both versions work well, but they have differences in voltage and current, and the right version should be chosen based on the actual situation.

Homemade FM Radio Transmitter Experience

I recently made a small FM radio transmitter, which can broadcast within a range of 100m-200m with a 12V power supply, and the audio quality is decent. The microphone of this transmitter is very sensitive, and with a 5pF-30pF variable capacitor, it can be tuned between 87.5MHz and ~98MHz. However, at higher frequencies, the transmitter becomes less stable and more difficult to tune.

During use, I found that the transistors and capacitors of the transmitter would change frequency due to heat, mainly caused by the Q2 transistor. Although the heat change is small, it still affects the stability of the transmitter.

I referred to the three circuit diagrams in the link, using a TL062 dual op-amp instead of a TL061 single op-amp, and added a switch to select between microphone and audio jack input. Moreover, I replaced R4 (100K) with a variable resistor to observe how its value change affects audio quality. The result shows that the value change of R4 has little or even negative effect on audio quality.Schematic source