Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me choose a microcontroller to interface temperature sensor

Status
Not open for further replies.

electronics_guy

Member level 2
Joined
Apr 12, 2012
Messages
49
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,655
Hi everyone,
I am a newbie.... can i use PIC16F877A micro controller to interface a temperature sensor? Or should i go for PIC18F series? Please help...... and also what kind of sensors does PIC16F877A microcontroller support?

Thanks in advance
 

The 18F series is more 'modern' than the 16F series, and more powerful (memory, speed, features), but the 16F877A is still a very useful chip. Personally I would say to use the 18F series unless you happen to already have a16F877A. If it does what you need, there's little reason not to use it.

Both 16F and 18F PIC's can interface with the same types of sensor - both have analogue inputs and digital I/O's, serial ports, PWM, timers etc. The 18F adds the occasional extra feature, like the odd motor controller PWM units and quadrature decoders. It tends to be a case of 'does this PIC have enough input/output pins for the job." That depends on how many things you want to interface.

To give you an example, I've been designing a project that uses a lot of digital I/O, PWM, UART, SPI to multiple other chips, display interface, quadrature, but no analogue. The design has gone from a PIC18F4431 (because it had all of the above, and just enough I/O pins for everything) to a dsPIC30F4011, because I ran out of program ROM in the 4431.

Then it went to a dsPIC30F6015, because I had to use I/O multiplexors on the 4011 due to fewer I/O pins on it. The 6015 is a 64-pin TQFP, while I really wanted to use a 40-pin DIP. However, Just one 64-pin TQFP chip won the trade-off against the 40-pin dsPIC4011 plus two extra chips for multiplexing (and additional code and PCB complexity).
 
Last edited:
Without knowing the details of your project, I would agree with Rick, if given a choice I would select the PIC18F over the PIC16F.

Unless of course this is a production design and every penny counts.

What type of temperature sensor are you referring? Can you elaborate on the project requirements?

Is this a hobby/educational project or commericial?

BigDog
 

Hi,

As already said you need to give us a bit more info to guide you.

What programming language are you thinking of using, do you have a dev board or programmer, what type of use are you putting the temp sensor to ?


While agreeing that the 18F series are better, there are some good 16F chips and ones like the 877A have many diy projects and tutorials based on them so if you are just starting out and relying on code examples from the web the 16Fs / 877A might be the better initial choice.

It is usually quite easy to migrate 16F code to 18F once you have learnt how to code.
 

Thank you everyone for your valuable answers.... There have been some changes.... I want to read the voltage from the battery.... So which sensor would you suggest me to use(which can be interface with A/D module of a PIC microcontroller)? And I will be using C language to write the code.


Thanks in advance
 

If the battery voltage is less or equal to your A2D reference you will need no sensor. If the battery voltage is more than the reference voltage you will need a resistor dividing network.
 

The bottom line is I want to develop a "Battery Management System". Is that possible using a PIC Microcontroller?
 

Anything's possible...

You're still not giving us much information to go on though. That won't get you the best help.

'Battery management system' - what type of cell/battery? In what system?

There are a plethora of 'battery management systems' available from most manufacturers. Is there some reason to build your own?
 

What are the user stories for your battery management system ?
 

All i want to do is, determine the the state of charge of the battery(which is Li-ion battery). I read some articles and got to know about BQ26500 IC from Texas Instruments. I was wondering if i could use it with my pic microcontroller?
 

BQ26500? You should be able to use that. I've not used the HDQ interface but having just read the datasheet, it looks easy enough. You can probably use the PIC's UART.
 
As Rick pointed out there are numerous Battery/Power Management devices available and many are designed to work in concert with a microcontroller.

I worked on a project a year or so ago which incorporated a bq2018 into the design with an C8051F120:

bq2018 Power Minder

The host microcontroller accessed the bank of registers and performed calculations based on the contained values.

The bq2018 is a low-cost charge/discharge
counter peripheral packaged in
an 8-pin TSSOP or SOIC. It works
with an intelligent host controller, providing
state-of-charge information for
rechargeable batteries.

The bq2018 measures the voltage
drop across a low-value series sense
resistor between the negative terminal
of the battery and the battery
pack ground contact. By using the accumulated
counts in the charge,
discharge, and self-discharge registers,
an intelligent host controller can
determine battery state-of-charge information.
To improve accuracy, an
offset count register is available. The
system host controller is responsible
for the register maintenance by resetting
the charge in/out and selfdischarge
registers as needed.


The bq26500 appears to manage many of the calculations internally, with the host microcontroller access the results of these calculations held in the devices registers.

So the answer to your question is Yes, if your battery chemistry is compatible with the device.

The HDQ is a 1-wire interface, easily bit banged.

BigDog
 
Thank you very much Rick and BigDogGuru. Both of you have given some really valuable suggestions. Will get back to you guys in case I am stuck... Thank you again.

:)
 

Hi again everyone. Now the next step. Which Microcontroller would be better for using an A/D module(coz i ll have to buy now). PIC16F series or PIC18F series. And also can anyone please highlight the differences between those two? Example: No. of ADC channels, Ports etc.....


Thanks
 

Go with 18F. They are more recent, faster, available in more variety, with more memory and more choice of peripherals, for not much difference in price. Number of ports and ADC channels depends just on the pin-count you go for, in either 16F or 18F.

you'll need to decide if you need 10-bit or 12-bit ADC, and keep in mind that you'll need a 'clean' power supply to get a good, steady reading, especially on the 12-bit. Most PIC's have 10-bit but some have 12-bit ADC.

Now - time to start deciding what and how many ports you need, and reading data sheets.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Hi Rick,
Thanks for the suggestion. There are so many microcontrollers in PIC18 family. And also what is the difference between the PIC18C series and PIC18F series? Which one should I opt?
 

The PIC18C series is a UV erasable EPROM with a Clear cover, while the PIC18F series is FLASH storage.

You can use the PIC selection tool to compare various PICs:

**broken link removed**

Microchip Advanced Product Selector

If your considering an 8-bit PIC the PIC18 series would be my suggestion.


BigDog
 
Thanks very much BigDogGuru. That really helps.... Will get back to u guys....

---------- Post added at 11:35 ---------- Previous post was at 10:53 ----------

Hello again,
I went through some data sheets of PIC18F family and, to be honest, I am confused about selecting the right controller. Need your valuable suggestions.... Plz help....
 

Take note that most Li-ion batteries are shipped with a "battery management circuit" that will :
Prevent discharge below 3.4 V
Limit both the caharge and load currents
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top