Projeto:
Sistema micro-processado (c/ relógio mantido por bateria) para controlar o timer da iluminação, aquecedor, resfriador e temperatura.
Segue ultima atualização para quem não quiser ler todo o Post com tudo o que irá precisar para realizar este projeto:
segue todos arquivos necessários:
http://optotech.net.br/fzanoto/Termost.zip
Este projeto ficou assim:
- saída a rele para iluminação
- saída a rele para aquecedor
- saída de 12V para resfriador (cooler´s de PC)
- relógio em tempo real mantido por bateria
- teclas de função para programação de horários e set-point de temperatura
- indicador de horário e temperatura online no LCD 16x2
qualquer dúvida só pedir:
fzanoto@yahoo.com
Home page:
http://optotech.net.br/fzanoto
inté...
Aquecedor, timer e PH
Moderator: Equipe AqOL
Forum rules
1 - Não escreva o título do tópico ou a mensagem dele toda EM LETRAS MAIÚSCULAS, negrito ou coloridas.
2 - Quando postar imagens, coloque o endereço delas entre as tags [img] e [/img*] (sem *)
3 - Quando postar endereços da internet, coloque entre as tags [url] e [*/url] (sem *)
4 - Não poste dois assuntos diferentes no mesmo tópico. Se quiser perguntar algo diferente do assunto do seu tópico, crie um novo.
5 - Não cite a mensagem anterior inteira. Você pode citar ou copiar algum trecho dela que achar importante enfatizar, mas ela inteira não tem sentindo algum.
6 - Tente escrever utilizando o português correto. Aqui tem uma boa dica para facilitar isso.
1 - Não escreva o título do tópico ou a mensagem dele toda EM LETRAS MAIÚSCULAS, negrito ou coloridas.
2 - Quando postar imagens, coloque o endereço delas entre as tags [img] e [/img*] (sem *)
3 - Quando postar endereços da internet, coloque entre as tags [url] e [*/url] (sem *)
4 - Não poste dois assuntos diferentes no mesmo tópico. Se quiser perguntar algo diferente do assunto do seu tópico, crie um novo.
5 - Não cite a mensagem anterior inteira. Você pode citar ou copiar algum trecho dela que achar importante enfatizar, mas ela inteira não tem sentindo algum.
6 - Tente escrever utilizando o português correto. Aqui tem uma boa dica para facilitar isso.
- fzanoto
- Plantador
- Posts: 501
- Joined: 11 Feb 2008, 23:34
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
- Location: Ribeirao preto
- Contact:
Aquecedor, timer e PH
Last edited by fzanoto on 01 Mar 2011, 21:27, edited 3 times in total.
- Magro
- Montador
- Posts: 43
- Joined: 07 Feb 2008, 14:36
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
- Location: Curitiba
Cara deixa eu ver se entendi direito...
Ele controlaria:
-Iluminação com opção de ajuste de tempo, hora de liga/desliga (foto período)
- A temperatura do aquário, ligando e desligando um aquecedor e com indicação de temperatura do aquário
- E indicação do Ph da água.
Tudo isso num aparelho só?
Não eu nunca vi algo parecido, mas se achasse um comprava!
Abraços.
Ele controlaria:
-Iluminação com opção de ajuste de tempo, hora de liga/desliga (foto período)
- A temperatura do aquário, ligando e desligando um aquecedor e com indicação de temperatura do aquário
- E indicação do Ph da água.
Tudo isso num aparelho só?
Não eu nunca vi algo parecido, mas se achasse um comprava!
Abraços.
- fzanoto
- Plantador
- Posts: 501
- Joined: 11 Feb 2008, 23:34
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
- Location: Ribeirao preto
- Contact:
Segue o esquemático do protótipo, PCB, já testei parcialmente o circuito no proteus.
e o arquivo .hex do processador :
http://br.geocities.com/fzanoto/termostato.txt
(lembrando que após pegar este arquivo acima, renomear para termostato.hex)
segue o código fonte em PicBasic:
----------------------------------------------------------------------------------
'termostato
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds
DEFINE LCD_DREG PORTB
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTB
' Set LCD Register Select bit
DEFINE LCD_RSBIT 2
' Set LCD Enable port
DEFINE LCD_EREG PORTB
' Set LCD Enable bit
DEFINE LCD_EBIT 3
trisa = %00001011
portb = 0
trisb = %00000000
portc = 0
trisc = %00111000
adcon1 = %10000101
w0 var word
w1 var word
ph var word
res2 var word
temp var word
resto var word
sp_temp var word
tp0 var byte
tp1 var byte
tcl var byte
ligado var byte
desligado var byte
contador var word
periodo var word
flag var bit
enter var portc.5
cima var portc.4
baixo var portc.3
clear
pause 100
read 0,tp0
read 1,tp1
read 2,ligado
read 3,desligado
sp_temp = (tp0*255) + tp1
if (sp_temp = 65535) or (ligado = 255) then
write 0,$01 '27.0 graus
write 1,$0E
write 2,12 'periodo ligado
write 3,12 'periodo desligado
sp_temp = 270
endif
LCDOUT $FE, 1 'clear lcd
LCDOUT $FE, $c9, "Luz=desl"
'----------------------------------------------------------------------
loop:
pause 100 'delay geral ' ajuste do tempo
contador = contador + 1
if flag = 0 then
periodo = desligado *360 ' ajuste do tempo
endif
if flag = 1 then
periodo = ligado *360 ' ajuste do tempo
endif
if (contador > periodo) and (flag = 0) then
flag = 1
contador = 0
LCDOUT $FE, $c9, "Luz=lig."
high portc.6
endif
if (contador > periodo) and (flag = 1) then
flag = 0
contador = 0
LCDOUT $FE, $c9, "Luz=desl"
low portc.6
endif
gosub le_ad
if enter = 0 then 'tecla enter
goto menu
endif
gosub calcula_temp
gosub regula_temp
gosub calcula_ph
goto loop
'----------------------------------------------------------------------
le_ad:
adcin 0,w0
adcin 1,w1
return
'---------------------------------------------------------------------
calcula_temp:
w0 = w0 * 100 / 102
temp = w0/10
resto = w0//10
return
'---------------------------------------------------------------------
regula_temp:
LCDOUT $FE, 2, "Temp.= ",dec2 temp,".",dec1 resto
if sp_temp < w0 - 5 then 'histerese de 0.5 graus
LCDOUT $FE, 2, "Temp.= ",dec2 temp,".",dec1 resto," "
low portc.7
endif
if sp_temp > w0 then
LCDOUT $FE, 2, "Temp.= ",dec2 temp,".",dec1 resto," aqu."
high portc.7
endif
return
'---------------------------------------------------------------------------
calcula_ph:
w1 = w1 * 100 / 102
ph = w1/10
res2 = w1//10
LCDOUT $FE, $c0, "PH= ",dec2 ph,".",dec1 res2
return
'-----------------------------------------------------------------
menu:
while enter = 0
wend
lcdout $fe,1 ' clear lcd
read 0,tp0
read 1,tp1
w0 = (tp0*255) + tp1
menu_1
pause 100
lcdout $fe,2 , "Menu Ajusta temp"
sp_temp = w0/10
resto = w0//10
if w0 > 350 then
w0 = 350
endif
lcdout $fe,$c0 ,"Temp= ",dec2 sp_temp,".",dec1 resto
if cima = 0 then
w0 = w0 + 1
endif
if baixo = 0 then
w0 = w0 - 1
endif
if enter = 0 then
while enter = 0
wend
gosub grava_parametros
lcdout $fe,1 ' clear lcd
sp_temp = w0
goto menu2
endif
goto menu_1
'----------------------------------------------------------------
menu2:
while enter = 0
wend
lcdout $fe,1 ' clear lcd
read 2,ligado
read 3,desligado
menu2_1
pause 100
if ligado > 23 or ligado < 1 then
ligado = 12
desligado = 12
endif
lcdout $fe,2 , "Menu Iluminacao "
lcdout $fe,$c0 ,"Lig= ",dec2 ligado," Desl= ",dec2 desligado
if cima = 0 then
ligado = ligado + 1
desligado = desligado - 1
endif
if baixo = 0 then
ligado = ligado - 1
desligado = desligado + 1
endif
if enter = 0 then
while enter = 0
wend
contador = 0
gosub grava_parametros
lcdout $fe,1 ' clear lcd
LCDOUT $FE, $c9, "Luz=desl"
goto loop
endif
goto menu2_1
'------------------------------------------------------------------
grava_parametros:
tp0 = w0.byte1
tp1 = w0.byte0
write 0,tp0
write 1,tp1
write 2,ligado
write 3,desligado
return
'----------------------------------------------------------------
e o arquivo .hex do processador :
http://br.geocities.com/fzanoto/termostato.txt
(lembrando que após pegar este arquivo acima, renomear para termostato.hex)
segue o código fonte em PicBasic:
----------------------------------------------------------------------------------
'termostato
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds
DEFINE LCD_DREG PORTB
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTB
' Set LCD Register Select bit
DEFINE LCD_RSBIT 2
' Set LCD Enable port
DEFINE LCD_EREG PORTB
' Set LCD Enable bit
DEFINE LCD_EBIT 3
trisa = %00001011
portb = 0
trisb = %00000000
portc = 0
trisc = %00111000
adcon1 = %10000101
w0 var word
w1 var word
ph var word
res2 var word
temp var word
resto var word
sp_temp var word
tp0 var byte
tp1 var byte
tcl var byte
ligado var byte
desligado var byte
contador var word
periodo var word
flag var bit
enter var portc.5
cima var portc.4
baixo var portc.3
clear
pause 100
read 0,tp0
read 1,tp1
read 2,ligado
read 3,desligado
sp_temp = (tp0*255) + tp1
if (sp_temp = 65535) or (ligado = 255) then
write 0,$01 '27.0 graus
write 1,$0E
write 2,12 'periodo ligado
write 3,12 'periodo desligado
sp_temp = 270
endif
LCDOUT $FE, 1 'clear lcd
LCDOUT $FE, $c9, "Luz=desl"
'----------------------------------------------------------------------
loop:
pause 100 'delay geral ' ajuste do tempo
contador = contador + 1
if flag = 0 then
periodo = desligado *360 ' ajuste do tempo
endif
if flag = 1 then
periodo = ligado *360 ' ajuste do tempo
endif
if (contador > periodo) and (flag = 0) then
flag = 1
contador = 0
LCDOUT $FE, $c9, "Luz=lig."
high portc.6
endif
if (contador > periodo) and (flag = 1) then
flag = 0
contador = 0
LCDOUT $FE, $c9, "Luz=desl"
low portc.6
endif
gosub le_ad
if enter = 0 then 'tecla enter
goto menu
endif
gosub calcula_temp
gosub regula_temp
gosub calcula_ph
goto loop
'----------------------------------------------------------------------
le_ad:
adcin 0,w0
adcin 1,w1
return
'---------------------------------------------------------------------
calcula_temp:
w0 = w0 * 100 / 102
temp = w0/10
resto = w0//10
return
'---------------------------------------------------------------------
regula_temp:
LCDOUT $FE, 2, "Temp.= ",dec2 temp,".",dec1 resto
if sp_temp < w0 - 5 then 'histerese de 0.5 graus
LCDOUT $FE, 2, "Temp.= ",dec2 temp,".",dec1 resto," "
low portc.7
endif
if sp_temp > w0 then
LCDOUT $FE, 2, "Temp.= ",dec2 temp,".",dec1 resto," aqu."
high portc.7
endif
return
'---------------------------------------------------------------------------
calcula_ph:
w1 = w1 * 100 / 102
ph = w1/10
res2 = w1//10
LCDOUT $FE, $c0, "PH= ",dec2 ph,".",dec1 res2
return
'-----------------------------------------------------------------
menu:
while enter = 0
wend
lcdout $fe,1 ' clear lcd
read 0,tp0
read 1,tp1
w0 = (tp0*255) + tp1
menu_1
pause 100
lcdout $fe,2 , "Menu Ajusta temp"
sp_temp = w0/10
resto = w0//10
if w0 > 350 then
w0 = 350
endif
lcdout $fe,$c0 ,"Temp= ",dec2 sp_temp,".",dec1 resto
if cima = 0 then
w0 = w0 + 1
endif
if baixo = 0 then
w0 = w0 - 1
endif
if enter = 0 then
while enter = 0
wend
gosub grava_parametros
lcdout $fe,1 ' clear lcd
sp_temp = w0
goto menu2
endif
goto menu_1
'----------------------------------------------------------------
menu2:
while enter = 0
wend
lcdout $fe,1 ' clear lcd
read 2,ligado
read 3,desligado
menu2_1
pause 100
if ligado > 23 or ligado < 1 then
ligado = 12
desligado = 12
endif
lcdout $fe,2 , "Menu Iluminacao "
lcdout $fe,$c0 ,"Lig= ",dec2 ligado," Desl= ",dec2 desligado
if cima = 0 then
ligado = ligado + 1
desligado = desligado - 1
endif
if baixo = 0 then
ligado = ligado - 1
desligado = desligado + 1
endif
if enter = 0 then
while enter = 0
wend
contador = 0
gosub grava_parametros
lcdout $fe,1 ' clear lcd
LCDOUT $FE, $c9, "Luz=desl"
goto loop
endif
goto menu2_1
'------------------------------------------------------------------
grava_parametros:
tp0 = w0.byte1
tp1 = w0.byte0
write 0,tp0
write 1,tp1
write 2,ligado
write 3,desligado
return
'----------------------------------------------------------------
Last edited by fzanoto on 24 Feb 2008, 10:49, edited 2 times in total.
- Rogério Bragil
- Ciclador
- Posts: 249
- Joined: 21 Oct 2005, 22:40
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
- Location: Vinhedo - SP
- fzanoto
- Plantador
- Posts: 501
- Joined: 11 Feb 2008, 23:34
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
- Location: Ribeirao preto
- Contact:
esqueci de colocar a lista de materiais:
-----------------------------------------------
Bill Of Materials
=================
Design: E:\proteus7.2\SAMPLES\termostato.DSN
Doc. no.: <NONE>
Revision: <NONE>
Author: <NONE>
Created: 14/02/08
Modified: 14/02/08
QTY PART-REFS VALUE
--- --------- -----
Resistors
---------
4 R1,R6-R8 10k
3 R2,R3,R5 1k
1 R4 4k
1 R9 100k
Capacitors
----------
1 C1 470uF
2 C2,C3 27pF
Integrated Circuits
-------------------
1 U1 PIC16F873A
1 U3 78L05
Transistors
-----------
2 Q1,Q2 BC547
Diodes
------
2 D1,D2 1N4007
3 D5-D7 1N4148
Miscellaneous
-------------
1 BAT1 9V
2 J1,J5 SIL-100-03
2 J2,J6 SIL-100-02
2 J3,J4 TBLOCK-I2
1 LCD1 LM016L
3 RL1-RL3 RELE_5P
2 RV1,RV3 20k
1 RV2 4k
3 SW1-SW3 BUTTON
1 X1 CRYSTAL
-----------------------------------------------
Bill Of Materials
=================
Design: E:\proteus7.2\SAMPLES\termostato.DSN
Doc. no.: <NONE>
Revision: <NONE>
Author: <NONE>
Created: 14/02/08
Modified: 14/02/08
QTY PART-REFS VALUE
--- --------- -----
Resistors
---------
4 R1,R6-R8 10k
3 R2,R3,R5 1k
1 R4 4k
1 R9 100k
Capacitors
----------
1 C1 470uF
2 C2,C3 27pF
Integrated Circuits
-------------------
1 U1 PIC16F873A
1 U3 78L05
Transistors
-----------
2 Q1,Q2 BC547
Diodes
------
2 D1,D2 1N4007
3 D5-D7 1N4148
Miscellaneous
-------------
1 BAT1 9V
2 J1,J5 SIL-100-03
2 J2,J6 SIL-100-02
2 J3,J4 TBLOCK-I2
1 LCD1 LM016L
3 RL1-RL3 RELE_5P
2 RV1,RV3 20k
1 RV2 4k
3 SW1-SW3 BUTTON
1 X1 CRYSTAL
- Rogério Bragil
- Ciclador
- Posts: 249
- Joined: 21 Oct 2005, 22:40
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
- Location: Vinhedo - SP
-
- Montador
- Posts: 45
- Joined: 20 Feb 2006, 21:23
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
fzanoto,
me interessei pelo seu projeto e gostaria de saber se todos os componentes, inclusive a placa do circuto, conseguimos comprar em lojas de eletrônica.
Se a resposta for positiva não encontrei a especificação da PCB?
Obrigado pela resposta.
me interessei pelo seu projeto e gostaria de saber se todos os componentes, inclusive a placa do circuto, conseguimos comprar em lojas de eletrônica.
Se a resposta for positiva não encontrei a especificação da PCB?
Obrigado pela resposta.
Setup:
Aqua plantado de 90 litros brutos com filtro Whisper 60(regulado para 1/3 da vazão), termostato aristos.
Flora: rotala macandra e Echinodorus bleheri
Fauna: 6 matos-grossos, 4 neons negros,8 neons cardinais, 3 coridora tigre e 1 Algaeater
Aqua plantado de 90 litros brutos com filtro Whisper 60(regulado para 1/3 da vazão), termostato aristos.
Flora: rotala macandra e Echinodorus bleheri
Fauna: 6 matos-grossos, 4 neons negros,8 neons cardinais, 3 coridora tigre e 1 Algaeater
- Rogério Bragil
- Ciclador
- Posts: 249
- Joined: 21 Oct 2005, 22:40
- Photography Portal AqOL: 0
- Articles in the Portal AqOL: 0
- Aquarium of the Month: 0
- Location: Vinhedo - SP
Return to “Faça Você Mesmo - FVM”
Who is online
Users browsing this forum: No registered users and 1 guest