The situation: there are two bathrooms, which have fans controlled manually.
The goal:
- To switch on a bathroom fan when the certain humidity level is reached;
- To switch on both fans is somebody is using the toilet;
Let’s go.
Continue readingThe situation: there are two bathrooms, which have fans controlled manually.
The goal:
Let’s go.
Continue readingThe next step of my small project was an embedding of the ultrasonic sensor to it.
Let me try to make it work with pic16f628a.
Continue readingI was developing a small DIY project where the humidity should be controlled, the microcontroller for the brain is our good old friend – pic16f628a.
Starting as usual from the datasheet reading.
Continue readingIt was a hot, really hot, really very hot summer in 2012 in place where I used to live. I bought some cheap fan, though it was quite powerful, but there were two major drawbacks for me:
I needed to get my hands on the encoder, so I started to explore things around it.
First of all, what is the encoder? This is a thing that helps to convert the rotation angle and a direction of rotation to some numbers we can use for our further advance.
Usually, the encoder has three terminals, to connect it I have used the following circuit:
All resistors have a nominal equal to 4.7KOhm.
Continue readingI was working on my personal project – an audio amplifier and needed the LCD display functions, I had already described in my experiments the way to do so, but there were some flaws, so here we are again. What do we need?
Let’s look at USART module in pic microcontroller (uart module).
I’m going to move in two ways:
1. Using existing functions from a hi-tech compiler.
2. Writing my own functions.
USART = UART = SCI – the universal data transmitting/receiving protocol, which can work in synchronous and asynchronous modes. We pay attention to the second mode at the moment, this one is used for communications mostly.
Continue readingI choose the software realization of the I2C protocol as the next experiment. There isn’t a description of this protocol, only realization. The curious soul should google it, there is a lot information on i2c subject.
So:
Goal: To make the connection between PIC16f628a and IO port expander PCA9539 by i2c
What we have: PIC16f628a, PCA9539, devboard.
Why do I need it (in short): I have one project in development state for now. The project is a clock with a thermometer and two seven-segment indicators: the first 4-digit and the second has 3 digits. To control it I need 8+4+8+3 = 23 IO pins, but PIC16f628a has only 16, so in the such configuration, it seems not real to me. In the beginning, I thought about shift register using, but suddenly I received free sample sets from NXP and I took the decision to use PCA9539. In this case, there are only 9 pins to be used, and two pins from it are for I2C communication between pic micro, RTC clock, and the thermometer.
Continue readingGoal: To write and read EEPROM
What we have: PIC16f628a and a simple devboard.
Microcontroller PIC16f628a has 128 bytes of EEPROM memory on board, not too much but we have what we have. Hi-tech PICC compiler has internal functions for work with EEPROM, but here I’m going to make some my personal functions.
Let’s look at the EECON1 register:
Continue readingThe goal: To adjust the LED brightness using the PWM module.
What we have: PIC16f628a and devboard + proteus.
Continue reading