I am trying to do a circuit to help to cool a water resevoir. The cooling element will be a peltier.
Intention was to:
use 3 DS1820 devices to read temp of water plate, (perltier sandwiched), temp of 'hot' plate, and 1 to read ambient.
Then depending on whether there is a suitable difference (function to be decided upon), then I PWM on the peltier.
Output was going to be displayed on 3 7-segment displays, i.e. two degrees celcius+. plus one decimal place.
Once per a suitable time-frame, I was going to move between the temperature displayed, so I was going to use 3 other LEDs to indicate which temperature is visible.
I am starting to prototype, and will eventually end up with a circuit like the attached schematic, except hopefully without bugs.
I have wired up 3 displays, by connecting the equal pins first (i.e. a to a, to a) and then to the resistor and then to the PIC. This is on breadboard.
On the input side, I put 4 transistors along the edge of the board, connected the collectors together and then to +5V.
As I am starting to build the prototype, I have not added any other components, I am using the ICSP for power, have not put in the regulators yet, and am driving the transistors directly (base) from pins RA0,1,2,3 of the PIC. I am not determining temperature yet, and am not yet using the other components (or have them on the breadboard). Note, I am not using the logic gates yet, these cannot be slowing down the transistors.
Problem:
First three digits worked fine, I added one at a time by connecting the base to the relevant pin on the PIC.
When I added the fourth pin to the base of the transistor, I am starting to see ghosting on the second digit of the display. Disconnecting it, I notice that there is in fact a slight blip when the point is visible too.
Any ideas on what I am doing wrong? I don't think this is a timing issue in the code as such (as I would have thought it would affect the first digit, i.e. t[0] not t[1] when I add t[3]), have I somehow got capacitance on the lines? I didn't think that it would be large enough to partially light (seems about 50%) two wrong segments on a display.
Code is really simple at the moment, I have removed the creation of the arrays, numbers stores the pins to display a number/letter, t[] defines which pin (which will later be pin-set) is used to activate the transistor. Currently I have 4 LEDs for the 4th 'digit', speaker will come later (replacing the LED).
Whilst writing this up, I have realised that I have neglected to put a resistor between the PIC and the transistors. Is this an issue, it would affect how quickly (slightly) and how much current is let through.
BTW. Other components not in place, and not relevant to the problem:
X1 will connect to the DS1820 devices.
PELTIERCONNECT, will connect to the peltier
RELAYCONN is connected to a relay which needs a 12V source for the coil, this 12V will be in parallel to the 12V used for the source to the two regulators in this circuit (and on to the Peltier). The power through the relay will be AC, this relay etc. is outside of the project, but, I want to use the hall sensor A1323UA to confirm that the AC has current flowing.
The switch was in there in case I needed to disconnect RB6/7 for the ICSP, doesn't seem to be necessary so it will disappear,
Intention was to:
use 3 DS1820 devices to read temp of water plate, (perltier sandwiched), temp of 'hot' plate, and 1 to read ambient.
Then depending on whether there is a suitable difference (function to be decided upon), then I PWM on the peltier.
Output was going to be displayed on 3 7-segment displays, i.e. two degrees celcius+. plus one decimal place.
Once per a suitable time-frame, I was going to move between the temperature displayed, so I was going to use 3 other LEDs to indicate which temperature is visible.
I am starting to prototype, and will eventually end up with a circuit like the attached schematic, except hopefully without bugs.
I have wired up 3 displays, by connecting the equal pins first (i.e. a to a, to a) and then to the resistor and then to the PIC. This is on breadboard.
On the input side, I put 4 transistors along the edge of the board, connected the collectors together and then to +5V.
As I am starting to build the prototype, I have not added any other components, I am using the ICSP for power, have not put in the regulators yet, and am driving the transistors directly (base) from pins RA0,1,2,3 of the PIC. I am not determining temperature yet, and am not yet using the other components (or have them on the breadboard). Note, I am not using the logic gates yet, these cannot be slowing down the transistors.
Problem:
First three digits worked fine, I added one at a time by connecting the base to the relevant pin on the PIC.
When I added the fourth pin to the base of the transistor, I am starting to see ghosting on the second digit of the display. Disconnecting it, I notice that there is in fact a slight blip when the point is visible too.
Any ideas on what I am doing wrong? I don't think this is a timing issue in the code as such (as I would have thought it would affect the first digit, i.e. t[0] not t[1] when I add t[3]), have I somehow got capacitance on the lines? I didn't think that it would be large enough to partially light (seems about 50%) two wrong segments on a display.
Code is really simple at the moment, I have removed the creation of the arrays, numbers stores the pins to display a number/letter, t[] defines which pin (which will later be pin-set) is used to activate the transistor. Currently I have 4 LEDs for the 4th 'digit', speaker will come later (replacing the LED).
Rich (BB code):
main{ TRSIB=0x00;TRISA=0x00;
...
while(1){
o[3]=0b00001111;
o[0]=numbers[y];
o[1]=numbers[y+1];
o[2]=numbers[y+2];
int k=0;
while(k<10){
int i=0;
while(i<1600){
i++;
output(o,i);
}
k++;
}
y++;
if(y>7){y=0;}
}
}
output(char * o,int i){
int j=0;
for(int j=0;j<4;j++){
PORTA=t[j];
if(i>800 && j==1){
PORTB=o[j]-0b10000000;
}else{
PORTB=o[j];
}
PORTA=t[j];
if(i>800 && j==1){
PORTB=o[j]-0b10000000;
}else{
PORTB=o[j];
}
PORTA=0x00;
PORTB=0xFF;
} //End for
}
BTW. Other components not in place, and not relevant to the problem:
X1 will connect to the DS1820 devices.
PELTIERCONNECT, will connect to the peltier
RELAYCONN is connected to a relay which needs a 12V source for the coil, this 12V will be in parallel to the 12V used for the source to the two regulators in this circuit (and on to the Peltier). The power through the relay will be AC, this relay etc. is outside of the project, but, I want to use the hall sensor A1323UA to confirm that the AC has current flowing.
The switch was in there in case I needed to disconnect RB6/7 for the ICSP, doesn't seem to be necessary so it will disappear,
Attachments
-
125.8 KB Views: 49
Last edited: