Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digital Fat Calliper Sensor

Status
Not open for further replies.
Hi John,

Ok, now I have a clear idea on it. Since the 16F887 have 40pin, it too much for me, so I will change to PIC16F886 which only have 28 pin, I think it is more than enough. I will check again for the function of the 8 wires, hope I can figure out what their function is.:p
Thanks for your reply:)


Vivian
 
40 pins vs. 28 pins really makes no difference from the standpoint of programming, unless of course you need more than 28 pins.

You will need some sort of prototyping board. Inserting and removing a PIC or other large IC from a DIP socket can be difficult, particularly if it has a lot of pins. I use a zero-insertion force (ZIF)socket. They have thin and short connections on the bottom, so I add a machined pin header to each row. Then that fits the prototype board nicely.

John
 
Hi,

I want to add the 3 buttons (1-enter ; 1- decrease; 1-increase). The decrease and increase button will enable the user to input their age, weight and gender by pressing the button. Do you have any idea how to connect the buttons so that they can perform these function?

Vivian
 
Good morning. Hope you had a nice weekend.

That is a very open question. One way is to have each switch connect an MCU pin to ground. The pin will have a weak pull-up, so the MCU will sense a normally high pin on a port going low. If all the pins are on the same port, then one can simply read the port to find which pin is pressed. And of course, instead of pulling the MCU pin low, one could make the normal state low and pull the pin high.

You can get more complicated and use fewer pins on the MCU. Charlieplexing, which was just discussed, is one way to do that, but for just three switches, you still need three pins. Three pins can do as many as 6 switch inputs (i.e, 3x (3-1)).

Another way is to use the switches to ground different resistors in a string or ladder. That varies the resistance of the string and voltage drops across it. Measuring the voltage with an ADC will allow you to tell which buttons have been pressed. Here is a Wikipedia link to such ladders: https://en.wikipedia.org/wiki/Resistor_ladder . The ADC only uses one pin for input.

Unless you have lots of switches or too few pins, which does not appear to be the case with your project, I would recommend either of the first two methods.

John
 
Hi John,

Thanks for the reply. I found that the post #32 that I said the 8 wire is connected with the capacitor and resistor circuit is wrong. So now I still thinking what is the circuit for. Will it be the circuit for the switch?


Vivian
 
A good, in focus closeup of that part of the board may help, but I don't really see that it is necessary to figure it out. That is at least a double-sided board, and it can be tricky reverse engineering such circuits, particularly when they have a COB and LCD mounted so closely. It is hard to tell what is going on underneath the LCD.

The resistors/capacitors could be part of the MCU power supply, some sort of filter, a negative supply for the LCD, or whatever.

John
 
Hi John,

Thanks for your reply. Now I still study on the connection of the charlieplexing(12 wires) with the microcontroller. But I not very understand the connection. Do you know how is the connection?

Vivian
 
Check the schematic I posted awhile (post#34) back. You have only 4 wires, which allows 12 or fewer switches/contacts/inputs.

John
 
Hi,

I am confuse with the working of charlieplexing. I not understand how is the charlieplexing work as the input signal in the digital fat caliper. Between, there are 12 wires (8+4), that means all of the 12 wires are needed to connect to the 12 Input pin of the microcontroller?

Vivian
 
I not understand how is the charlieplexing work as the input signal in the digital fat caliper. Between, there are 12 wires (8+4), that means all of the 12 wires are needed to connect to the 12 Input pin of the microcontroller?
The calliper board doesn't use full charlieplexing, and yes, to use the board as-is, you will need to connect all 12 wires to the PIC. You'll also need a pull-up resistor on each wire (you can use the internal PIC pullups if it has them).
 
As there is some confusion re what the board does, please have a look at the attached sketch. You'll see the diodes connecting to PE0-1, with the opposite diode end and all the eight wires of PB0-1 entering an 8x8 matrix. Each intersection in the matrix can be connected by the calliper slider contact.

To use the board in the manner in which it was designed, you will need a pull-up resistor (e.g. 47k) on all 12 pins. You will also need to use 12 pins of the PIC. You would then have to scan the matrix to read each of four columns and then each of eight rows to get a single reading.

There are other ways of using the board however. e.g. you can replace the diodes with resistors and add another eight resistors to PB0-1 to allow you to take a reading using a single ADC input of your PIC.

There are other methods too, but the above two are probably the simplest and most reliable.
 

Attachments

  • fat matrix.gif
    fat matrix.gif
    15.4 KB · Views: 201
2012-11-01-216.jpg

Hi Doug,

Is it possible if I direct use the circuit (attached photo) and connect with the microcontroller? If so does, do I still need to add the pull-up resistor?

Vivian
 
The circuit board with all the contacts (that you've shown) is what I drew the above schematic diagram for. If you connect PB0-1 to PORTB of your '16F877, then you can use the internal pullups in the '877. You will still need 4 resistors to pull up the PE0-1 lines.
 
Hi Doug,

I have some confuse with the circuit that you has attached in post #51. For the wires in PBO-1, is that each of the wire is connected with all the diode? Attached is the circuit that I draw using the Orcade, is that correct?

charlieplexing.jpg


Vivian
 
For the wires in PBO-1, is that each of the wire is connected with all the diode? Attached is the circuit that I draw using the Orcade, is that correct?
The calliper slider contact can connect one horizontal wire to a single vertical wire at a time. All other wires are disconnected.
 
They are labels applied to groups of input and output pins. I forget which chip you decided upon. Download its datasheet from Microchip.com, and you will see the names. Using the 16F877 as just an example, its datasheet, page 9, shows the ports. Compare that to the pin numbers and port names on page 5.

The port pin identifications for PortB, e.g., RB1, RB2, RB3, etc. will be assigned to sequential pins, but that sequence can go around a corner of the chip. The supply pins are not given a port numbers. Some other pins, e.g., MCLR, and the pins used for an external oscillator may or may not be included in a port, depending on the chip.

From this question, is it safe to assume you are now studying programming? Which language?

Forgot to add that putting all like-kind inputs/outputs on one port, say the eight fine divisions of your caliper, can be an advantage when you go to read their state(s), as it can be done all at once. The alternative of reading some pins on one port and other pins on another port to make an 8-bit byte of data is a little more complicated and takes more time.

John
 
Hi John,

Thanks for your reply. Now I'm studying the C language for microcontroller.
I not very understand what do you mean by read the 8 fine division state.


Vivian
 
That comment relates back to your questions about the eight wires at PBO-1 . I think getting to the microcontroller at this time is far more important that resolving the details of that sensor.

Have you decided on the chip you will be using?

John
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top