Quantcast
Channel: LCD Projects - PIC Microcontroller
Viewing all 253 articles
Browse latest View live

PIC KICK TWEET !

$
0
0

This is an Instructable showing you how to integrate Twitter in your embedded application. Watch this Instructable in Action http://www.instructables.com/id/PIC-KICK-TWEET-1/

Working: A desktop application is created with ease for grabbing the latest tweet from your twitter account. The application then forwards the tweet to the serial port to which the embedded device is connected. A firmware is written to capture the tweet sent by the application. The tweet is displayed on the 16×2 CLCD on the embedded device.

Stuffs your need to complete this Instructable with ease:

  1. A Workstation with a USB port.
  2. Internet connectivity for the Workstation.
  3. A Twitter account from which the tweets are to becaptured.
  4. Processing IDE for creating the desktop application.
  5. MPLABX IDE with C18 compiler for writing the firmware for the microcontroller.
  6. A PIC KICK development board from www.entesla.com.
  7. Enthusiasm.PIC KICK TWEET

For Beginners I would like to brief you to about Processing, MPLABX and PIC KICK….

Processing (or processing.org as known on the web) is a an opensource programming language and environment for people who want to create animations and interactions with a variety of devices and other applications with ease. Initially targeted at artists and designers with no prior programming experience for prototyping, today it is also used by students, researchers, hobbyist and  even professionals to rapidly prototype their ideas by making desktop applications without breaking a sweat. The language is itself based on the popular programming language Java but you need not know Java to start Processing. Processing runs on Windows® OS, MAC® OS and Linux.

MPLABX IDE is a graphical, debugging toolset for all of Microchip’s product line of microcontrollers and memory devices.It includes a feature-rich editor, source-level debugger, project manager, software simulator, and supports Microchip’s popular hardware tools.Based on the open-source NetBeans platform, MPLAB X runs on Windows® OS, MAC® OS and Linux, supports many third-party tools, and is compatible with many NetBeans plug-ins.

PIC KICK is an embedded system development board by ENTESLA for Microchip’s 40 pin 8-bit microcontroller. It is a low cost kick start board designed to help professionals, students and amateurs to explore the capability of PIC16, PIC18 architecture and practice application development for various interfaces with minimal hardware reconfiguration. It features a USB-Serial converter on-board, leds,buttons,16×2 Character LCD, Analog Input using a potentiometer and USB. It comes pre-programmed with the ds30Bootloader which makes it easy to program via usb-serial port. And yes.. you can power it using your workstation’s USB port.

Step 1: Setup your Twitter

  1. If you already have a twitter account jump to the developers page for twitter at https://dev.twitter.com/  If you do not have a twitter account create one and jump to the developers page.
  2. Sign In to your twitter account from the developers page.
  3. Create a new application as shown in the image.
  4. Describe your application to twitter.
  5. Goto the Settings tab. Under Application Type select Access type to Read,Write and Access direct Messages. Wait for a couple of minutes and check if the change has been reflected in the Details tab.
  6. Twitter uses OAUTH authentication protocol for authenticating applications before they access a twitter account. More about OAUTH at https://dev.twitter.com/docs/auth/oauth/faq
  7. Once the Access type has been changes Create Access tokens for the application under the Details tab.
  8. It may take a moment to generate the Access tokens. Once created, goto the OAUTH tool tab to find the keys that you need for authenticating the application that you will be making it the next few steps. Copy these keys to your notepad. Do not share these keys with others.

Download the attached images to clearly view the steps mentioned above.

The most critical step is done now. You now need to create you application before you can start accessing the tweets!

Step 2: Firmware for PIC KICK in MPLABX

As mentioned before, we are going to display the tweets on the 16×2 CLCD present on the PIC KICK development board. To accomplish this you need to write a firmware for interfacing the on-board PIC18f4520 microcontroller with CLCD and routines for transmitting and receiving data on the UART. This seems to be a challenging job for beginners. Thankfully ENTESLA provides libraries with demo codes for these peripherals. The user can use these libraries as reference or use them in their applications for rapid prototyping.

If you are eager to set the PIC KICK in action without making any changes in the firmware jump to the next step..otherwise..

The ready-to-use code for the twitter application project for PIC18f4520 can be found as a .zip attachment to this Step. The code works with MPLABX and C18 compiler. You need to download MPLABX with the C18 compiler and install it before you want to make changes to the firmware.

The firmware provided is pretty straight forward and is well commented.PIC KICK TWEET schematic

Step 3: Flashing the Microcontroller

The PIC KICK development board comes pre-programmed with the ds30 bootloader. You can flash the microcontroller with the code easily via the USB-UART bridge on-board. You need not buy/build a separate programmer.

  1. Download the utility used to program the PIC microcontroller.
  2. Download the .hex file to flash the microcontroller from the attachment to this Step.
  3. Execute the ds30 Loader GUI found in the downloaded folder.
  4. Configure the utility with the COM port number assigned to the PIC KICK development board from device manager.
  5. Configure the Device as PIC18f4520 and Baudrate as 9600.
  6. Click Program. You may have to press the RESET button on the PIC KICK board to invoke the ds30Bootloader.

 

For more detail: PIC KICK TWEET !

The post PIC KICK TWEET ! appeared first on PIC Microcontroller.


RC5/RC6 codes on a LCD using PIC16F648A

$
0
0

A simple project to test and display the transmitted codes from remote controls which work with the RC5 protocol, like the TV remotes from Philips, just aim the remote control at the TSOP1736 IR-receiver.
If you only want to know the code from a button then you can ofcourse also look at the RC5 tables from this website.
The only thing you need is a PIC16F648A or 16F628A (with feeding ofcourse), a HD44780 LCD and a TSOP1736 infrared receiver.

RC5 LCD

Program 1
The first one works only with the RC5 protocol and must be programmed in a PIC16F648A.
When PORTB.0 (pin 6) is connected to GND then the numeric values from system, command and toggle are displayed in binair and decimal.
If PORTB.0 is not connected (just leave it open) then the system and commands are displayed as functions, i.e. system Amplifier and command Volume +.

Program 2
If there’s no PIC16F648A in stock or you want also decode RC6 signals, then program the second .HEX file in a PIC16F628A.
Program 2 can not give function names, so PORTB.0 has no function here.
The second .HEX file displays the numeric values from system, command and toggle in binair and decimal on the LCD.

LED’s
A LED connected on PORTA.3 returns the toggle signal.
The green LED flashes if an infrared (IR) signal is being received, the red LED if the received signal is poor or if it’s not a RC5/RC6 code and the yellow LED if only a ‘glitch’ is received.
You can leave these LED’s if you don’t need this information.

Attention: The TSOP1736 (= 36kHz IR-receiver) must connected via a 470Ω resistor to +5V and over the + and – pin a tantalium capacitor of minimal 1µF!

 

For more detail: RC5/RC6 codes on a LCD using PIC16F648A

The post RC5/RC6 codes on a LCD using PIC16F648A appeared first on PIC Microcontroller.

Andy Robison’s Lab Notebook using pic microcontroller

$
0
0

Week 01

January 14 (2 hours):
Met as a team after class to discuss preliminary project proposal.

January 15, 2010 (1 hours):
Met as a team to discuss design implementation and assign different components to research.

WEEK 01 SUMMARY
Accomplishments: Submitted preliminary project proposal.
Weekly Work Total: 3 hours
Project Work Total: 3 hours

Week 02

January 20, 2010 (4 hours):
Met as a team to formulate PSSC for presentation in class. The team also solidified part requirements and packaging ideas, which included the design of custom clear keys and the use of an LCD monitor under the keys to change the key characters.

Andy Robison's Lab NotebookJanuary 21, 2010 (3 hours):
Met as a team to finish the final project proposal. Researched ways to implement VGA, Unicode, and a touch screen in the design.

WEEK 02 SUMMARY
Accomplishments: PSSC and project proposal finalized.
Weekly Work Total: 7 hours
Project Work Total: 10 hours

Week 03

January 24, 2010 (2 hours):
Browsed the internet for a touchscreen solution. Settled on the LCD-010, which is designed for electronic projects and has sample code for a range of microcontrollers listed on the Gravitech page.

January 27, 2010 (1 hours):
Met as a team to discuss what parts we would select for our major components and what interface standard we would use for the computer interface.

January 28, 2010 (3 hours):
Met as a team to discuss design requirements. Discussed options for microcontrollers and determined what information still needed to be researched before a final microcontroller selection could be made. Divided the parts among group members to be researched. Objective of research was to determine the number of pins required for each component and electrical characteristics.

January 30, 2010 (3 hours):
Found electrical schematic for LCD and datasheets for the LCD and onboard graphics controller, touch screen controller, and octal bus transceivers. Determined that the LCD requires a +5V supply, but all onboard chips are +3.3V.

Datasheets:
1. LCD Schematic
2. Graphics Controller
3. Touch Controller
4. Octal Bus Transceiver
5. Summary of Pins

WEEK 03 SUMMARY
Accomplishments: Design constraints set for selecting components.
Weekly Work Total: 9 hours
Project Work Total: 19 hours

Week 04

January 31, 2010 (2 hours):
Met as a group to discuss our individual findings for components. Selected a microcontroller and FPGA for generating VGA output to the LCD screen that will display the characters under the screen.
Chose the following components:
Microchip PIC32MX575F512L microcontroller
Altera Cyclone II FPGA
3M SD card reader
Atmel Flash IC chip
The PIC microcontroller was chosen because it has 3 SPI ports, which will be needed to read the touch coordinates from the touch screen, as well as interface with the SD card reader, and Flash chip.

February 4, 2010 (3 hours):
Met as a group to complete HW3: Design Constraints Analysis.

WEEK 04 SUMMARY
Accomplishments: Completed the Design Constraint Analysis and chose the major components for the project.
Weekly Work Total: 5 hours
Project Work Total: 24 hours

Week 05

February 9, 2010 (2 hours):
Met as a group to prepare for TCSP 3 and begin HW4.  Created a 3D CAD drawing that would give a fairly accurate representation of the position of each component within the overall package.  Then we made a preliminary layout for the keyboard PCB and the motherboard PCB.

February 10, 2010 (3 hours):
Met as a group before class to complete TCSP 3.

Met as a group again later to create a parts list and order the major project components.  During the TCSP presentation, David suggested using a daisy chain of shift registers to read the entire keyboard layout at once instead of using the PLD design.  This requires an additional SPI interface to connect the keyboard to the microcontroller, so a different microcontroller was chosen from the same PIC family, which has 4 SPI ports.
Chosen microcontroller:
Microchip PIC32MX695F512L

February 11, 2010 (6 hours):
Talked with Chuck after class about how to create the keys for the keyboard. He was confident that we could find pushbuttons/switches small enough to fit under each key. He also suggested that I check the board manufacturer’s web site to see what all they offer in the $33 Each package, which is the one that we will be using in the course. Unfortunately, they do not do any cutouts or tabs on the boards, so the slots that the transparent keys are mounted over will have to be cut in house, which Chuck says is not a big deal. We just have to remember to draw the slot outline on the PCB’s solder mask and keep traces as far from the cutout edges as possible.

I downloaded the demo version of PADS and completed the first 2 of 4 tutorials on the website.

Met as a team later to complete HW4.

WEEK 05 SUMMARY
Accomplishments: Ordered parts, chose more appropriate microcontroller, and created CAD drawings of the package and PCB designs.
Weekly Work Total: 11 hours
Project Work Total: 35 hours

Week 06

February 14, 2010 (7 hours):
Continued working through the PADS tutorials, including the microcontroller tutorial.

Met as a group to begin HW5: Theory of Operation and Hardware Design Narrative. We created a much more detailed layout of the keyboard PCB with the footprints for the shift registers instead of the PLDs used previously. We also researched and chose resistor packs and very small push buttons to be used to implement the key-press circuits. The following two pushbutton options were discussed:

10 K 15 resistor pack

The resistor packs were chosen to save space on the PCB rather than place individual resistors for each signal trace on the board.

February 15, 2010 (5 hours):
Today I finished the PADS tutorials in preparation for creating the schematics for the keyboard and mainboard PCBs.  I then began searching through the microcontroller documentation for pinouts.  I needed to determine which pins were for general purpose I/O (GPIO) as well as determine which pins were used for the SPI ports, since our design requires all 4 SPI interfaces.  The pin-out diagram for out microcontroller package documents which peripherals and ports each of the pins is mapped to.
I assigned the SPI ports to all of the peripherals first, and then I assigned all of the pins on Port E to the touch screen graphics data port for simplicity.  The rest of the connections are control signals that were assigned to GPIO in a configuration that I felt would be easiest for PCB layout.

February 16, 2010 (4 hours):
The microcontroller has several sets of power and ground pins, which each need bypass capacitors placed placed across them.  Section 2 of the microcontroller documentation has a recommended layout which I duplicated in our schematic.   CEFC is used to stabalize the internal regulator and was recommended to be 10uF in the Electrical Specifications section of the documentation.
I also searched through the documentation for the pins which will be required for programming and debugging.  The PIC32 has both ICSP and JTAG pins for programming and debugging the microcontroller.  It was recommended that they all have 50ohm resistors in series for ESD protection.
I created a PCB footprint and schematic symbol in my PADS library for the microcontroller.  I labeled the function of each pin in the schematic as it pertains to our design instead of labeling every function that each pin is capable of, as in the pin-out diagram in the documentation.

February 17, 2010 (5 hours):
Finished the first draft of the microcontroller schematic for the TCSP presentation.  I created a sheet for the microcontroller in PADS with off page connectors to the other peripherals to make the schematic easier to read.

I consulted with Luke about how the FPGA would be implemented and what connections would need to be made to the FPGA, both to the microcontroller and the flash memory.  To make the connections to the VGA connector, I found a chart online with the VGA pinout and a brief description of each pin’s function.
I continued to create schematic symbols in my PADS library for the other major design components on the mainboard.

February 18, 2010 (5 hours):
Today I finished the mainboard schematic except for the power supply circuit and keyboard, which are being drawn up by Dhruv.  Using PADS, the power and ground nets from the power supply circuit will automatically be connected to the rest of the design once the power supply sheet is added.
The first draft, which was submitted for homework 5 can be found here.
I found a website for the SD card pin-outs and used the following diagram for our schematic:

February 19, 2010 (1 hour):
Today I looked over all of the schematics, including the Power and Keyboard schematics drawn up by Dhruv to double check for mistakes before submission.  I then purchased the LCD-010 touch screen.

WEEK 06 SUMMARY
Accomplishments: This week, I searched through the microcontroller documentation to find pin-outs, electrical requirements, and programming pins.  I then decided which pins would need to be used in our design, such as the SPI ports, and organized the connections for the easiest PCB layout.  Once this was done, I created schematic symbols and PCB footprints for all of the major components and completed the first draft of the mainboard schematic in PADS.
Weekly Work Total: 27 hours
Project Work Total: 62 hours

Week 07

February 21 (3 hours):
Dhruv and Luke ordered several of the parts and sent me a BOM so that I could get PCB footprint information for our specific parts.  I then worked to create PCB footprints and link them with the schematic file in PADS.

I manually created the SD card footprint from the datasheet.

February 22, 2010 (4 hours):
I spoke with Dhruv and we decided it would be best if we divided the PCB work between the two of us, so I will be designing the mainboard layout and he will take the keyboard layout.  I spoke with Chuck about which headers we had available in lab for making connections to things off of the board.  He pointed out the 0.1″ pin pitch headers in lab and said that there are tools in lab for making connectors to mate with them.  It also happens that PADS has a generic footprint for headers with this pitch already.  I updated the schematic with connectors for the keyboard and PS/2 and linked the connectors to these PCB header footprints.  I also added a schematic symbol and PCB footprint to my PADS library for the SPI flash memory chip in the new BOM, and added a sheet for the SPI flash to the mainboard schematic file.

February 23, 2010 (10 hours):
I added the power supply schematic as a new sheet in the PADS mainboard schematic.  PADS already had PCB footprints for the regulators, and a 0.1″ header will be used to connect to the AC/DC converter card.  I created a custom footprint for the current limiters, which was just 2 plated through holes spaced according to the datasheet.  I noticed that the 3.3V regulator was only rated for 250mA, which may not be adequate given all of the 3.3V parts.  I placed all of the footprints on a preliminary board layout for the TCSP and looked at different layout possibilities to minimize trace length and reduce the number of vias.   The correct PCB footprint for the FPGA is yet to be determined.

February 24, 2010 (12 hours):
I spoke with Dhruv after the TCSP presentation and we decided that the voltage regulators would be in drop-out since they were being supplied by switching voltage supplies with exactly 3.3V and 5V outputs in the current design.  The voltage regulators need an input voltage that is higher than the output voltage, so the 3.3V switching regulator will be removed from the design and the 5V AC/DC converter will supply the 5V rail.  This should be fine since the only 5V part is the touch screen, and it has a 3.3V regulator on board.  I added up the power requirements for all of the parts we have so far, and found that our current 3.3V regulator does not supply enough current to make me feel comfortable with it.  I found another 3.3V regulator from Microchip which uses the 3 lead TO-220 package, which is a very standard package and pin-out for voltage regulators, including some already in lab.

With these changes, I redrew the power supply schematic and linked the components to PCB footprints in PADS.
Luke determined exactly which FPGA package we will be needing for our design, and I found pinout descriptions on the Altera website.  I updated our schematic to reflect the recommended capacitor placements and power requirements of the FPGA.  The core voltage of the FPGA is 1.2V, instead of 3.3V, so another regulator was added to the power supply circuit.  I also changed the PCB footprint linked to the schematic for the FPGA.

February 25, 2010 (11 hours):
Today I created a new PCB layout, again taking trace length and the number of vias into account. I used the 1206 package for all of the capacitors and resistors, which is surface mount, and placed all of the bypass capacitors on the bottom layer, underneath the supplied IC whenever possible. For both the microcontroller and FPGA, the capacitors were specified to be within 1/4″ of the power and ground pins. The FPGA was very difficult to fit all of the capacitors next to and run all of the traces to the power and ground pins, especially since there are two power nets on the FPGA. Once all of the bypass capacitors were placed, I ran the power and ground traces first, with an effort to minimize the size of current loops on the board since these would create noise in the data lines. I also avoided making right angles whenever possible, which could create manufacturing problems. For the sake of time, and because I know more design changes are coming, I autorouted the rest of the traces. This will be inadequate for the final design, since the autorouter does not make very smart decisions when it comes to the previously mentioned considerations.

Andy Robison's Lab Notebook

Version 1 of the PCB

WEEK 07 SUMMARY
Accomplishments:
Weekly Work Total: 40 hours
Project Work Total: 102 hours

Week 08

March 2 (10 hours):
The FPGA is capable of doing much more than what we need it to do (displaying a static VGA image). So, since the image we are displaying is static and very simple, we will generate our own VGA signals and get rid of the FPGA, since it would require another programmer, a 1.2V power supply net, and quite a bit of real estate on the PCB to do a very simple task. Luke and Ethan created a block diagram and a new list of parts for the VGA circuit, which I used to update the schematic and PCB footprints in my PADS library.

In addition to the components indicated in the block diagram, I added a level translator recommended by Chuck to interface the 3.3V logic of the SRAM IC to the 5V logic of the PLDs, which will generate the sync pulses.
The new schematic for the VGA circuit is as follows:
With the FPGA now removed from the design, the 1.2V regulator is no longer necessary. The current limiters were also removed from the power supply design since they weren’t necessary, resulting in the following design:

Once the schematic was updated, the new netlist was pushed to PADS Layout, and a new PCB layout was created. Again, I manually rounted the power and ground traces to ensure that current loops were minimized, and manually connected the bypass capacitors to the appropriate power and ground pins on all of the ICs. Once this was done, I autorouted the rest of the traces since a few more modifications to the VGA circuit are still being discussed.

For more detail: Andy Robison’s Lab Notebook

The post Andy Robison’s Lab Notebook using pic microcontroller appeared first on PIC Microcontroller.

An “Antique Radio” Christmas Present

$
0
0

I happen to be part of the 5% that have the elusive awesome mother-in-law. For Christmas I wanted to make her an “antique radio” that is super simple to operate and that could play some “old time radio” type programming that she listened to when she was a young’n. However, this is neither an antique or a radio, its an MP3 player. I named it “Radio Betty” after her.

Step 1: The MicroMite controller

I had been playing with a pic microcontroller that has a built in basic interpreter, that cost only $4.00. The MicroMite was introduced by Geoff Graham of the MaxiMite computer fame, and it has turned out to be a great little controller for many of my projects. It is super simple, yet powerful for such an affordable chip. The built in functions of this powerful little beast allowed me to implement a 2004 lcd display, two KY-040 encoders, a serial MP3 module, a DS3231 real time clock and an Infrared receiver to make a nice “antique radio” without pulling out what little is left of my hair.

His website describing the MicroMite is http://geoffg.net/micromite.html and there is a great user forum at www.thebackshed.com

A video review of the chip can be found here.

Take a look at this for your next microcontrolled project.An Antique Radio Christmas Present

Step 2: The Circuit

The circuit was first laid out on a breadboard in order to test the functionality of each of the modules being used and test the software, after which I used Autotrax Dex to create the schematic of the unit. As you can probably tell by looking at the schematic, this was my first attempt at using a pcb design program to make a project. It’s not NASA quality by any means, but it does work.

Step 3: Lets make a PCB

Once I spent a little time with AutoTrax Dex, I decided to take the plunge into having my very first PCB commercially made. This program took a bit of learning, like anything else, but proved to be a great experience for a first time and has given me the confidence that this is the way to do things going forward.

Step 4: From China with Love

AutoTrax Dex created all the files needed to have a PCB made. I used Itead Studios in China as their pricing was incredibly reasonable. It took about 3.5 weeks to get the board back and you can bet I was nervous about this working out of the box. I scoured the Interweb for information concerning drill hole sizes for the different components used and once the boards came, I immediately plugged in all the parts to make sure they fit. While waiting for the boards, I couldn’t stop thinking about part leads not fitting into their holes. Thank goodness, it all worked. Thanks Interwebs!!!

Step 5: Let’s stuff this thing

It only took about 45 minutes to get everything soldered up and powered. I must have the luck of the Irish as this little unit fired right up.

Step 6: Front Panel

My day job puts me in a well equipped sign shop so I took advantage of the situation and used some scrap acrylic and digital printing to create the front panel for the “radio”

Step 7: Front Panel 1

A piece of 1/8″ black acrylic was laser cut to accept the 2004 lcd display, the two encoders and the TSOP4838 infrared receiver. I used 4-40 flat head screw and by using 3 stacked nuts as spacers, the LCD wound up flush to the face of the acrylic.

Step 8: Front Panel 2

LCD display mounted to front panel. This worked out nicely using the 3 nuts as spacers.

Step 9: Front Panel 3

The front panel with all the parts installed.

Step 10: Front Panel 4

A piece of .040 clear acrylic was used to make the front panel graphics. I created the print in Photoshop using a “parchment paper” graphic and added the type and floral graphics to that. The design under “Radio Betty” has a hole cut in the print in order for the infrared receiver to “see”. The only holes that go completely thought the acrylic are for the two encoder shafts. The infrared and LCD area are only cut out of the print, not the acrylic.

Step 11: Front Panel DoneAn Antique Radio Christmas Present schematic

All put together and ready to install in the wood cabinet.

Step 12: Time to cut some wood

I used 3/4″ poplar for the visible parts of the cabinet and plain plywood for the speaker faces as they would eventually be covered up and not seen.

Step 13: The Cabinet 1

The fronts of the four upright panels were shaped using a 3/8″ round over router bit on each side to create a full half round, after which a bit of sanding with 220 grit sandpaper made for a smooth finish. The two inside uprights were slotted on a table saw to fit the front panel between them.

 

 

For more detail: An “Antique Radio” Christmas Present

Current Project / Post can also be found using:

  • project proposal about pic microcontroller
  • pic microcontroller assembly projects
  • pic microcontroller kit with lcd display

The post An “Antique Radio” Christmas Present appeared first on PIC Microcontroller.

Vehicle security with GSM

$
0
0

The main aim of making GSM Based Vehicle Theft Alert System is to apply the electronic theories, modern security methods, embedded system, and modem age of science and technology for many kinds of transport machine. Moreover this GSM Based theft Alert System can reduce cost, time and many steps without tiring for human because using of easy handling step. Most of vehicle theft alert system doesn’t contain high microcontroller. That why this system is using of high technology microcontroller system. The effect of this system the security system is stronger and more secure. This GSM Based Theft Alert System can control any distance and no need wireless access. No need many step and no worry for difficult step. Because in this system have only on step to respond. The theft cannot steal easily for these kinds of system and the theft cannot do next time that kind of case on same vehicle using this GSM based vehicle theft alert system.Vehicle security with GSM

Secondary Aim of this project is to show many useful things with GSM technology and by using of this GSM based system every electronic object are easy and safely for the human life. And then to know the advantage of GSM communication system is not only using in connecting but also controlling on electronic objects. GSM technology is very familiar with in human nation. Most of human have cell phone so this cell phone can affect many kind of advantage in living environment. There are many kinds of controlling system is the world among them GSM based controlling is smarter and more easy for controlling step.

The 3rd aim is to show the useful of microcontroller base product and the effect of this project with microcontroller. In this project microcontroller is the main part of this GSM based vehicle theft alert system. The programming in the microcontroller is very secure and the very easy to use with any mobile telecommunication SIM.

Step 1: List of component

List of component

Step 2: PCB Design

Step 3: Testing and ResultVehicle security with GSM schematic

Step 4: Block Diagram

In this project PIC microcontroller is the 1st main part of the project. 2nd main part is GSM modem and Relay. The power supply is the main source of the whole system. This block diagram is the presenting of the GSM based vehicle theft alert system. According to the diagram power supply is start point. And then all of the controller and component will worked each of their parts and their duty. The main connection of power supply is Relay driver, PIC microcontroller and GSM modem. And them the microcontroller is connect with 3 main part of the system. These connections are Relay driver to drive the relay, Theft switch to get the signal from theft attacking condition and GSM modem to send and receive the message signal to the owner and from the owner. Relay driver is connecting with the relay because this relay driver is needed to drive the relay to cut the ignition system. The relay driver will start work when it gets the command from the PIC microcontroller. This commend is to work the relay the connection with the car better and engine. The set and rest button is also connected with the PIC microcontroller. For the system 1st step need to push the set push button and then work the system. After the whole system finish push again to the reset push button to work the whole system again.

 

 

For more detail: Vehicle security with GSM

The post Vehicle security with GSM appeared first on PIC Microcontroller.

Arduino solar charge controller + output control and data logging online with Xbee WiFi

$
0
0

A while back I started working on a solar charge controller, it was based on a PIC microcontroller, a 20×4 characters display and the code was written in Assembly language. It did work well and was still working when I decided I wanted to add more to this controller.

My new controller uses a standalone ATMega328P, and a 1.8″ tft screen from Saintsmart. I wrote the code with the arduino IDE and uploaded ( many many times 😉 ) straight onto the board with the standalone uP. I had a lot of solar cells at home so I decided to build my own solar panel to go with it. Not sure of the achieved wattage, it is not so great but it still gives 23 to 24 volts when it is not connected.

This new controller has a button that allows you to turn ON or OFF an output, where the voltage from the battery is applied and where you can connect anything like LED lights, power inverter or any other devices. Maximum output is 20 Amps for this design.Arduino solar charge controller + output control and data logging online with Xbee WiFi

The features of this new controller are:

– Possibility to charge 6V, or 12V types batteries. (24V included in software but needs a small modification on the electronic side)

– Automatic detection of the type of battery connected.

– Push button to turn ON and OFF the output stage of the controller.

– Push button to display different information on the screen like total charge time, number of charging days, min and max battery voltages recorder, temperature, LUX values outside, maximum charging current and Watts as well as maximum output currents and Watts.

– All these values are saved to the EEPROM once a day when the ambient light goes down and are reloaded at start up.

– Possibility to erase the EEPROM and start with fresh readings, as well as possibility to delete the total charging time and days.

– The temperature of the battery is used in the software to reduce the charging values if it goes above 25° or raise them if it is lower than 25°.

– Information is sent to the IoT (Internet of Things) once every 5 minutes to be able to keep an eye on how things are going when I am not at home. Check out my channel to see what it looks like and what information is sent over by the controller. https://thingspeak.com/channels/17599

– Automatic disconnection of the load connected to protect the battery and prevent over-discharging.

– Bulk charge, followed by 1h of constant voltage charge followed by float charge.

– Maximum charging current supported by the controller is 10 Amps, maximum output current is 20 Amps.

– Maximum solar voltage input is 30V in this configuration.(limited by the 7805 maximum input voltage)

– Current consumption while on standby and not charging the battery is <10 mA.

Step 1: Build one yourself, what you need

If you wish to build one of these controller yourself then here is the list of material and all the steps needed.

I wont show the build of the solar panel here as this instructable focuses on the solar charge controller.

I have kept the fuses off the board, this is why nothing will appear on this list. I have a 10Amp fuse on the solar panel wires and a 25Amps fuse on the output wires.

Material needed:

1x prototyping board

1x ATMega328P (28pins through hole)

1x 16MHz oscillator

2x 22pF capacitors

1x 1000uF 100V electrolitic capacitor

1x 220uF 16V electrolitic capacitor

1x 100nF capacitor

1x 10nF capacitor

5x 1uF ceramic capacitor

1x 82 Ohm resistor

6x 100 Ohm 1% resistors

4x 1 kOhm resistors

4x 2.2 kOhm resistors

4x 10 kOhm resistors

2x 5 mOhm resistors (3W minimum)

2x IN4007 diodes

1x Power diode MBR1045

2x STB80PF55 P-chanel MOSFETS

2x 2N2222 NPN transistors

1x reset push button

1x LM35 temperature sensor

1x LDR light sensor

2x 25 kOhm 10 turns potentiometers

2x 100 kOhm 10 turns potentiometers

3x 2pins 20Amps screw terminals

1x 6pins 20Amps screw terminals

2x LT6105 current sense amplifiers

2x adapters for MSOP to DIP packages (8pins)

1x 7pins male headers

2x 6pins male headers

1x 4pins male headers

1x 3pins male headers

1x 2pins male headers

1x 7805 (TO220 package) 5V regulator

1x Xbee Wifi + shield or interface ( I used the shield from Sparkfun as I had one handy)

1x 1.8″ tft screen from Saintsmart

2x panel push-buttons

1x panel ON – OFF selector switch

heatsinks for the MOSFETS diode and the 7805 (it tends to get warmish at times)

And of course the usual soldering iron, hookup wires, drill and drill bits to cut tracks and make mounting holes.

Step 2: Soldering the main board + sketch and libraries

Start by soldering the main board. There is a picture of the way I wired my prototype board to help.

I made the drawing using Black Board software. You can use it as a guide or just make up your own layout.

There is also the schematics of the controller attached, to refer to for resistors values etc if needed.

Once done, you can download the sketch I made up for the controller and there is a few libraries that you might not already have installed that you ll need to install.

They are:

Adafruit_GFX.h ; download here if needed https://github.com/adafruit/Adafruit-GFX-Library

Adafruit_ST7735.h ; download here if needed https://github.com/adafruit/Adafruit-ST7735-Librar…

EEPROMex.h ; download here if needed http://thijs.elenbaas.net/downloads/?did=6

Step 3: Thingspeak website and setting up the Xbee

The data collected by the charge controller is pushed onto a website called Thingspeak. This is where I can log in and check on my charge controller when I am not at home. You can access it here to create an account and setup your own channel. https://thingspeak.com/users/sign_up. If you don’t want this feature on your charge controller you can just comment out the xbee() in the main loop section of the program and it will not take care of this while running.

If you do want to be able to check on your controller on the internet then you will have to create your own channel. Once you have created it, you will be given an API key. This key is important and will be needed in the arduino code so keep it handy. You can then setup the channel, There is 8 fields of data that are sent from the charge controller, so in your channel under the “channel settings” tab, enter the information as follow for the fields.

field 1 — solar voltage

field 2 — battery voltage

field 3 — charge current

field 4 — charge PWM

field 5 — output current

field 6 — battery charged

field 7 — temperature

field 8 — luminosity

My code for the charge controller does not create a connection for the Xbee every time it needs to send data. I have already programmed my Xbee with my personal WiFi settings using the X-CTU software.
There are some good tutorials on the internet on how to connect your Xbee and communicate with it using X-CTU. This one is very good and will get you on your way. https://learn.sparkfun.com/tutorials/xbee-wifi-ho…

Follow the tutorial to get the Xbee connected to your personal WiFi network.

Once done there is a few parameters that we will change into the Xbee to get it setup to connect onto the Thingspeak website as this is where all the data will be sent.

Change or check the following settings:

– IP protocol needs to be set to “1-TCP”

– DL- destination IP address needs to be set to “184.106.153.149”

– DE- destination port needs to be set to “50”

Once these settings have been changed, press the “write” button to store these settings into your Xbee.

You have now successfully setup your Xbee to push data onto your channel at Thingspeak.

Next, open the “Solar_charge_controller” sketch and look for line n° 1150

The line should be: xb.print(F(“key=YOUR_API_KEY_HERE”));

Delete the parts which says YOUR_API_KEY_HERE and replace it with your own personal API key that you received when you created your channel on Thingspeak. Make sure you don’t delete key= because it will not work without it.

Step 4: Powering up and loading the code

Once the board is all done, it is time to power it up and load the code into the micro-controller. I forgot to add that this ATMega328P was already bootloaded so all I need to do is load up the program onto it.

There is some pretty good tutorials out on the internet on how to setup and program a standalone ATMega if someone needs more information.

  1. – In the case of this board, first thing you need to do is to load the Arduino ISP example sketch onto your arduino board.

2. – In the second picture I commented to show which header is used for programming and which pins is pin number 1.

3. – Wire your arduino to your board this way.

Arduino pin 10 — board header pin 5

Arduino pin 11 — board header pin 1

Arduino pin 12 — board header pin 2

Arduino pin 13 — board header pin 3

Arduino +5V — board header pin 4

Arduino GND — board header pin 6

4. – Open the “solar_charge_controller” sketch, make sure the type of board is set to Arduino UNO and select “Arduino as ISP” in the programmer section in the “tools” menu of your arduino IDE. Try to compile the sketch (ctrl + r) to make sure it doesn’t return any error.

5. – Once it is all looking good, press and hold the SHIFT button on your keyboard and click onto the upload button arrow in your arduino IDE and if everything is working fine, you should see the little Rx Tx lights on your arduino board start to blink. (It takes a fair bit of time for the sketch to upload).

Once done you can remove the programming wires from the header.Arduino solar charge controller + output control and data logging online with Xbee WiFi schematic

Step 5: Connecting the different sensors and cables to the board

After mounting the board in its final place we need to connect the screen, Xbee, switches and sensors to it.

On the picture of the prototype board I have commented on what header is for what device and where to find pin 1.

You can also refer to the schematics to find the headers pin numbers.

Connection for the Xbee: (from the board to the Xbee shield)

Header pin 1 goes to Shield pin 3

Header pin 2 goes to Shield pin 2

Header pin 3 goes to shield pin +5V

Header pin 4 goes to shield pin GND

Connection for the tft screen: (from the board to the tft screen)

Header pin 1 goes to screen pin Vcc

Header pin 2 goes to screen pin GND (the screen works as well when it is not connected, saves a bit of power)

Header pin 3 goes to screen pin RES

Header pin 4 goes to screen pin RS/DC

Header pin 5 goes to screen pin CS

Header pin 6 goes to screen pin SDA

Header pin 7 goes to screen pin SCL

Connection for the buttons and switch: (from the board to the buttons and switch)

Header pin 1 goes to ON – OFF switch on 1 side

Header pin 2 goes to ON – OFF switch on the other side

– From this pin of the ON _ OFF switch run a wire to the + of the OUTPUT button light

Header pin 3 goes to the GND of the OUTPUT button light (not connected in my setup)

Header pin 4 goes to the DATA button on 1 side

– From this pin of the DATA button run a wire to the 1st side of the OUTPUT button

Header pin 5 goes to the DATA button on the other side

Header pin 6 goes to the OUTPUT button on the other side

Connection for the LM35 temperature sensor: (from the board to the sensor)

Header pin 1 goes to the LM35 pin +

Header pin 2 goes to the LM35 pin GND

Header pin 3 goes to the LM35 pin Vout

For the LDR sensor, it doesnt matter which way you connect the sensor to the header so just connect it the way you want.

 

 

For more detail: Arduino solar charge controller + output control and data logging online with Xbee WiFi

 

The post Arduino solar charge controller + output control and data logging online with Xbee WiFi appeared first on PIC Microcontroller.

TTPSU – Power supply for turntables with AC motors

$
0
0

The power supply descriped here, is for turntables with 2 phase AC motor, like Linn, Rega, AR, Heybrook, Goldring and many, many more. The main features of the power supply are:

  • X-tal controlled speed. The TTPSU can change speed by the push of a button – no need to move the belt on the pulley.
  • Speed selection – 2 to 4 speeds can be configured and adjusted.
  • Speed adjustment by varying the AC frequency in 0.1% steps.
  • Approx. 15W output capability.
  • DC free AC output. Also, spikes and noise on the net is eliminated.
  • Optional lowering of the operating speed after start-up (110V->85V, 230>170V). High voltage output time can be set to 10, 25 seconds or always. A lower operating speed reduces the vibrations from the motor.
  • Speed ramping to allow speed changes with the pickup in the groove with a minimum of vibrations and “soft” startup.
  • 3 button control.
  • 16×1 LCD display.
  • Microprocessor controlled “Sinus” generation.
  • Optional 50/60Hz input.
  • Build for 110V or 230V input, 110V/230V output.
  • Optional 50Hz/60Hz ouput (by downloading the appropriate program to the processor).
  • Optional cleaner sinus for 60Hz operation (download) by overclocking the processor.
  • It’s relatively cheap to build!

Power supply for turntables with AC motors

WARNING – IMPORTANT NOTE

This project is connected to 220V-240V mains supply alternatively the 110V-130V mains supply and is potentially lethal. Futhermore, it proceduces lethal output voltages (again 110V-130V/220V-240V). As a result of this, please observe the following:

  • Do NOT build this project unless you are completely familiar with mains wiring practices.
  • The circuit MUST be built into a fully enclosed case – if at all in doubt, please use an isolating plastic enclosure.
  • Do NOT touch anything inside the case, when the curcuit when it is powered (even if turned off). The PCB does not carry any dangerous voltages, but it is all to easy to touch anything carrying lethal voltages (mains input, transformer connectors, fuse wires, mains switch connectors etc.).

Quick links

Construction details

Block diagram

Detailed schematics

Input transformer/Power supply

Microprocessor controlled sinus generator, the DAC and filter

Gain stage and power amplifier

Using 1% resistors

PCB

Part list for the PCB

Note about XTAL selection

Populating the PCB

Mounting the construction in an enclosure

Downloads

Possible improvements in a future v2 of the TTPSU

Tools used during development of TTPSU

How to use it?

How does it sound, then?

Construction details

Here’s a run down of the idea behind the TTPSU and some reasons for selecting the individual components:

  • PIC16F870 or PIC16F883 processor with resistor DAC for Sinus generation.
  • Filtered sinus to make the sinus cleaner (less distortion).
  • Class (A)B power amplifier.
  • Stabilized power supply for the microcontroller and amplifier circuits.
  • Transformer step-up for generating 110/230V output.
  • Fuse protected output for overload protection.

The Microchip PIC16F870 was originally selected for several reasons. First of all, a Microchip processor was selected as I have both a selection of PIC’s and the development tools needed. The selection of 16F870 was based on the need for an external crystal for maximum speed stability and precision, the need 6 outputs for the DAC (port B<0:5>), 3 inputs for input control (port A<0:2>), 1 input/output for reduced operating voltage (port A<3>) and 6 outputs for display control (port C<0:1,3:5>). For a total of 16 I/O pins, the closest processor I had, was the 16F870. These days (2012/2013) the 16F870 has become more difficult (and expensive) to obtain, so I have added the option of using a 16F883 as well – just download the appropriate software for the selected processor.

The resistor DAC was selected for the following reasons: It’s cheap! It uses 7 standard 5% E12 resistor values (measure for optimal precision) or alternatively 7 1% E96 resistor values. I figured I could get a reasonable sinus precision compared to low-cost external DAC’s, and a 6 step DAC was what was needed, due to the idea behind the speed regulation. Permitting the use of 7 standard E12 resistors, makes it possible to build the TTPSU from components “in the drawer” and updating the DAC with 1% resistors, if the construction suits you needs.

The class B output power amplifier was selected for these reasons: It’s simple – a class (A)B output stage based on an op amp with only a few external components. This is the absolutely worst amplifier you can build for audio purposes, but it measures very well on sinus signals (which is what we use it for) and it’s cheap.

The stabilized power supply was added to the design to make sure, that net noise and net spikes was filtered out from the output. A input net filter was added for good measure.

The fuse protection in the output (essential!!!) was added, so if somebody got the “good” idea of plugging in an amplifier or vacuum cleaner :-), the TTPSU does not blow up in smoke. The fuse should be a slow fuse, as the TTPSU, although rated at 15W, is able to deliver in excess of 20W for short periods. Also, I recommend you use as small a fuse as you can get away with (i.e. the turntable starts up at every speed without blowing the fuse) – this will make the fuse blow, if the turntable is somehow obstructed and protect the motor.

The concept behind the TTPSU is as follows: We take the mains input and transform it down to +/-15V and 5V for the microcontroller. The microcontroller and DAC (with filter) generates an approximate sinus signal, which is amplified and sent to the power amplifier. Finally, the output from the power amplifer is sent through the output transformer to generate the 120V/230V output. The microcontroller also handles the control buttons and the display.

The concept behind the TTPSU is as follows: We take the mains input and transform it down to +/-15V and 5V for the microcontroller. The microcontroller and DAC (with filter) generates an approximate sinus signal, which is amplified and sent to the power amplifier. Finally, the output from the power amplifer is sent through the output transformer to generate the 120V/230V output. The microcontroller also handles the control buttons and the display.

Detailed schematics

Power supply for turntables with AC motors Schemetic

Input transformer/Power supply

The input transformer is 120V/230V primary and 2x15V secondary. The AC input is sent through a bridge rectifier and filtered with two 2200uF capacitors. A 7805 voltage regulator generates the 5V supply for the microprocessor, while the supply for the opamp and power amplifier is regulated with a transistor and zener diode for the positive and negative rail. Nothing fancy here :-) The construction uses BD911/BD912 transistors in the power supply, but these are not critical (just what I had at hand), so any power transistor which is able to dissipate 15W-20W should do, just make sure the pinout is the same.

Microprocessor controlled sinus generator, the DAC and filter

The sinus generator is implemented as a Microchip PIC microcontroller and a simple resistor Digital to Analogue converter (DAC). The construction uses a simple 6 step resistor DAC to form a crude sinus, which is filtered to make an acceptable sinus. The filter has a -3dB frequency of 338Hz which was selected to allow for speeds exceeding 100 rpm for old records (e.g. 120 rpm will output a 181.82Hz sinus when using the 33 rpm pulley). However, for even better filtering, a frequency of 169Hz can be implemented, by replacing C4 with a 1uF capacitor in place of the default 470nF, which will still allow 78 rpm without any problems. Note: The DAC can be implemented with two different resistor series – one using 5% resistors (easy to get, cheap) and one using 1% resistors. Both series has been tested, so that no combination of resistors within their stated tolerances causes a voltage reversal at any step in the DAC.
Taking a look at the signal that comes from the DAC, we see the raw unfiltered output in figure 1. This output is from the prototype using 5% resistors. The big vertical steps comes from the use of an uneven resistor series, while the overshots in the picture is due to the “measurement equipment” (sound card used as oscilloscope for making the pictures). Another note about the pictures – the prototype was running a 12 MHz crystal (in place of a 20MHz) so the time scale is not correct!

 

 

For more detail:  TTPSU – Power supply for turntables with AC motors

The post TTPSU – Power supply for turntables with AC motors appeared first on PIC Microcontroller.

Serial LCD Controller

$
0
0

I discovered a flaw in the current design that will only allow the controller to work with a connection to the computer and not to a microcontroller.  I’ve updated the schematic below and will fix the controller design.  I’ve added a project file below that also includes the fixed schematic.

Serial LCD Controller

If you look at the schematic you will notice that when you set the jumper to non-inverted so you can connect to a microcontroller for serial control it will not work.  The reason is in the way I designed the circuit for both inverted/non-inverted RS232 control.  Looking at the transistor in the circuit, the collector is held high through a 10K resistor.  The collector feeds to the Rx pin on the PIC.  When you set the jumper to non-inverted and attempt to send data to the PIC it won’t work because the line is always tied high through R8 to 5V.

There is a fix and I have included it in the archive file below.  There are two ways to do this:

1.  If your board is already built and your intentions are to only use this LCD in a finished design and not attached to the   computer then, snip the connection from R8 to 5V and the controller will only work in the non-inverted configuration.

2. Look at the included schematic in the archive and add the shown J2 jumper to your design which will allow you to select between the two types of communication.

04 October 2009

I have redesigned the LCD Controller and updated the code.  The new schematics and code can be found below.  I ported the code from MBasic to PicBasic Pro.  I’ll leave the old code up for those who still want it.

The files below are from a project that I have been working on for a serial LCD controller for a 4×20 line parallel display with the Hitachi chipset.  I am also working on a USB design.  In the picture of the demo board there is a wire jumper installed.  This is because I screwed the pooch and somehow missed a crossed trace.  I had to repair the board.  In the download files the PCB files have been fixed.  I’ll upload some video of functionality when I get a chance.

The code and project files have been posted in the download links.

Project file downloads

Old code:

Power regulation board schematic

LCD and power board PCB

LCD schematic

LCD code

Demo application with sourcecode

05 October 2009 Project Files

PicBasic Pro PIC16F628A code for 16×2 character LCD

PicBasic Pro PIC16F628 code for 16×2 character LCD

PicBasic Pro PIC16F628A code for 20×4 character LCD

Archive containing test application, schematic, and PCB (ExpressPCB)

PicBasic Pro LCD Controller interface to Parallax GPS receiver

Ensure all the files are unzipped to the same folder.  The include file that is referenced contains the fuse settings for the selected PIC chip.

Serial LCD Controller Schemetic

I will be uploading a version soon that allows the type of LCD to be set.  This will allow the same controller to be used for a variety of LCDs.  I can’t squeeze that functionality into a PIC16F628 chip without removing some of the current functionality.  So, I am porting that over to a PIC16F88.

More to come…

Breadboard testing of the LCD controller

 

For more detail: Serial LCD Controller

The post Serial LCD Controller appeared first on PIC Microcontroller.


A PIC Ultrasonic distance meter project using a Seven Segment display and a PIC micro.

$
0
0

The PIC Ultrasonic distance meter works by transmitting a short pulse of sound at a frequency inaudible to the ear (ultrasonic sound or ultrasound).

A PIC Ultrasonic distance meter project using a Seven Segment display and a PIC micro

Afterwards the microcontroller listens for an echo.

The time from transmission to echo reception lets you calculate the distance from the object.

PIC Ultrasonic Distance Meter Specification

Range ~5cm – 300cm (approx.)
Accuracy +/-3cm
Transducer frequency 40kHz
Internal oscillator frequency 4MHz

The project uses 5 standard transistors to receive and transmit the ultrasound and a comparator to set the threshold echo detection level – so there are no special components other than the microcontroller and the ultrasonic TX/RX modules which are standard 40kHz types.

Note: As you approach 300cm it is more difficult to receive a reflected signal so the practical range is probably nearer 200cm. The SR04 unit will perform better since it uses higher gain opamps.

Design

This design is experimental and educational since you can buy ready made modules such as the SR04 which are undoubtedly convenient – you supply a pulse trigger and they provide a distance (pulse width coded). These are quick and very easy to use but do not demonstrate what is going on.

This design uses external components, comparators and transistors to achieve the same result.

The 16F88 also has a built in comparator and reference level generator which would save components but this design can be used with any microcontroller that has a capture module. It is probably possible to use it with a 16F84 using some careful coding for time measurement.

Specification

Note that the internal oscillator of the PIC micro is used and this saves two pins – that can be used as normal I/O pins.

Compiler Mikroelectronika MikroC compiler Free!
Target 16F88 (retargetable to other PICs that have a CCP module).
Software level Medium.
Software notes Drives multiplexed display, controls CCP, interrupt use.
Hardware level Medium.
Hardware notes High gain transistor amp.
Project version 1.03
Project files Enter your details to get the Download Link
and get the microcontroller newsletter:

(Your email is safe it will never be sold or rented).
You will get All the C source code and hex file.

Note: Check your email for the project code download link.

You can recompile the project files if you want examine code operation (using the built in simulator) or change the source code. Note the hex file is contained in the download so you do not have the recompile the source code.

How the PIC Ultrasonic Distance Meter works

The time from transmission of the pulse to reception of the echo is the time taken for the sound energy to travel through the air to the object and back again.

Since the speed of sound is constant through air measuring the echo reflection time lets you calculate the distance to the object using the DST equation :

Distance = (s * t)/2 (in metres)

You need to divide by 2 as the distance is the round trip distance i.e. from transmitter to object and back again.

Where:

s [m/s] the speed of sound in air
t [s] the round trip echo time.

Some delay times:

Round trip echo time Distance
t = 588us 10cm
t = 5.8ms 1m

Note: The speed of sound in air is more or less constant at 330m/s (@ 0ºC) – it varies mainly with temperature (~340m/s @ 20ºC). In this project I am using a value of 340m/s i.e. it is assumed that the project is used indoors. You can change it to whatever you like by modifying the code.

You can get ultrasonic transducers optimized for 25kHz, 32kHz, 40kHz or wide bandwidth transducers. This project uses a 40kHz transducer but it will still work with the others if you make simple changes to the software. The receiver and generator circuits will work as they are.

Note: If you use a different transducer you must change the software to generate the correct frequency for the transducer as they only work at their specific operating frequency.

The 40kz signal is easily generated by the microcontroller but detection requires a sensitive amplifier. I have used a three transistor amplifier for the receiver.

This is followed by a peak detector and comparator which sets the sensitivity threshold so that false reflections (weaker signals) are ignored.

CCP – Capture mode

This project makes use of the CCP module (in its capture mode) to accurately measure the signal reception time at the CCP port pin. When a signal triggers the CCP module the value of timer 1 is stored in a CCP register (or captured).

If you store the value of timer 1 and then enable the CCP after transmitting an ultrasound pulse the CCP will trigger when the comparator activates i.e. as soon as an ultrasonic echo is received.

Subtracting the stored value from the CCP register value gives the time delay in machine cycles. Since the project uses a 4MHz main clock then the time delay will be measured in micro-seconds.

PIC Ultrasonic Distance Meter Practical limits

The minimum distance of this scheme is about 5cm. Looking at the output of the first receiver amplifier shows a that it should be more accurate at lower distances – it is inaccurate by about 2cm which is still quite good. Probably the addition of amplifiers for the longer range stops accurate short range operation.

A PIC Ultrasonic distance meter project using a Seven Segment display and a PIC micro Schemetic

The maximum distance is limited by the sensitivity, gain and noise performance of the receive amplifier and also the transmit power and duration of transmission.

For this circuit the maximum distance is about 3m.

For more detail: A PIC Ultrasonic distance meter project using a Seven Segment display and a PIC micro.

Current Project / Post can also be found using:

  • micro contoller week projects

The post A PIC Ultrasonic distance meter project using a Seven Segment display and a PIC micro. appeared first on PIC Microcontroller.

A PIC Serial LCD Project

$
0
0

This project shows you how to create a serial LCD module that you can drive from any serial RS232 interface.

You may be asking yourself why is this project using RS232 when computers are no longer even produced with a serial port as standard?

A PIC Serial LCD Project

There are three reasons:

  1. Most microcontrollers come with a UART built-in as a hardware module.
  2. RS232 can be setup with 2 signal wires and one ground connection.
  3. RS232 can be operated over long distance.

The last point means that signal transmission can be made fairly error free and robust (although you can achieve higher data rates and lower error rates by using the full RS232 spec). However it is probably better to move to a multi-drop interface such as RS485.

Since the hardware module is built in it becomes super-easy to use the internal UART which can use interrupts allowing fast and transparent operation.

The only problem now becomes what to do about the interface in the PC and you either buy an RS232 to USB adaptor cable that presents an RS232 interface as a COM port in the usual way at the PC but allows it to be plugged into a USB port or you can use a Digital to Serial USB converter. This last one does away with RS232 signals altogether and instead provides digital RX/TX signals to plug straight into the microcontroller i.e. you miss out the MAX232 chip. Ultimately both work fine and both look the same at the PC side.

Here is some more information on Serial RS232 to USB adaptors.

Project Design

The design here uses a pure ASCII command set so you can control it easily from a terminal program such as Tera Term (download from web = free).

There are no ‘odd’ command sequences such as 0xef to define a command – you can type all commands at the terminal interface making it very easy to use i.e. this is a purely text based control system.

If you want to use it as a debugging terminal for your PIC projects then it makes sense to remove the level translator and just use the  0-5V input otherwise you would end up having two level translators for no real reason!
A PIC Serial LCD Project
Note: Using it like this you will need to invert the RS232 output data so you either need an inverter chip if driven from the built in USART or you can drive it using a software USART (The transmitter part anyway) since you will have full control over the output signal.
Serial LCD Specification

Baud Rate 9600
Crystal 20Mhz -You can use  a lower value xtal but must re-compile the files and set the clock value into the MikroC chip settings.

Serial LCD Project Details

Serial LCD Project
Compiler Mikroelectronika MikroC compiler Free!
Target 16F877A (retargetable to other PICs that have enough pins and a built in USART).
Software level Easy.
Software notes Uses unget_char to reverse getchar action.
Hardware level easy.
Hardware notes No special notes.
Project version 1.01
Project files Enter your details to get the Download Link
and get the microcontroller newsletter:

(Your email is safe it will never be sold or rented).
You will get All the C source code and hex file.

Note: Check your email for the project code download link.

You can recompile the serial LCD files if you want examine code operation (using the built in simulator) or change the source code. Note the hex file is contained in the download.

Serial LCD Command set

All commands are prefixed with the hash character ‘#’.  In all cases except #X and #Y the single character following the ‘#’ causes a command to execute.  For #X and #Y the decimal digits following (up to 2 digits) specify a position on the display.

Note: for #X and #Y the top left position is at 0,0.

Serial LCD Command Set list (uses upper or lower case):
Serial LCD Commands
#C or #c Clear screen
#H or #h Cursor Home
#L or #l Cursor Left
#R or #r Cursor Right
#U or #u Cursor Underline mode
#B or #b Cursor Block mode
#I or #i Cursor Invisible
#F or #f Display OFf 
#O or #o Display On
#Xnn or #xnn Cursor X position (left nn=0)
#Ynn or #ynn Cursor Y position (top nn=0)
#> or #. Scroll display right (hash dot as easier to type!)
#< or #, Scroll display left (hash commaas easier to type!)
## Display a ‘#’ character.

To clear the display you would type:

#C

To set the cursor to block mode type:

#B

 

For more detail: A PIC Serial LCD Project

Current Project / Post can also be found using:

  • pic lcd controller software
  • pic lcd displaying projects

The post A PIC Serial LCD Project appeared first on PIC Microcontroller.

TrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays

$
0
0
This project is about building a microcontroller-based digital room thermometer plus hygrometer that displays temperature and relative humidity on 4 large (1 inch) seven segment LED displays which adjust their brightness level according to the surrounding illumination. It consists of a closed loop system that continuously assesses ambient light condition using an inexpensive light-dependent resistor (LDR) and uses that information to adjust the brightness of the display. An inexpensive DHT11 sensor is used to measure temperature and relative humidity. The microcontroller used in this project is PIC16F688, and it runs at 4 MHz clock generated from its internal source. A separate display driver chip (MAX7219) is used to control and refresh the display data on the seven segment LEDs. – See more at: http://embedded-lab.com/blog/?p=6582#sthash.ICwZff85.dpufTrH Meter A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7 segment LED displays See more at http embedded lab com blogp6582 sthash 82YrZ0px dpuf

Why do we need adaptive brightness control?

Auto-adjusting the brightness of the seven segment LED displays not only saves power but also enhances the readability in all ambient lighting conditions. Many smartphones, HDTVs, PDAs, tablets, and computer screens now come with this feature. It basically dims the display in a dark environment and is still readable and eye-soothing. Similarly, when the ambient light level goes up, it brightens the display to enhance the readability. This project displays indoor temperature and relative humidity on large 1 inch seven segment LEDs that automatically adjust the brightness to be in balance with the light condition in the room. So, if you put this meter in your bedroom, you won’t have to worry about turning it off during nighttime. It will automatically dim low enough to not to disturb your sleep, while maintaining the readability.

Circuit diagram 

To make it easy to explain, I have divided the complete circuit diagram into 3 parts: Power supply unit, Microcontroller and sensor unit, and Display driver unit.

The power supply unit consists of a LM7805 regulator IC to derive regulated +5V power supply from a 9-15V DC wall adapter. The complete power supply unit circuit diagram is shown below. LED1 is a power-on indicator LED.

– See more at: http://embedded-lab.com/blog/?p=6582#sthash.ICwZff85.dpuf

The following circuit diagram shows connections of the DHT11 sensor and the photoresistor (also called light dependent resistor or LDR) to the PIC16F688 microcontroller. DHT11 is a low cost digital sensor for measuring temperature from 0-50 °C with an accuracy of ±2°C and relative humidity ranging from 20-95% with an accuracy of  ±5%. The sensor provides fully calibrated digital outputs and has got its own proprietary 1-wire protocol for communication. I have described more about this sensor and its communication protocol in Measurement of temperature and relative humidity using DHT11 sensor and PIC microcontroller. The PIC16F688 uses the RC4 I/O pin to read the DHT11 output data. Note that R7 serves as the pull-up resistor required for the data pin of the DHT11 sensor. The S2 switch in the circuit diagram is to select between degree Fahrenheit (°F) and degree Celsius (°C) unit for temperature display. When the switch is open, the RC3 pin is pulled low by default, and the temperature is displayed in °F scale. In order to chose °C scale, the RC3 pin should be pulled high, which happens when S2 is closed.

Next, the photoresistor (R5) and R4 construct a voltage divider network as shown in the circuit. The analog voltage across R4 increases proportionally with the amount of light falling on the photoresistor. The resistance of a typical photoresistor is less than 1 K? under bright lighting condition. Its resistance could go up to several hundred K? under extremely dark condition. Therefore, for the given setup, the voltage across the R4 resistor can vary from less than 0.1V (under dark condition) to over 4.0V (under very bright illumination). The PIC16F688 microcontroller reads this analog voltage through its AN2 (RA2) ADC channel to determine the surrounding illumination level.

– See more at: http://embedded-lab.com/blog/?p=6582#sthash.ICwZff85.dpuf

The display unit consists of a MAX7219 chip that can directly drive up to eight 7-segment LED displays (common cathode type) through a 3-wire serial interface. Included on the chip are a BCD decoder, multiplex scan circuitry, segment and digit drivers, and an 8×8 static RAM to store the digit values. The segment current for all LEDs is set through only one external resistor connected between the ISET pin and power supply. The device also provides 16 level brightness control through software using its internal pulse-width modulator. To learn more about the MAX7219 device, read my previous article Serial 4-digit seven-segment LED display. In this project, the RC0, RC1, and RC2 I/O pins of PIC16F688 are used to drive the DIN, LOAD, and CLK signal lines of the MAX7219. – See more at: http://embedded-lab.com/blog/?p=6582#sthash.ICwZff85.dpuf
Here’s the complete project circuit setup on a general purpose perforated prototyping board. – See more at: http://embedded-lab.com/blog/?p=6582#sthash.ICwZff85.dpufTrH Meter A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7segment LED displays schematich

Software

The PIC firmware is developed in C and compiled with mikroC Pro for PIC compiler version 5.30. The subroutines for initializing the MAX7219 and sending display data bytes are written in a simple and understandable way so that they can be easily implemented with any other programming language, if required. The MAX7219 allows display brightness to be controlled through software by an internal pulse-width modulator (PWM). The PWM output is controlled by the lower nibble (D3-D0) of the intensity register (address 0x0A) and allows 16 brightness levels. The zero nibble value sets the display intensity to minimum, whereas all nibble bits set to 1 (0x0F) selects the maximum intensity level for the display. For auto-brightness control, the 10-bit ADC count (0-1023) corresponding to the photoresistor output voltage is scaled down to 0-19 by dividing the count by 50 (20 brightness levels between 0-1023). Then a look-up table is used to map the scaled brightness levels to appropriate nibble values for the intensity control register of the MAX7219. The temperature is displayed in Fahrenheit (°F) scale if RC3 is pulled low, and in Celsius (°C) scale if RC3 is high. The relative humidity measurement is shown in percentage (P). The microcontroller alternately switches the display data between temperature and relative humidity.

 

 

For more detail: TrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays

The post TrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays appeared first on PIC Microcontroller.

TrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays

$
0
0
This project is about building a microcontroller-based digital room thermometer plus hygrometer that displays temperature and relative humidity on 4 large (1 inch) seven segment LED displays which adjust their brightness level according to the surrounding illumination. It consists of a closed loop system that continuously assesses ambient light condition using an inexpensive light-dependent resistor (LDR) and uses that information to adjust the brightness of the display. An inexpensive DHT11 sensor is used to measure temperature and relative humidity. The microcontroller used in this project is PIC16F688, and it runs at 4 MHz clock generated from its internal source. A separate display driver chip (MAX7219) is used to control and refresh the display data on the seven segment LEDs. – See more at: http://embedded-lab.com/blog/?p=6582#sthash.VnIRmLrC.dpufTrH Meter A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7 segment LED displays See more at http embedded lab com blogp6582 sthash 82YrZ0px dpuf

Why do we need adaptive brightness control?

Auto-adjusting the brightness of the seven segment LED displays not only saves power but also enhances the readability in all ambient lighting conditions. Many smartphones, HDTVs, PDAs, tablets, and computer screens now come with this feature. It basically dims the display in a dark environment and is still readable and eye-soothing. Similarly, when the ambient light level goes up, it brightens the display to enhance the readability. This project displays indoor temperature and relative humidity on large 1 inch seven segment LEDs that automatically adjust the brightness to be in balance with the light condition in the room. So, if you put this meter in your bedroom, you won’t have to worry about turning it off during nighttime. It will automatically dim low enough to not to disturb your sleep, while maintaining the readability.

Circuit diagram 

To make it easy to explain, I have divided the complete circuit diagram into 3 parts: Power supply unit, Microcontroller and sensor unit, and Display driver unit.

The power supply unit consists of a LM7805 regulator IC to derive regulated +5V power supply from a 9-15V DC wall adapter. The complete power supply unit circuit diagram is shown below. LED1 is a power-on indicator LED.

– See more at: http://embedded-lab.com/blog/?p=6582#sthash.VnIRmLrC.dpuf

The following circuit diagram shows connections of the DHT11 sensor and the photoresistor (also called light dependent resistor or LDR) to the PIC16F688 microcontroller. DHT11 is a low cost digital sensor for measuring temperature from 0-50 °C with an accuracy of ±2°C and relative humidity ranging from 20-95% with an accuracy of  ±5%. The sensor provides fully calibrated digital outputs and has got its own proprietary 1-wire protocol for communication. I have described more about this sensor and its communication protocol in Measurement of temperature and relative humidity using DHT11 sensor and PIC microcontroller. The PIC16F688 uses the RC4 I/O pin to read the DHT11 output data. Note that R7 serves as the pull-up resistor required for the data pin of the DHT11 sensor. The S2 switch in the circuit diagram is to select between degree Fahrenheit (°F) and degree Celsius (°C) unit for temperature display. When the switch is open, the RC3 pin is pulled low by default, and the temperature is displayed in °F scale. In order to chose °C scale, the RC3 pin should be pulled high, which happens when S2 is closed.

Next, the photoresistor (R5) and R4 construct a voltage divider network as shown in the circuit. The analog voltage across R4 increases proportionally with the amount of light falling on the photoresistor. The resistance of a typical photoresistor is less than 1 K? under bright lighting condition. Its resistance could go up to several hundred K? under extremely dark condition. Therefore, for the given setup, the voltage across the R4 resistor can vary from less than 0.1V (under dark condition) to over 4.0V (under very bright illumination). The PIC16F688 microcontroller reads this analog voltage through its AN2 (RA2) ADC channel to determine the surrounding illumination level.

– See more at: http://embedded-lab.com/blog/?p=6582#sthash.VnIRmLrC.dpuf

The display unit consists of a MAX7219 chip that can directly drive up to eight 7-segment LED displays (common cathode type) through a 3-wire serial interface. Included on the chip are a BCD decoder, multiplex scan circuitry, segment and digit drivers, and an 8×8 static RAM to store the digit values. The segment current for all LEDs is set through only one external resistor connected between the ISET pin and power supply. The device also provides 16 level brightness control through software using its internal pulse-width modulator. To learn more about the MAX7219 device, read my previous article Serial 4-digit seven-segment LED display. In this project, the RC0, RC1, and RC2 I/O pins of PIC16F688 are used to drive the DIN, LOAD, and CLK signal lines of the MAX7219. – See more at: http://embedded-lab.com/blog/?p=6582#sthash.VnIRmLrC.dpufTrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays - See more at: http://embedded-lab.com/blog/?p=6582#sthash.VnIRmLrC.dpuf schematich

Software

The PIC firmware is developed in C and compiled with mikroC Pro for PIC compiler version 5.30. The subroutines for initializing the MAX7219 and sending display data bytes are written in a simple and understandable way so that they can be easily implemented with any other programming language, if required. The MAX7219 allows display brightness to be controlled through software by an internal pulse-width modulator (PWM). The PWM output is controlled by the lower nibble (D3-D0) of the intensity register (address 0x0A) and allows 16 brightness levels. The zero nibble value sets the display intensity to minimum, whereas all nibble bits set to 1 (0x0F) selects the maximum intensity level for the display. For auto-brightness control, the 10-bit ADC count (0-1023) corresponding to the photoresistor output voltage is scaled down to 0-19 by dividing the count by 50 (20 brightness levels between 0-1023). Then a look-up table is used to map the scaled brightness levels to appropriate nibble values for the intensity control register of the MAX7219. The temperature is displayed in Fahrenheit (°F) scale if RC3 is pulled low, and in Celsius (°C) scale if RC3 is high. The relative humidity measurement is shown in percentage (P). The microcontroller alternately switches the display data between temperature and relative humidity.

 

 

 

For more detail: TrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays

The post TrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays appeared first on PIC Microcontroller.

PIC MICROCONTROLLER PROJECTS AND LCD CIRCUITS

$
0
0

 

Here is 0 to 99 minutes relay timer using PIC16F628 microcontroller and 16 character LCD display. The microcontroller is PIC16F628A running at 4.0 MHz clock using an external crystal. An HD44780 based 16×2 character LCD is the main display unit of the project where you can watch and set the timer duration using tact switch inputs. There are three tact switches connected to RB0 (Start/Stop), RB1 (Unit), and RB2 (Ten) pins. You can select the timer interval from 0-99 min using Unit and Ten minute switches. The Start/Stop switch is for toggling the timer ON and OFF. When the timer gets ON, a logic high signal appears on the RA3 pin, which can be used to switch on a Relay. The circuit diagram of this project is described below. PIC MICROCONTROLLER PROJECTS AND LCD CIRCUITS

Here’s a digital barometer that uses Atmega8 microcontroller and graphical LCD display. This project uses SCP barometer pressure sensor graphical LCD display connected to Atmega8 microcontroller. Graphical LCD displays latest 128 readings while one reading occur once in 20 minutes. You can see information of about two last days. Provided C source code can be customized to your liking.

This project uses a Microchip PIC microcontroller, a serial EEPROM and a thermistor to create a temperature recorder. The temperature is measured and stored at user programmable intervals; this can be from 1 second to 256 seconds. The time interval is set by programming it and the start time into the EEPROM. Most of the time the PIC will be asleep and the EEPROM IC is inactive. This gives a very low current consumption of approximately 50 uA or about 1 mAh per day. The EEPROM used is 32kBytes which can store up to 32,000 measurements. This could be one measurement every 30 seconds for 11 days for example. The combination of thermistor and analogue circuit gives a range of between about -40 °C and +100 °C although the linear range is between about -10 °C and +40 °C.

A bootloader enables download of hex-files directly into the flash-memory of a PIC or other microcontroller. The bootloader receives the user program via the PIC’s UART and writes it directly to the program memory (self programming). This feature greatly speeds up the development process, because the chip remains in the target circuit and need not be moved between the target circuit and the programmer. When no bootloader is installed, all memory in the PIC can be utilized for user programs. That is 4 K for the 16F873 (0x000 to 0xFFF). Installing a bootloader means, that some part of the memory is occupied by the bootloader. The user can download his program into the remaining memory space. The bootloader in figure 1 occupy 256 words (0xF00 to 0xFFF), that is 6 % of the memory in a 16F873. The disadvantage of loosing 6 % memory is little compared to the advantage of fast program download and more friendly development routines.

We love to read emails from our visitors, Please let us know by clicking here if you find any kind of bug/error in our site. We will fix it as soon as possible. PIC Controlled Relay Driver This circuit is a relay driver that is based on a PIC16F84A microcontroller. The board includes four relays so this lets us to control four distinct electrical devices. The controlled device may be a heater, a lamp, a computer or a motor. To use this board in the industrial area, the supply part is designed more attentively. To minimize the effects of the ac line noises, a 1:1 line filter transformer is used.

Rotary encoders are very versatile input devices for microcontroller projects. They are like potentiometers expect of digital nature and unlike analogue potentiometers they never wear down. Rotary encoders not only provide 360 degrees of rotational freedom they also allow digital positioning information to be gained without the use of analogue to digital converters (ADCs). When using rotational encoders in projects it’s possible to use the same encoder to represent a number of different input types, however this requires some form of feedback display to let the user know what information he is inputting and the ‘position’ of the encoder. The project is based around a 24 position rotary encoder, 16 LEDs arranged in a circle around the encoder, an A6276 16 LED serial driver IC and the PIC182550 microcontroller. A rotary encoder has 3 pins usually called A, B and C. The C pin (which is normally the centre pin) should be grounded and both A and B should be connected to the microcontroller with individual pull-up resistors on each input. In this project I used RB4 and RB5 on the PIC to connect the encoder; this has 2 advantages, firstly you can use the PORTB internal weak pull-up (which means you do not need external resistors) and also the PIC provides an ‘interrupt-on-change’ which can be used to monitor the encoder.

For a long time I needed a good programmer pussy, even if it is programming, so from time to time the application gets where it is used. So I decided to build the programmer. I chose between a couple of projects from different authors, but eventually won PICkit2. Microchip released the schema directly in the user manual for the programmer. On the Internet there are multiple versions of the programmer, it’s usually cropped version of the log analyzer features, UART terminal, etc., 12V inverter is a modified version of it and control the MOSFETs, unlike bipolar transistors used in the original design. And it also showed that becomes due to the switching inductance feta leave. Finally, I chose to use the original scheme, although it is quite complicated and the parts used in our country can not normally buy, but my problems with finding parts easily solved. I bought a transistor, the 16F2550 PIC and a few other things, resistors and fry the rest I bought from “us”. The price is pretty high, unfortunately, moving it around and 600CZK, the main prize and two processor makes the EEPROM. Below we describe the involvement and put into operation.

USB Input / Output Board is a spectacular little development board / parallel port replacement featuring PIC18F2455 / PIC18F2550 microcontroller. USB IO Board is compatibile with Windows / Mac OSX / Linux computers. When attached to Windows IO board will show up as RS232 COM port. You can control 16 individual microcontroller I/O pins by sending simple serial commands. USB Input / Output Board is self-powered by USB port and can provide up to 500mA for electronic projects.

One morning I woke up and wanted to know what the temperature outside was, and instead of running over to Home Depot and picking up a $2.00 glass thermometer, I decided to build my own wireless temperature sensor. At the heart of the board is a PIC12F675 microcontroller in an SO8 package. The right-hand side of the board houses the linear power supply (LP2950), bottom-center is the DS18B20 1-Wire temperature sensor, and out in left-field you can see the Sure TTL Bluetooth Module.

The new PIC18F2550 Project Board was designed as the development platform for student projects. The board platform is suitable for developing the microcontroller based instrumentation. Students may build the signal conditioning board, plugs it to PIC project board, develops the code and programs it with loader cable easily.

If you like PC modding this is cool project for you.this is an USB interface for alphanumeric LCD display like 4×20 which can be controlled with LCDSmartie program.USB interface is implemented by using PIC18F2550 microcontroller. Using USB LCD module you can view many types of information taken from PC like temperatures, time/date, MP3 song titles, view emails, RSS feeds all that LCDSmartie or other program supports. PIC MICROCONTROLLER PROJECTS AND LCD CIRCUITS schematich

Pinguino is an Arduino-like board based on a PIC Microcontroller. The goal of this project is to build an integrated IDE easy to use on LINUX, WINDOWS and MAC OS X. This is a simple 40 pin PIC development board as described in RadCom for November 2009. It is designed for a PIC18F4550, but it will work with other 40 pin PICs like the PIC16F877A. It has no bells & whistles attached. No buttons, LED, LCD ICSP etc. All of the PIC pins are easily accessible so that you can add any features you need. This board has been tested with the Vasco PUF and the Pinguino USB bootloaders.

 

 

For more detail: PIC MICROCONTROLLER PROJECTS AND LCD CIRCUITS

The post PIC MICROCONTROLLER PROJECTS AND LCD CIRCUITS appeared first on PIC Microcontroller.

digital thermometer using pic microcontroller and MCP9700

$
0
0

In this article you will learn, how to design digital thermometer using pic microcontroller and MCP9700? You will learn how to interface MCP9700 with PIC16F877A microcontroller?  How to measure temperature using MCP9700 low power voltage output temperature sensor. Before reading this article you should have idea of lcd interfacing with pic microcontroller and how to measure analog voltage using pic microcontroller? If you don’t know about them, I recommend you to read followings articles first. After reading following article, you will be able to understand circuit diagram and code of MCP9700 based digital thermometer using pic microcontroller.digital thermometer using pic microcontroller and MCP9700

MCP9700 temperature sensor

It is voltage output sensor. It is low power and low cost temperature sensor. It converts temperature into voltage. Voltage can be easily measured with the help of microcontroller. Microcontroller reads voltage with the help of analog to digital converter. Measured voltage converted back into temperature using mathematical manipulation in programming. I will discuss it later in programming part of this article. It can give accuracy up to ±4%°C. It can measure temperature from -40°C to +125°C. It consumes a minimum amount of operating current 6μA. It can derive large capacitive loads.

MCP9700 temperature sensor working

MCP9700 temperature sensor consists of PN junction diode. The main temperature sensing element is PN junction diode. PN junction electrical characteristics contains temperature coefficient which provides change in voltage with change in temperature.  The change in voltage is scaled with change in temperature according to  following step per division:

MCP9700 interfacing with microcontroller

MCP9700 based digital thermometer does not require any external components. It does not require any signal conditioning circuit. It can be directly interfaced with ADC of microcontroller. In MCP9700 1°C = 10.0 mV . General interfacing diagram of MCP9700 is shown below:

As shown in above figure. MCP9700 comes with three pins package. Three pins are power supply pin, ground pin and output voltage pin.digital thermometer using pic microcontroller and MCP9700 schematich

circuit diagram of MCP9700 interfacing with pic microcontroller

Its interfacing diagram with pic microcontroller is shown below. LCD is interfaced with pic microcontroller to display temperature. PIC16F877A microcontroller measure output voltage of temperature sensor with the help of ADC as shown in figure below:

 

 

For more detail: digital thermometer using pic microcontroller and MCP9700

The post digital thermometer using pic microcontroller and MCP9700 appeared first on PIC Microcontroller.

PIC Microcontroller Basics and Applications for Engineeing Students

$
0
0

The microcontrollers plays an essential role in the embedded industry  after the development of Intel 8051. The research in the field of embedded  industry gave high efficient, low power consumption microcontrollers. The Arm, AVR and PIC microcontrollers are the prime examples. These microcontrollers are getting smart with communication protocols such as I2C, USB, SPI,CAN and Ethernet. In the year 1998, microchip technology developed microcontrollers with new complex architecture and superior inbuilt peripherals. PIC microcontroller is based on Hardward Architecture and these microcontrollers are widely used for industrial purposes due to its high performance and low power consumption.The applications of this microcontroller mainly involves in PIC microcontroller projects.This article discusses about the PIC microcontroller projects, that are listed below.PIC Microcontroller Basics and Applications for Engineeing Students

PIC Microcontroller Projects

PIC microcontroller gives a fantastic way of making projects. This microcontroller is a processor with built in memory & RAM, these are used to control the projects. PIC microcontroller has various useful built in modules like timers, EEPROM, UART and analog comparators.Even with just these four modules we can build many PIC microcontroller projects.

PIC Microcontroller based Solar Photovoltaic Power Measuring

The main goal of this project is to measure solar cell parameters through various sensor data acquisition. This project uses a solar panel that always monitors the sunlight, and the different parameters of the solar panel like current, voltage, temperature and light intensity are monitored  using a PIC microcontroller. The light intensity is measured using an LDR sensor. Similarly, the current by current sensor, voltage by voltage divider principle and the temperature by temperature sensor. All these data are displayed on the LCD display, which is interfaced to the PIC microcontroller.

Auto Intensity Control of Street Lights using PIC Microcontroller

The main aim of this project is designed to control the auto intensity of street lights. This project uses LEDs  in the street lighting system, because LEDs consumes less power as compared to the conventional HID lamps.The PIC16F8 microcontroller is used to control the light intensity by developing PWM signals that makes a MOSFET to switch the LEDs to achieve the desired operation.A bunch of LEDs are used to form a street light. The PIC microcontroller contains programmable instructions to control the light intensity based on PWM signals generated. The intensity of the lights are kept high during the peak hours, as the traffic on the roads tend to decrease slowly in the late nights, the light intensity will decreases progressively till morning.Finally, it shuts down at morning and again continues at evening.

PIC Microcontroller based Medication Reminder

The main intention of this project is to design a medication reminder using PIC microcontroller. This project helps to remind a patient to take medicine at the arranged time and also displays the name of the medicine. This project is very helpful for old people and also who are very busy. A patient can store the particular time of a medicine through a matrix keypad. Based on the clock interfaced to the microcontroller, the programmed time for the medicine is displayed on the LCD. A buzzer is used to give an alert to the patient to take the medicine.

Pre Stampede Monitoring and Alarm System using PIC Microcontroller

The main goal of this project is to design a pre warning system to avoid stampede in places where a large crowd of people takes place. This proposed system warns in advance to authorities about the gathering of people in a particular place before any stampede occurs. This project uses a large number of pressure switches that are interfaced to a PIC microcontroller. When a certain number of switches are pressed, then the microcntroller generates an o/p to switch on a buzzer to give an alert to the authorities about a possible stampede.The status is also displayed on the LCD display.PIC Microcontroller Basics and Applications for Engineeing Students schematich

RFID Based Device Control and Authentication using PIC Microcontroller

This project is used to provide security in an organization by letting only the authorized person to access the secure area. This project uses RFID technology that contains an IC, used for processing and storing information and modulating and demodulating the RF frequency signal which is being transmitted. Once the person shows the RFID tag to the card reader, it scans the information stored in the tag and compares it with the data stored in the system. When the data matches with that in the microcontroller, the load will be turned ON  which is driven by a relay and it displays a message and ldquo;”AUTHORIZED” and rdquo; else states “UNAUTHORIZED” and doesn’t allow access.

 

 

For more detail: PIC Microcontroller Basics and Applications for Engineeing Students

Current Project / Post can also be found using:

  • microcontroller programming and project led

The post PIC Microcontroller Basics and Applications for Engineeing Students appeared first on PIC Microcontroller.


PIC Waveform Recorder

$
0
0

In this article I’ll show you how you can use PIC microcontroller to record and store waveform patterns in its EEPROM memory and replay the sequence later. For this purpose we’ll need a signal/waveform generator to produce the signal, PIC internal A/D converter to sample and digitize the incoming signal, external  I2C 8-bit D/A PCF8591 to convert it back to analog form and a simple PIC programmer to download the code into microcontroller FLASH memory. Up to 256 discreet 8 bit words then will be stored in PIC EEPROM memory. Source code can be downloaded at the bottom of the page.PIC Waveform Recorder

Few words about the code: The source code is written in assembly language and uses Microchip EEPROM writing/reading sequence as a basis for signal recording. For simplicity reason only 128 of 256 available bytes are used. To test circuit functionality connect the signal source to AN1 input and Scope to digital to analog converter output. I’ve used RIGOL DG4062 waveform generator and DS2072 oscilloscope to test this design. Press Record push button to record one cycle of the wave. Now you can disconnect the generator. Press Play to output one cycle of the recorded waveform. Signals in the lower KHz range seem to work OK. Next figure shows the schematic of this simple design.PIC Waveform Recorder schematich

Limitations and possible future improvements of current design: A better synchronization routine is needed in order to avoid glitches while reproducing the recorded waveform. The beginning of the next cycle should start exactly were the previous cycle has stopped. The best way to improve the quality of the signal is to increase the memory size so you can store more waveform values in one cycle, also signal frequency range is limited due to I2C speed limit for A/D converter, currently set at 100KHz. Faster D/A should be used to increase the frequency range. Source code is here.

 

 

For more detail: PIC Waveform Recorder

Current Project / Post can also be found using:

  • ch340 serial to usb schematic
  • schematic ch340 serial to usb

The post PIC Waveform Recorder appeared first on PIC Microcontroller.

Serial LCD project using PIC16F877A Microcontroller

$
0
0

This project shows you how to create a serial LCD module that you can drive from any serial RS232 interface. It uses a pure ASCII command set so you can control it easily from a terminal program such as Hyperterminal.
There  are no ‘odd’ command sequences such as 0xef to define a command  – you can type all commands at the terminal interface making it very easy to use

Serial LCD project
It’s also easy to test it out manually before driving it with a program.

Once you have decided what you want to do a microcontroller can generate the same commands or you can send them from a PC program.

If you want to use it as a debugging terminal for your PIC projects then it makes sense to remove the level translator and just use the  0-5V input otherwise you would end up having two level translators for no real reason!

Note: Using it like this you will need to invert the RS232 output data so you either need an inverter chip if driven from the built in USART or you can drive it using a software USART (The transmitter part anyway) since you will have full control over the output signal.

Serial LCD Specification

 

Baud Rate 2400
Crystal 20Mhz – you can use  a lower value xtal but must re-compile the files and set the clock value into the MikroC chip settings.

Serial LCD Project Details

You can recompile the serial LCD files if you want examine code operation (using the built in simulator) or change the source code. Note the hex file is contained in the download.

 

Serial LCD Command set

All commands are prefixed with the hash character ‘#’.  In all cases except #X and #Y the single character following the ‘#’ causes a command to execute.  For #X and #Y the decimal digits following (up to 2 digits) specify a position on the display.

Note: for #X and #Y the top left position is at 0,0.

Serial LCD Command Set list (uses upper or lower case):

 

Serial LCD Commands
#C or #c Clear screen
#H or #h Cursor Home
#L or #l Cursor Left
#R or #r Cursor Right
#U or #u Cursor Underline mode
#B or #b Cursor Block mode
#I or #i Cursor Invisible
#F or #f Display OF
#O or #o Display On
#Xnn or #xnn Cursor X position (left nn=0)
#Ynn or #ynn Cursor Y position (top nn=0)
#> or #. Scroll display right (hash dot as easier to type!)
#< or #, Scroll display left (hash comma as easier to type!)
## Display a ‘#’ character.

 

To clear the display you would type:

#C

To set the cursor to block mode type:

#B

X and Y commands

There must be at least two digits following the  #X or #Y command unless the following command is not a digit.   All this means is that you can finish an X or Y commands by typing a letter – if you type a digit the parser won’t know if it is a digit to display or a digit to specify the position.

Here is a cursor positioning example command sequence:

#H Home Sets cursor position to (0,0) – top left.
#X3JFM Set X and print Sets the X position to 3 and prints JFM
(Note the cursor is only moved once the J is entered).

You can also use the longer command:

#H#X00JFM

It does exactly the same thing but the cursor is immediately moved after the ’00’ since the command parser knows that it is the end of the X cursor position command as it only accepts 2 digits.

 

For more detail: Serial LCD project using PIC16F877A Microcontroller

The post Serial LCD project using PIC16F877A Microcontroller appeared first on PIC Microcontroller.

PlayPIC – A Tutorial Board for the PIC16F84A Microcontroller

$
0
0

This is a new design of a tutorial board based on the popular PIC16F84A microcontroller. It features eight single leds, a 7-segment display, an LCD display and five push buttons. It is an ideal solution for the beginner to take his/her first programming steps in the world of microcontrollers. Having an in-circuit-programming (ICP) header, it can be easily reprogrammed without unplugging the microcontroller each time, provided that the programmer also supports this feature (like OziPic’er).

PlayPIC - A Tutorial Board for the PIC16F84A MicrocontrollerConnections

PIC16F84A Feature
RA0 JP2 – S3 – JP4
RA1 JP2 – S4 – JP4
RA2 JP2 – S5 – JP4
RA3 JP2 – S6 – JP4
RA4 JP2 – JP4
RB0 JP2 – LED1 – 7 Seg (dp) – S7 Debounce – Buzzer
RB1 JP2 – LED2 – 7 Seg (a) – LCD RS
RB2 JP2 – LED3 – 7 Seg (b) – LCD R/W
RB3 JP2 – LED4 – 7 Seg (c) – LCD E
RB4 JP2 – LED5 – 7 Seg (d) – LCD DB4
RB5 JP2 – LED6 – 7 Seg (e) – LCD DB5
RB6 JP2 – LED7 – 7 Seg (f) – LCD DB6
RB7 JP2 – LED8 – 7 Seg (g) – LCD DB7
PlayPIC PCB

PlayPIC - A Tutorial Board for the PIC16F84A MicrocontrollerFeature Description

  • S1 switches the board on and off. When on, the indicator led LED9 is lit.
  • S2 resets the microcontroller.
  • S8 switches the LCD display on and off.
  • S9 switches the eight individual leds AND the 7-segment display on and off.
  • Push buttons S3 to S6 correspond to RA0-RA3 inputs. They are enabled or disabled by the SW2 dip switch.
  • The SW1 dip switch enables or disables the following features :
    • Connects RB0 (used as output) to LED1.
    • Connects RB0 (used as interrupt input) to S7.
    • Enables the debouncing circuit for interrupt switch S7.
    • Connects RB0 (used as output) to the buzzer.

 

For more detail: PlayPIC – A Tutorial Board for the PIC16F84A Microcontroller

The post PlayPIC – A Tutorial Board for the PIC16F84A Microcontroller appeared first on PIC Microcontroller.

Easy Debugging Terminal using pic microcontroller

$
0
0

Build a simple 9600 BAUD 8n1 LCD terminal for debugging and testing the projects having RS232C output.

Introduction

This LCD terminal provide two modes of operation by selecting jumper J1. When J1 is open the terminal operate as a normal ascii display terminal, when J1 is closed the terminal displays the input serial data in hexadecimal format. This mode is useful for viewing raw data from the serial port output.

Easy Debugging Terminal using pic microcontrollerHardware

Figure 1 shows the circuit diagram of the Easy Debugging Terminal. IC U2 a PIC16F84 micro controller is used to control the operation of the terminal. Input signal is applied to connector K1. The circuit can be powered either by 9V dc adapter or by using a 9V battery. Jumper J1 select the operating mode of the terminal, J1 open for ascii terminal mode, closed for hexdecimal display mode. LED D3 can be controlled by software command provided in ascii mode. This LED output can also be used (with buffer circuit) to control the backlight of the LED backlit display. Variable P1 is used to adjust the contrast of the display. The circuit uses a 16×2 line LCD module, while a 16×1 module can also be used.

Figure 1: Circuit Diagram of Easy Debugging Terminal

Constructing the Circuit

The prototype board may be built using universal PCB having the same size as of LCD module so that LCD module can be mounted on top of universal PCB using SIP connectors.
For the parts list of the circuit view the file Lcdbom.txtSoftware

The software of the project was developed using PIC C compiler from CCS. The source code of the project is available in the file Lcd_Dtm.c, there are two types of hex files are available Lcd_Dtm.hex is used for 16×2 lines LCD module, while Lcd1.hex is used for 16×1 line LCD module. The user can easily modify the source file for other types of Lcd modules.

 

For ore detail: Easy Debugging Terminal

Current Project / Post can also be found using:

  • lcd serial pic

The post Easy Debugging Terminal using pic microcontroller appeared first on PIC Microcontroller.

Interfacing VFD with PIC Microcontroller

$
0
0

Vacuum fluorescent display can be a good alternative to a Liquid-crystal displays in some applications. They have a number of advantages over LCD like extended temperature range and excellent contrast in high brightness environment.Interfacing VFD with PIC Microcontroller The main disadvantage is higher power consumption making them less attractive in battery operated devices. In this post I’ll show you how you can use this type of display with microcontroller. You can purchase them on Ebay as I did here.CU16025 VFD module was used for this purpose as a direct replacement for 2×16 LCD display. Although the manufacturer of these modules provides some code examples I’ve used my own driver code (originally written for a LCD) and a parallel 8 bit connection to interface this display with PIC16F877A microcontroller. I’ve adapted assembly language subroutine that I wrote earlier for VFD module initialization and for sending data/command. The code was written in C in MPLAB X using XC8 compiler. The same subroutine was also used in VFD Voltmeter project. As you can see from the schematic below 2 PORTs were used to control the display. PORTD for data/command and PORTE for RS and Enable lines.Interfacing VFD with PIC Microcontroller schematich

The code consist of 3 main functions: Display initialization, WriteDataVFD , WriteCommandVFD. Command for example can be an address of one of the segments and data is the character you want to display in ASCII. Comments in the source code should provide you  with more detailed explanation on each instruction. Click here to download the code.

 

 

For more detail: Interfacing VFD with PIC Microcontroller

The post Interfacing VFD with PIC Microcontroller appeared first on PIC Microcontroller.

Viewing all 253 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>