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.
I think the sensor schematic can probably be figured out over the Internet. Your Post#32 will be very helpful.

1) Post#1: Can you get a clear image of the same thing?
2) Post#4, top image: Can you get a clear image of the same thing and an image with the lever moved about half way up the scale?
3) Can you get a picture of the bottom of the moving contacts. That is, the part that slides against the mating areas on the PCB.

With those clear images and maybe a few more diode/resistance measurements, a schematic can probably be figured out. I am assuming that on the moving part there are just two contacts.

Finally, when you turn on the device (before you took it apart) did the pincers have to be closed, or could you turn it on with the pincers already partly open and have it still work properly?

John
 
I think the sensor schematic can probably be figured out over the Internet.
John, the board is simply a pair of switch matrices separated using the diodes; see post #51 for schematic.

It can be used in the same way as a standard switch matrix, except that attention has to be paid to whether a column or row is driven low as this will affect which matrix is read. See post #61 for code to read the matrix.

@vivian: perhaps you can get some understanding of how scanning a switch matrix works from here: https://jingfenghanmax.blogspot.com.au/2010/09/3-x-4-keypad-matrix.html
or https://www.dribin.org/dave/keyboard/one_html/ (don't worry about the selecting diodes section)
 
I saw post #51 and with due respect, I couldn't figure it out. I think I know what you intend from a high level, but not a single connection is shown.

I am used to working with Eagle and that design (post #51) would not lead to creation of a meaningful board design. If you looked at my critical pathway chart, you should realize that I consider the actual switch design a bit of a diversion at this time. Nevertheless, I can appreciate Vivian's desire to get it resolved and see it as no big deal doing that with a little additional information. At the very least, it will allow for real results during simulation -- at least if she uses Assembly, which I don't think she will. I don't know how C simulators work.

John
 
I saw post #51 and with due respect, I couldn't figure it out. I think I know what you intend from a high level, but not a single connection is shown.
If you didn't understand it, then I obviously need to work on my delivery. I tried to state that each intersection in the matrix shown in the drawing should have a switch; that is, every time a row wire crosses a column wire (in the diagram), it should be assumed that there is a switch there (between the row and column). I have seen switch matrices drawn in this manner on different occasions. The switch is 'turned on' when the wiper bridges the gap between the row and the column contacts on the PCB. I might redraw it some time.

If you looked at my critical pathway chart, you should realize that I consider the actual switch design a bit of a diversion at this time.
So then the pending step is to study the commercial device, then purchase a microcontroller, prototype board, programmer and temporary display.

I strongly believe that studying a commercial device is very important.

I think the next step should be defining the desired outcome of his/her project. This really is the most important step.
 
Ok, here's the schematic for the switch matrix again. Hopefully it makes sense. PB0-1 may have connections reversed, though this can be corrected in the code very simply.
 

Attachments

  • fat matrix.png
    fat matrix.png
    6.1 KB · Views: 221
I agree that is probably right based on available information in Vivian's post #32, now that you have fixed the diodes for the upper level and lower level ranges (e.g., the pair of diodes shown connected by the magenta line are segments 3, 7, not adjacent segments).

A few additional tests by Vivian should confirm it. Since it is at least a double-sided board, I usually confirm electronically where I think connections go, even though they may appear to be connected a certain way.

John
 
Hi Doug,

Now I'm using Proteus ISIS 7 Professional software to draw and test my circuit design. Do you know how to draw the fat matrix using the Proteus?

Thanks.

Vivian
 
now that you have fixed the diodes for the upper level and lower level ranges (e.g., the pair of diodes shown connected by the magenta line are segments 3, 7, not adjacent segments).
Sorry, not sure what you're referring to.

Now I'm using Proteus ISIS 7 Professional software to draw and test my circuit design. Do you know how to draw the fat matrix using the Proteus?
I haven't used Proteus in years, nor do I have a copy ATM. From what I remember it was very straight forward to use. If I were to simulate the matrix I would probably use two rotary switches to select the appropriate row and column together, or failing that, I'd use two sets if eight switches to do the same; beats placing 256 switches.
 
View attachment PIC16F887.PDF

Hi,

This is the circuit that I draw, can anyone check is my circuit design is correct. For the fat matrix, I assume there consists a lot of push-up button, so when the slider is slide, and stop at one of the button, then the button will be pressed, and from there the thickness of the skin can be known.

Thanks :eek:


Vivian
 
The resistors for the LEDs should be between the PIC outputs and the LEDs (not connected to Vcc).

As mentioned prior, the LEDs and extra switches can be added to the matrix using an extra pin.

You haven't connected your LCD.

Otherwise, at a glance, it looks good.
 
Hi Doug,

I have some question about the code for reading the caliper value,

1.
pow2[8] = {1, 2, 4, 8, 16, 32, 64, 128};
why need this?

2.
PORTA &= 0xF0;
what is this for? Is it to clear the column?

3.
TRISA = (TRISA & 0xF0) | ~pow2;
I not understand this.

4.
TRISB = 0xFF & ~pow2[j];
What is this for?

5.
if(pv & 0x0F != 0x0F)
what is this?


Sorry for so many question, i'm trying to understand the code. Thanks.


Vivian
 
Hi,

I have a question. Can I replace the potentiometer which connected to the LCD with a resistor? Because the potentiometer is too big, I want to make my device small.


Vivian
 
1. why need this?
This just allows a fast way to get a power of two value, because pow = 1 << i; (for i in 0..7)

2. what is this for? Is it to clear the column?
This is just to set the output value of pins on PE0-1 to 0. These pins are kept as inputs, except when one is driven low.

3. I not understand this.
It sets one of the PE0-1 pins as an output so that it can be driven low. The code should actually be: "TRISA = (TRISA & 0xF0) | (~pow2 & 0x0F);"

4. What is this for?
This sets one of the PB0-1 pins as an output so that it can be driven low. The code could be simplified to: "TRISB = ~pow2[j];"

5. what is this?
That is just checking if one of the PE0-1 pins have been pulled low.

I have a question. Can I replace the potentiometer which connected to the LCD with a resistor? Because the potentiometer is too big, I want to make my device small.
Depending on the display, you can sometimes just connect a resistor from the contrast pin to ground. You may need to place two resistors as a voltage divider, however.
 
Hi Doug,

Can I know what programming software are you using for programming the fat matrix code? If I use MicroC to program my code, is it same as the fat matrix?
Thanks

vivian
 
I used a notepad to write the code I posted. I think it can be compiled by any ANSI C compiler. You could use MicroC, but I believe the data types may be non-standard. Other options include HiTech PICC18, the Microchip C compiler, or SDCC.
 
Hi Doug,

I have question about the fat matrix. So assume now the PEO-1 (4 input) want to scan the column of the scale, how is it functioning? And the function of the 8 diode which connected with the PEO-1. I know diode's function is only allowed current flow from one direction. But I still can't figure out what is the function of diode in this fat matrix.


Vivian
 
Hi Doug,

For the fat matrix programming code, I found that you stated there as 'enable weak pull-ups on port B' for the coding of nRBPU=0, but from the PIC16F887 manual, it state that :

bit 7-0 WPUB<7:0>: Weak Pull-up Register bit
1 = Pull-up enabled
0 = Pull-up disabled

So, is that means the coding should change to nBRPU=1 in order to enable the weak pull-up? And I try to use the microC to run the code, it shows that ' Undeclared identifier 'nRBPU' ' for the nRBPU=0.


Vivian
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top