Jetzt hab ich der Spielerei wegen das Gerät im Bild angehängt aber auch da kein wank an der mA Anzeige...
Bitte auch vorherigen Beitrag lesen.
Jetzt hab ich der Spielerei wegen das Gerät im Bild angehängt aber auch da kein wank an der mA Anzeige...
Bitte auch vorherigen Beitrag lesen.
Kann das sein das an P (Water Protection) ein Low also 0V liegen muss damit das Funktioniert?
P und Ground müssen gebrückt sein, sonst meint das Netzteil das kein Wasserfluss da ist. Das übernimmt doch bei dir auch der Ruida oder?
Nee ein Nano arduino mit Flow Sensor alles klar muss ich umklemmen dachte ich mir schon... die Idee kam mir als ich das Display. Angehängt habe.
so sieht das bei mir aus
Ah du hast auch das Display dran?
Ah du hast auch das Display dran?
Ja, das Display auf dem Netzteil bringt ja irgendwie nichts, was die sich dabei gedacht haben
Hast du das selbe Display wie ich?
Dieses Drehpoti ist das überhaupt in Funktion?
Hast du das selbe Display wie ich?
Dieses Drehpoti ist das überhaupt in Funktion?
Ja ist das gleiche, wofür das Poti ist weiß ich auch noch nicht, hab mich aber auch noch nicht so richtig damit beschäftigt
Ich hab schon gelesen das damit die Stromstärke justiert wird und dann die Fernsteuerung der Stromstärke nicht mehr geht.
Dann hab ich gelesen das das Ding keine Funktion hat.
Ich glaube probieren macht schlau.
Ich denke das es keine Funktion hat, zumindest nicht in Verbindung mit dem Ruida, aber wer weiß wer weiß was die da ausgetüftelt haben
Das hat mit dem Ruida nix zu tun.
Woher soll das Netzteil wissen welcher Controller angeschlossen ist?
Das hat mit dem Ruida nix zu tun.
Woher soll das Netzteil wissen welcher Controller angeschlossen ist?
Ok, mit dem Ruida war falsch ausgedrückt,
dann eben solange ein externes Signal (am IN-Eingang) anliegt, hat das Poti wohl keine Funktion. ODER, es funktioniert so oder so nicht
Anscheinend kann man am Lasernetzteil einen Schalter betätigen, um dieses Poti zu aktivieren oder zu deaktivieren...
9D0BB825-0B74-409D-916A-765BA89B5458.jpeg
Gruß
Michi
Alles anzeigenAnscheinend kann man am Lasernetzteil einen Schalter betätigen, um dieses Poti zu aktivieren oder zu deaktivieren...
9D0BB825-0B74-409D-916A-765BA89B5458.jpeg
Gruß
Michi
Korrekt man kann mit dem Poti wohl mechanische den maximalen Strom des Netzteiles von vornherein beschränken. Weiteres Feature für Sicherheit der Röhre. Aber eventuell habe ich das auch in der Konversation mit CR falsch interpretiert.
So einen Schalter hat mein Netzteil gar nicht, habe das MYJG-80W.
Ich glaube das gibt's erst ab dem 100W Netzteil.
Ich werd Wahnsinnig...
Gestern Abend hatte ich alles angeschlossen und es hat Funktioniert und heute will es ums verrecken nicht...
Es geht um das Sketch der mir mit das Flow Signal auswertet:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Fonts/FreeMonoBoldOblique12pt7b.h>
byte sensorInterrupt = 0; // 0 = digital pin 2
byte sensorPin = 2;
byte ok_pin =3;
byte alarm_pin = 4;
long millis_new;
long millis_old;
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
int pot1pin = A7; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
int Sollwert; // Variable für den Servo im Bereich 800 bis 2000µs
int val1;
int oldval; // Schwellwert variable
int pot2pin2 = A6; // analog pin used to connect the potentiometer
int val2; // variable to read the value from the analog pin
int Sollwert2; // Variable für den Servo im Bereich 800 bis 2000µs
int val12;
int oldval2; // Schwellwert2 variable
// Intiieren des Timer 1 für Servo-Impulse an Pin 9 und 10
void initServo() {
TIMSK1 = 0; // keine Interrupts
TCCR1A = _BV(WGM11); /* Fast PWM, ICR1 is top */
TCCR1B = _BV(WGM13) | _BV(WGM12) /* Fast PWM, ICR1 is top */
| _BV(CS11) ; // div 8 clock prescaler ( 0,5µs per tic )
OCR1A = 3000; // initiale Pulsbreite 1,5ms
OCR1B = 3000; // initiale Pulsbreite 1,5ms
ICR1 = 40000; // 20ms period
TCCR1A = TCCR1A & ~_BV(COM1A0) | _BV(COM1A1); // Output to pin 9 ( OCRA )
TCCR1A = TCCR1A & ~_BV(COM1B0) | _BV(COM1B1); // Output to pin 10 ( OCRB )
}
// Pulsbreite einstellen ( pos in µs )
void servo1Write(int pos) {
OCR1A = pos*2;
}
void servo2Write(int pos) {
OCR1B = pos*2;
}
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
millis_old=0;
millis_new=0;
pinMode(ok_pin,OUTPUT);
pinMode(alarm_pin,OUTPUT);
// digitalWrite(ok_pin,HIGH);
digitalWrite(alarm_pin,LOW);
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, HIGH);
pinMode( 9, OUTPUT );
pinMode( 10, OUTPUT );
initServo();
//SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
//Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Show initial display buffer contents on the screen --
// the library initializes this with an Adafruit splash screen.
display.display();
delay(2000); // Pause for 2 seconds
// Clear the buffer
display.clearDisplay();
display.setFont(&FreeMonoBoldOblique12pt7b);
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(SSD1306_WHITE); // Draw white text
display.cp437(true); // Use full 256 char 'Code Page 437' font
}
void loop() {
// Enable the interrupt
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
// put your main code here, to run repeatedly:
analogReference(EXTERNAL);
val = analogRead(pot1pin); // reads the value of the potentiometer (value between 0 and 1023)
Sollwert = map(val>>3, 0, 127, 500, 2500); // scale it to use it with the servo (value between 0 and 180)
if ( abs( Sollwert - oldval) > 45 ) { // <<-- 10 ist hier der Schwellwert
servo1Write(Sollwert); // sets the servo position according to the scaled value
oldval = Sollwert;
}
display.setCursor(10, 20); // Start at top-left corner
// Not all the characters will fit on the display. This is normal.
// Library will draw what it can and the rest will be clipped.
display.clearDisplay();
display.print("MIN ");
// display.setCursor(0, 36); // Start at top-left corner
val1 = map(val, 0, 1023, 0, 100);
display.print(val1); display.print("%");
// put your main code here, to run repeatedly:
analogReference(EXTERNAL);
val2 = analogRead(pot2pin2); // reads the value of the potentiometer (value between 0 and 1023)
Sollwert2 = map(val2>>3, 0, 127, 500, 2500); // scale it to use it with the servo (value between 0 and 180)
if ( abs( Sollwert2 - oldval2) > 45 ) { // <<-- 10 ist hier der Schwellwert
servo2Write(Sollwert2); // sets the servo position according to the scaled value
oldval2 = Sollwert2;
}
display.setCursor(10, 50); // Start at top-left corner
// Not all the characters will fit on the display. This is normal.
// Library will draw what it can and the rest will be clipped.
display.print("MAX ");
// display.setCursor(0, 36); // Start at top-left corner
val12 = map(val2, 0, 1023, 0, 100);
display.print(val12); display.print("%");
display.display();
delay(15);
}
/*
Insterrupt Service Routine
*/
void pulseCounter()
{
millis_new=millis();
if(millis_new-millis_old>50)
{
digitalWrite(ok_pin,LOW);
digitalWrite(alarm_pin,HIGH);
}
else
{
digitalWrite(ok_pin,HIGH);
digitalWrite(alarm_pin,LOW);
}
millis_old=millis();
}
Alles anzeigen
Auf D2 ist der Flow Sensor am Nano angeschlossen auf D3 gibt er raus wenn alles ok ist die 5V High und auf D4 wenn alles ok ist ein Low 0V.
Der D2 Pulsiert schön das hab ich mir auf dem Osci angesehen und auch verglichen mit einem nicht eingebaute Flow Sensor der gibt das Gleiche Signal.
Aber der Nano schaltet nicht um also gibt er mir das Lasernetzteil nicht frei. Klar kann ich das Brücken, will ich aber nicht!!!
An D3 steht 0V an D4 Stehen 5V unverändert, egal ob der Flow da ist oder nicht.
Ich habe alle Werte direkt an den Nano gemessen, näher ran geht es nicht mehr, also direkt auf der Platine.
Ich habe auch die Nanos mal getauscht um auszuschließen ob der Ein- Ausgang kaputt ist...
Gestern hat das funktioniert....... An der Verkabelung wurde nichts gemacht...
Teufel Teufel bin ich sauer.
Ich bin immer noch am rum Popeln mit dem Sketch und bin dringend auf Hilfe angewiesen...
ich bekomme das nicht ans laufen.
Der Letzte Sketch sieht so aus:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Fonts/FreeMonoBoldOblique12pt7b.h>
byte sensorInterrupt = 0; // 0 = digital pin 2
byte sensorPin = 2;
byte ok_pin =3;
byte alarm_pin = 4;
long millis_new;
long millis_old;
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
int pot1pin = A7; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
int Sollwert; // Variable für den Servo im Bereich 800 bis 2000µs
int val1;
int oldval; // Schwellwert variable
int pot2pin2 = A6; // analog pin used to connect the potentiometer
int val2; // variable to read the value from the analog pin
int Sollwert2; // Variable für den Servo im Bereich 800 bis 2000µs
int val12;
int oldval2; // Schwellwert2 variable
// Intiieren des Timer 1 für Servo-Impulse an Pin 9 und 10
void initServo() {
TIMSK1 = 0; // keine Interrupts
TCCR1A = _BV(WGM11); /* Fast PWM, ICR1 is top */
TCCR1B = _BV(WGM13) | _BV(WGM12) /* Fast PWM, ICR1 is top */
| _BV(CS11) ; // div 8 clock prescaler ( 0,5µs per tic )
OCR1A = 3000; // initiale Pulsbreite 1,5ms
OCR1B = 3000; // initiale Pulsbreite 1,5ms
ICR1 = 40000; // 20ms period
TCCR1A = TCCR1A & ~_BV(COM1A0) | _BV(COM1A1); // Output to pin 9 ( OCRA )
TCCR1A = TCCR1A & ~_BV(COM1B0) | _BV(COM1B1); // Output to pin 10 ( OCRB )
}
// Pulsbreite einstellen ( pos in µs )
void servo1Write(int pos) {
OCR1A = pos*2;
}
void servo2Write(int pos) {
OCR1B = pos*2;
}
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
millis_old=0;
millis_new=0;
pinMode(ok_pin,OUTPUT);
pinMode(alarm_pin,OUTPUT);
// digitalWrite(ok_pin,HIGH);
digitalWrite(alarm_pin,LOW);
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, HIGH);
// Enable the interrupt
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
pinMode( 9, OUTPUT );
pinMode( 10, OUTPUT );
initServo();
//SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
//Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Show initial display buffer contents on the screen --
// the library initializes this with an Adafruit splash screen.
display.display();
delay(2000); // Pause for 2 seconds
// Clear the buffer
display.clearDisplay();
display.setFont(&FreeMonoBoldOblique12pt7b);
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(SSD1306_WHITE); // Draw white text
display.cp437(true); // Use full 256 char 'Code Page 437' font
}
void loop() {
// put your main code here, to run repeatedly:
analogReference(EXTERNAL);
val = analogRead(pot1pin); // reads the value of the potentiometer (value between 0 and 1023)
Sollwert = map(val>>3, 0, 127, 500, 2500); // scale it to use it with the servo (value between 0 and 180)
if ( abs( Sollwert - oldval) > 45 ) { // <<-- 10 ist hier der Schwellwert
servo1Write(Sollwert); // sets the servo position according to the scaled value
oldval = Sollwert;
}
display.setCursor(10, 20); // Start at top-left corner
// Not all the characters will fit on the display. This is normal.
// Library will draw what it can and the rest will be clipped.
display.clearDisplay();
display.print("MIN ");
// display.setCursor(0, 36); // Start at top-left corner
val1 = map(val, 0, 1023, 0, 100);
display.print(val1); display.print("%");
// put your main code here, to run repeatedly:
analogReference(EXTERNAL);
val2 = analogRead(pot2pin2); // reads the value of the potentiometer (value between 0 and 1023)
Sollwert2 = map(val2>>3, 0, 127, 500, 2500); // scale it to use it with the servo (value between 0 and 180)
if ( abs( Sollwert2 - oldval2) > 45 ) { // <<-- 10 ist hier der Schwellwert
servo2Write(Sollwert2); // sets the servo position according to the scaled value
oldval2 = Sollwert2;
}
display.setCursor(10, 50); // Start at top-left corner
// Not all the characters will fit on the display. This is normal.
// Library will draw what it can and the rest will be clipped.
display.print("MAX ");
// display.setCursor(0, 36); // Start at top-left corner
val12 = map(val2, 0, 1023, 0, 100);
display.print(val12); display.print("%");
display.display();
delay(15);
}
/*
Insterrupt Service Routine
*/
void pulseCounter()
{
millis_new=millis();
if(millis_new-millis_old>30)
{
digitalWrite(ok_pin,LOW);
digitalWrite(alarm_pin,HIGH);
}
else
{
digitalWrite(ok_pin,HIGH);
digitalWrite(alarm_pin,LOW);
}
millis_old=millis();
}
Alles anzeigen
Was ich festgestellt habe ist das wenn ich den Flow Sensor der an D2 hängt abklemme springt der Ausgang D3 von 0 auf 5V und der D4 von 5V auf 0V, spiele ich aber dann mit dem Eingang D2 mit dem Kontakt der normalerweise an D2 hängt am Eingang D2 rum dann schaltet er wieder D3 und hin und Wieder her...
Eigentlich sollte es an D2 Pulsen und in dem Moment D3 5V und D4 0V werden und wenn D2 nicht mehr pulst D3 auf 0V gehen und D4 auf 5V.
Nimm mal Zeile 68 raus. Hatten wir doch schon...
Ne habe den Fehler jetzt endlich gefunden, Zeile 150 die 30 mS waren zu kurz hab jetzt auf 200 gestellt das reicht alle Mal.