Posts

ATTINY25/45/85 Low Power Led Flasher

Connect Led to PIN PB0 0f Tiny25/45/85 (Pin No.5) Code: //ATTINY25/45/85 #include <avr/sleep.h> #include <avr/wdt.h> #ifndef cbi #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) #endif #ifndef sbi #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) #endif int pinLed = 0; volatile boolean f_wdt = 1; void setup() {   pinMode(pinLed, OUTPUT);   // 0=16ms, 1=32ms,2=64ms,3=128ms,4=250ms,5=500ms   // 6=1 sec,7=2 sec, 8=4 sec, 9= 8sec   setup_watchdog(9);    // approximately 8 seconds sleep } void loop() {   if (f_wdt == 1) { // wait for timed out watchdog / flag is set when a watchdog timeout occurs     f_wdt = 0;     // reset flag     digitalWrite(pinLed, HIGH); // let led blink     delay(70);                  //On Time     digitalWrite(pinLed, LOW);     pinMode(pinLed, INPUT); // set all used p...

ATTINY13 Low Power Led Flasher

Connect led to pin PB0 of Attiny13 (Pin No.5) Code: //ATTINY13A #define F_CPU 1200000UL       // MCU frequency in hertz #include <avr/io.h> #include <avr/wdt.h>        #include <avr/sleep.h>      #include <avr/power.h> #include <avr/interrupt.h>  #include <util/delay.h> #define led 0                 // PB0 int main( void )              // similar to void setup () {   wdt_reset();                // first you need to reset the Wachdog   // otherwise there may be a reboot   pinMode(led, OUTPUT);   while (1) {                 // perpetual loop, analog of void loop ()     digitalWrite(led, HIGH);     _delay_ms(50);            // On Time ...

Solid State Relay

Image
Solid State Relay Solid State Relays are semiconductor equivalents of the electromechanical relay and can be used to control electrical loads without the use of moving parts Solid State Relay Example Lets assume we want a micro-controller with a digital output port signal of only +5 volts to control a 120V AC, 600 watt load (heating element or lamp). For this we could use the MOC3020 or MOC 3041 opto-triac isolator, but the internal triac can only pass a maximum current (Itsm) of 1 Amps peak at the peak of a 120V AC supply so an additional switching triac must also be used. First lets consider the input characteristics of the MOC 3020 opto-isolator (other opto-triac are available). The opto-isolaters datasheet tells us that the forward voltage, (Vf) drop of the input light emitting diode is 1.2 Volts and the maximum forward current,(If) is 50mA. The LED needs about 10mA to light reasonably bright up to its maximum value of 50mA. However the digital output port of the Micro...

Disable Drive Signature Enforcement

Disable Driver Signature Setting ---> Update & Security ---> Recovery ---> Advanced Startup ---> Click Restart After Restart Choose --- Troubleshoot Advance Option Startup Setting ---> Restart Again After Restart In Startup Setting Window Disable Drive Signature Enforcement  Restart After Restart In Startup Setting Window 7) Disable Drive Signature Enforcement (To Choose The Setting Press F7 Key) PC Will Reboot. -------------------------------------------------------DONE

How to Flash ESP8266 Modules

Image
Method 1: Auto Resetting Programmer Using a NodeMCU Flash ESP-01 easily with your NodeMCU Basically we are going to disable the ESP8266 on the NodeMCU by forcing the EN pin low, this will prevent the ESP8266 module on the NodeMCU from booting. We are then going to connect all the relevant pins of the NodeMCU board to our external ESP8266. Wiring it up To wire it up, you will need the standard ESP8266 wiring as shown in the previous step and then to add the following connections (also shown in the image above): ·          Connect 3V of the NodeMCU to VCC of the ESP8266 ·          Connect GND to GND ·          Connect TX of the NodeMCU to TX of the ESP8266 (This is different than the previous step) ·          Connect RX of the NodeMCU to RX of...