Autor Tema: Tacometro arduino  (Leído 3676 veces)

Desconectado Manrique

  • Global Moderator
  • Oficial 1ª
  • ***
  • Join Date: Sep 2009
  • Mensajes: 3689
  • Ubicación: Madrid
Re:Tacometro arduino
« Respuesta #15 en: 06 Septiembre 2020, 18:33 »
Los imanes entran bastante ajustaditos:

  [ You are not allowed to view attachments ]  

Y la pieza acabada:

  [ You are not allowed to view attachments ]  

  [ You are not allowed to view attachments ]  

Torno quantum D250x550, fresadora BF20, ambos con DRO Shumatech, sierra de cinta quantum S91G, taladro chinorri

Desconectado Manrique

  • Global Moderator
  • Oficial 1ª
  • ***
  • Join Date: Sep 2009
  • Mensajes: 3689
  • Ubicación: Madrid
Re:Tacometro arduino
« Respuesta #16 en: 06 Septiembre 2020, 18:43 »
La parte electronica terminada a falta de instalar:

  [ You are not allowed to view attachments ]  

  [ You are not allowed to view attachments ]  

Este es el código que estoy utilizando:

// Include the library:
#include <TM1637Display.h>
#include <TimerOne.h>
// Define the connections pins:
#define CLK 4
#define DIO 5
const int hallPin=2;//pin para interrupcion desde sensor
volatile int contador=0;//contador de pulsos
volatile int rpm=0;
volatile bool flag=false;
int valueToShow=0;//valor mostrado en el display
int UltimaMedicionFiltrada=0;//valor de la ultima medicion filtrada
double Medicion=0;//medicion actual del sensor
double w=0.6; //constante de filtrado 0 muy filtrado 1 sin filtrar

// Create display object of type TM1637Display:
TM1637Display display = TM1637Display(CLK, DIO);
// Create array that turns all segments on:
const uint8_t data[] = {0xff, 0xff, 0xff, 0xff};
// Create array that turns all segments off:
const uint8_t blank[] = {0x00, 0x00, 0x00, 0x00};
// You can set the individual segments per digit to spell words or create other symbols:
const uint8_t done[] = {
  SEG_B | SEG_C | SEG_D | SEG_E | SEG_G,           // d
  SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,   // O
  SEG_C | SEG_E | SEG_G,                           // n
  SEG_A | SEG_D | SEG_E | SEG_F | SEG_G            // E
};
// Create degree Celsius symbol:
const uint8_t celsius[] = {
  SEG_A | SEG_B | SEG_F | SEG_G,  // Circle
  SEG_A | SEG_D | SEG_E | SEG_F   // C
};
void setup() {
  // Clear the display:
  //Serial.begin(9600);
  display.clear();
  delay(1000);
  Timer1.initialize(600000);         // Dispara cada 600 ms
  pinMode(hallPin,INPUT_PULLUP);//entrada señal
  Timer1.attachInterrupt(ISR_ShowSpeed); // Activa la interrupcion cada 0.6s
  attachInterrupt(digitalPinToInterrupt(hallPin),cuenta,RISING);
  display.setBrightness(7);
}
void loop() {
 
 

if(flag)//hace el calculo de velocidad y lo muestra
{
    Medicion=((rpm*15)/0.6);
    valueToShow=Medicion*w+(1-w)*UltimaMedicionFiltrada;//filtro exponencial
    UltimaMedicionFiltrada=valueToShow;//almaceno la ultima medicion filtrada 
    //Serial.println(Medicion);
    //Serial.println(UltimaMedicionFiltrada);
    //Serial.println(valueToShow);
    display.showNumberDec(valueToShow);
    flag=false;
  }
 
 
}
void cuenta()//incrementa el contador
{
contador++; 
 
  }
  void ISR_ShowSpeed()
  {
    rpm=contador;
    contador=0;
    flag=true;
    }



Esquema y pcb definitivos:
  [ You are not allowed to view attachments ]  

  [ You are not allowed to view attachments ]  

Cuando lo monte ya pondre más fotos y comentare si realmente funciona...
« última modificación: 06 Septiembre 2020, 18:50 por Manrique »
Torno quantum D250x550, fresadora BF20, ambos con DRO Shumatech, sierra de cinta quantum S91G, taladro chinorri

Desconectado Tr Precision Machining

  • Guru
  • *****
  • Join Date: Ene 2017
  • Mensajes: 15175
  • Ubicación: Territorio Rural ASTURIAS
Re:Tacometro arduino
« Respuesta #17 en: 06 Septiembre 2020, 21:14 »
Virutas..que bien..asi quitas el mono de maquina .brinda

Desconectado carpin

  • Global Moderator
  • Oficial 2ª
  • ***
  • Join Date: Sep 2009
  • Mensajes: 5307
  • Ubicación: SORIA
Re:Tacometro arduino
« Respuesta #18 en: 10 Septiembre 2020, 08:20 »
Muy bien colocados esos imanes, asi seguro que no se sueltan  .bien
A ver que tal funciona...
Torno Colchester Chipmaster 5x20, torno quantum D250x550 y fresadora HBM 45 Profi Dro, fresadora EMCO PC MILL 55, taladradora Optimun B17,  Afiladora casera, horno fundición electrico CARPIN

Desconectado kankarrio

  • Oficial 2ª
  • ***
  • Join Date: Sep 2011
  • Mensajes: 5519
  • Ubicación: leon
Re:Tacometro arduino
« Respuesta #19 en: 10 Septiembre 2020, 12:56 »
si la verdad es q me ha gustado la forma de encastralos .brinda
proyecto en construcción cumbre 022--fresadora einhell MBF 550-- 2 mini tornos einhell BT ML 300-- 2 taladros columna chinos-- soldadora inverter 80A --- soldadora AC 140A-- soporte para amoladora de 230mm -- UN CARRO DE TELARES MAS

Desconectado Manrique

  • Global Moderator
  • Oficial 1ª
  • ***
  • Join Date: Sep 2009
  • Mensajes: 3689
  • Ubicación: Madrid
Re:Tacometro arduino
« Respuesta #20 en: 13 Septiembre 2020, 17:56 »
Y todo montado y funcionando:
  [ You are not allowed to view attachments ]  

  [ You are not allowed to view attachments ]  

Un video:

https://youtu.be/8F6P6GixIrk

No es un tacometro para tirar cohetes, mas bien de mediocre a malo, pero me he entretenido un buen rato.
Cambiare un poco la configuración para ver si se hace más establ en la lectura.
Torno quantum D250x550, fresadora BF20, ambos con DRO Shumatech, sierra de cinta quantum S91G, taladro chinorri