Schlagwort-Archive: bitbastelei

BitBastelei #265 – DSO138 Oszilloskop-Bausatz

BitBastelei #265 - DSO138 Oszilloskop-Bausatz

(397 MB) 00:38:24

2017-12-10 11:00 🛈

Oszilloskope sind hochkompliziert und teuer – was soll man dann von einer 15€-Tüte erwarten, welche sich als Oszilloskop zum Selberbauen bezeichnet?

Inhalt

00:37 Der Bausatz
03:15 Aufbau
19:29 Funktionstest
21:30 Fehlersuche
26:09 Fertigstellung
34:04 Wie schlägt er sich?

Links

BitBastelei #264 – Fehlersuche: Etikettiergerät

BitBastelei #264 - Fehlersuche: Etikettiergerät

(456 MB) 00:20:24

2017-12-03 11:00 🛈

Alle Etikettiergeräte fliegen hooooch. Naja, das dachte sich offenbar der Besitzer dieses Modells. Offenbar hatte es den Dienst gleich an mehreren Stellen quittiert und flog daraufhin nicht nur sprichwörtlich aus dem Fenster. Nu denn, einen Blick können wir ja mal wagen, denn das innere solcher Geräte ist meist recht stabil.

Produktlinks:

BitBastelei #263 – Dell Server Fehlersuche

BitBastelei #263 - Dell Server Fehlersuche

(180 MB) 00:32:22

2017-11-26 11:00 🛈

Another one bites the dust. Mein Backupserver ließ sich beim letzten Versuch nicht mehr einschalten. Schauen wir mal, was ich seinerzeit darin verbaut hatte und ob wir noch etwas retten können.

(Ja, CMOS-Reset hatte ich auch versucht…)

BitBastelei #262 – Induktionskochfeld

BitBastelei #262 - Induktionskochfeld

(128 MB) 00:29:43

2017-11-19 11:00 🛈

Wer warm Essen möchte und nicht nur auf Fertigkost setzten möchte kommt um einen Herd wohl kaum herum. Inzwischen sind dort immer häufiger Induktionskochfelder zu finden, welche eine höhere Effizienz versprechen. Da ich ohenhin etwas derartiges brauchte und ein portables Gerät grade im Angebot durchlief schauen wir doch gleich mal rein.

Inhalt

01:45 Was ist Induktionskochen?
03:39 Lieferumfang des Produktes
06:05 Erster Test
11:12 Technische Beobacktungen
11:46 Öffnen des Gerätes
17:01 Blick auf die Platinen
24:42 Erste Messungen
25:29 Klassisches vs. Induktionskochfeld

Link

http://amzn.to/2j5Cykq
Affiliate-Link: Durch Nutzung erfährt Amazon, dass Ihr durch mich verwiesen wurdet. Ich erhalte einen Teil eures Einkaufswertes als Werbekosten. Für Euch ändern sich die Preise natürlich nicht.

[ICStation.com] BitBastelei #261 – GPS-Tracker mit Neo-6/7-Module und ESP8266

[ICStation.com] BitBastelei #261 - GPS-Tracker mit Neo-6/7-Module und ESP8266

(111 MB) 00:40:34

2017-11-05 11:00 🛈

In der letzten Woche haben wir uns angesehen, wie Satellitennavigationssysteme wie GPS funktionieren, nun wollen wir diese auch in der Praxis nutzen. Da die Berechnungen komplex sind ist es auch hier eine gute Idee spezialisierte ICs zu verwenden, welche eine einfache Schnittstelle für Mikrocontroller bereitstellen. ICStation.com bietet hierzu ein Modul auf Basis des mächtigen U-Blox Neo M6/M7 an, welches über UART angesprochen werden kann. Schauen wir mal auf das Modul, welche Optionen die Konfigurationssoftware bietet, den Aufbau des NMEA-Protokolls und bauen am Ende einen GPS-Trakcer auf Basis des ESP8266.

Links

Code

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <NMEAGPS.h>
#include <SoftwareSerial.h>

/**
 * Required libs (see manager):
 *   - SoftwareSerial
 *   - NeoGPS
 */

#define RTCMEMORYSTART 65

extern "C" {
#include "user_interface.h"
}

//WiFi
const char* ssid = "freifunk-myk.de";
const char* pass = "";

//URL of ownTracks Recorder
const char* owntracksURL = "http://adlerweb-vm-owntracks.ffmyk:8083/pub";

//User and Device for ownTracks
const char* owntracksUser   = "esp8266-1";
const char* owntracksDevice = "esp8266-1";

//Sleep between GNSS checks in minutes
//const unsigned int sleep_off = 5;
const unsigned int sleep_off = 1;

//Time for GNSS warm-up in seconds
//const unsigned int sleep_GNSS = 30;
const unsigned int sleep_GNSS = 10;

//Time to wait for 3D-Fix before reverting to 2D in seconds
const unsigned int sleep_3d  = 30;

//Time to wait for 2D-Fix before reverting to RF in seconds
const unsigned int sleep_2d  = 60;

//RF Geolocation Todo https://github.com/m0xpd/ESP8266-GeoLocation/blob/master/ESP8266_GeoLocate_2.ino

//Geo-deviation in deg-fract(?)
const unsigned int fence = 5000;

//Force update after x minutes
const unsigned int rf_force = 720;

//Time to wait for RF-Connect before giving up in seconds
const unsigned int rf_timeout = 60;

//GNSS Power Switch
#define GNSS_PWR_PIN D4
#define GNSS_PWR_ON  LOW

//Software UART for GNSS (RX, TX)
SoftwareSerial GNSSPort(D7, D8);
#define GNSS_BAUD 115200

//Hardware UART for Debug
#define DEBUG_PORT Serial
#define DEBUG_BAUD 115200

//Write all data when received
#define DEBUG_DUMP 0

NMEAGPS GNSS;
gps_fix fix;
int32_t lon=0, lat=0;
float vel=0,alt=0,cog=0;

bool delayGNSS(uint32_t dly) {
  return delayGNSS(dly, false);
}

bool delayGNSS(int32_t dly, bool direct) {
  unsigned long mstop = millis()+dly;
  bool ret = false;

  if(DEBUG_DUMP > 1) DEBUG_PORT.print(F("\nS:"));
  if(DEBUG_DUMP > 1) DEBUG_PORT.print(dly);

  do {
    if (GNSS.available( GNSSPort )) {
      fix = GNSS.read();
      ret = true;
      if(DEBUG_DUMP > 1) DEBUG_PORT.print('!');
    }
  }while(!ret && mstop > millis());

  if (fix.valid.heading) cog = fix.heading();
  if (fix.valid.speed) vel = fix.speed_kph();
  if (fix.valid.altitude) alt = fix.altitude();
  if (fix.valid.location) {
    lon = fix.longitudeL();
    lat = fix.latitudeL();
  }
  

  if(!ret) return false;
  if(!direct) {
    if(DEBUG_DUMP > 1) DEBUG_PORT.print('+');
    if(DEBUG_DUMP > 1) DEBUG_PORT.print(mstop-millis());
    delay((mstop-millis()));
  }
  return true;
}

bool getGNSS(void) {
  bool ret;
  if(delayGNSS(100, true)) {
    if(DEBUG_DUMP > 0) debugDump();
    return true;
  }
  return false;
}

bool wait_3d(void) {
  DEBUG_PORT.print(F("Waiting 3D Fix..."));
  for (unsigned int sec = 0; sec < sleep_3d; sec++) {
    if(getGNSS() && lon != 0 && lat != 0 && alt != 0) {
      DEBUG_PORT.println(F("OK"));
      return true;
    }
    Serial.print('.');
    yield();
    delayGNSS(1000);
  }
  DEBUG_PORT.println(F("NOPE"));
  return false;
}

bool wait_2d(void) {
  DEBUG_PORT.print(F("Waiting 2D Fix..."));
  for (unsigned int sec = 0; sec < sleep_2d; sec++) {
    if(getGNSS() && lon != 0 && lat != 0) {
      DEBUG_PORT.println(F("OK"));
      return true;
    }
    Serial.print('.');
    yield();
    delayGNSS(1000);
  }
  DEBUG_PORT.println(F("NOPE"));
  return false;
}

byte getBattery(void) {
  //@TODO not yet implemented
  return 100;
}

String getGeoDecimal(int32_t location) {
  unsigned long tmp1, tmp2;
  String out = "";

  if (location < 0) {
    out += '-';
    location = 0 - location;
  }

  tmp1 = location / 10000000;
  tmp2 = location - (tmp1 * 10000000);

  out += tmp1;
  out += ".";
  out += tmp2;

  return out;
}

bool getFence(void) {
  int32_t check = 0;
  DEBUG_PORT.print(F("FENCE - "));

  //Lat
  DEBUG_PORT.print(F("LAT:"));
  system_rtc_mem_read(RTCMEMORYSTART + 1, (int32_t *)check, 4);
  DEBUG_PORT.print(check);
  DEBUG_PORT.print('/');
  DEBUG_PORT.print(lat);
  if (check + fence > lat || check - fence < lat) {
    DEBUG_PORT.println('!');
    return true;
  }
  //Lon
  DEBUG_PORT.print(F(" - LON:"));
  system_rtc_mem_read(RTCMEMORYSTART + 2, (int32_t *)check, 4);
  DEBUG_PORT.print(check);
  DEBUG_PORT.print('/');
  DEBUG_PORT.print(lon);
  if (check + fence > lon || check - fence < lon) {
    DEBUG_PORT.println('!');
    return true;
  }

  DEBUG_PORT.println('_');
  return false;
}

NeoGPS::clock_t getTimestamp(void) {
  if (!fix.valid.date || !fix.valid.time) return 0;

  //This contains the seconds starting from the start of this century
  NeoGPS::clock_t seconds = fix.dateTime;

  //Guessing we're still 20xx this is the unix timestamp for 01.01.2000 00:00:00
  seconds += 946684800;

  return seconds;
}

bool rfConnect(void) {
  unsigned int rftimer;
  
  if(WiFi.status() == WL_CONNECTED) return true;
  
  DEBUG_PORT.print(F("connecting to "));
  DEBUG_PORT.println(ssid);
  if(pass == "") {
    WiFi.begin(ssid);
  }else{
    WiFi.begin(ssid, pass);
  }
  while (WiFi.status() != WL_CONNECTED && rftimer < rf_timeout) {
    delay(1000);
    DEBUG_PORT.print(".");
    rftimer++;
    yield();
  }
  if (WiFi.status() != WL_CONNECTED) {
    DEBUG_PORT.println(F("failed"));
    return false;
  }
  DEBUG_PORT.println(F("connected"));
  DEBUG_PORT.print(F("IP address: "));
  DEBUG_PORT.println(WiFi.localIP());
  return true;
}

void rfDisconnect(void) {
  /*WiFi.disconnect();
  WiFi.mode(WIFI_OFF);
  WiFi.forceSleepBegin();*/
}

bool rfSend(void) {
  String data;
  HTTPClient http;

  if (!rfConnect()) return false;
  if (lat == 0 || lon == 0) return false;

  http.begin(owntracksURL);

  http.addHeader(F("X-Limit-U"), owntracksUser);
  http.addHeader(F("X-Limit-D"), owntracksDevice);
  http.addHeader(F("User-Agent"), F("Adlerweb-ESP-Tracker"));
  http.addHeader(F("Content-Type"), F("application/json"));

  data  = "{\"_type\":\"location\",\"tid\":\"01\",\"conn\":\"m\",\"_cp\":true,\"batt\":";
  data += getBattery();
  data += ",\"lat\":";

  data += getGeoDecimal(lat);
  data += ",\"lon\":";
  data += getGeoDecimal(lon);

  if (cog != 0) {
    data += ",\"cog\":";
    data += cog;
  }

  if (vel != 0) {
    data += ",\"vel\":";
    data += vel;
  }

  if (alt != 0) {
    data += ",\"alt\":";
    data += alt;
  }

  data += ",\"tst\":";
  data += getTimestamp();
  data += "}";

  DEBUG_PORT.println(F("---"));
  DEBUG_PORT.println(data);
  DEBUG_PORT.println(F("---"));
  DEBUG_PORT.println(F("Send"));
  DEBUG_PORT.flush();
  http.POST(data);
  DEBUG_PORT.println(".");
  DEBUG_PORT.flush();
  http.writeToStream(&Serial);
  DEBUG_PORT.println(".");
  DEBUG_PORT.flush();
  http.end();
  DEBUG_PORT.println(F("OK"));
  DEBUG_PORT.flush();

  rfDisconnect();

  return true;
}

void debugDump() {
  DEBUG_PORT.print(F("Status: "));
  switch (fix.status) {
    case 1:
      DEBUG_PORT.println(F("Nährungswert"));
      break;
    case 2:
      DEBUG_PORT.println(F("Nur Zeit"));
      break;
    case 3:
      DEBUG_PORT.println(F("GNSS-Fix"));
      break;
    case 4:
      DEBUG_PORT.println(F("DGNSS-Fix"));
      break;
    default:
      DEBUG_PORT.println(F("Keiner"));
  }
  DEBUG_PORT.print(F("UTC: "));
  DEBUG_PORT.print(fix.dateTime.year);
  DEBUG_PORT.print("-");
  DEBUG_PORT.print(fix.dateTime.month);
  DEBUG_PORT.print("-");
  DEBUG_PORT.print(fix.dateTime.date);
  DEBUG_PORT.print(" ");
  DEBUG_PORT.print(fix.dateTime.hours);
  DEBUG_PORT.print(":");
  DEBUG_PORT.print(fix.dateTime.minutes);
  DEBUG_PORT.print(":");
  DEBUG_PORT.print(fix.dateTime.seconds);
  DEBUG_PORT.print(" - ");
  DEBUG_PORT.print(getTimestamp());
  DEBUG_PORT.print("/");
  //DEBUG_PORT.println(lasttime);

  DEBUG_PORT.print(F("Satellites: "));
  DEBUG_PORT.println(fix.satellites);

  DEBUG_PORT.print(F("Speed: "));
  DEBUG_PORT.println(vel);

  DEBUG_PORT.print(F("Heading: "));
  DEBUG_PORT.println(cog);

  DEBUG_PORT.print(F("Altitude: "));
  DEBUG_PORT.println(alt);

  DEBUG_PORT.print(F("Postition: "));
  DEBUG_PORT.print(lat);
  DEBUG_PORT.print(",");
  DEBUG_PORT.println(lon);

  DEBUG_PORT.print(getGeoDecimal(lat));
  DEBUG_PORT.print(",");
  DEBUG_PORT.println(getGeoDecimal(lon));
}

byte getBootMode(void) {
  byte bootMode = 0;
  system_rtc_mem_read(RTCMEMORYSTART, &bootMode, 1);
  DEBUG_PORT.print("BootMode: ");
  DEBUG_PORT.println(bootMode);
  return bootMode;
}


/////////////


void setup() {
  int32_t dummy = 0;

  pinMode(GNSS_PWR_PIN, OUTPUT);

  DEBUG_PORT.begin(DEBUG_BAUD);
  GNSSPort.begin(GNSS_BAUD);

  delay(2000);

  DEBUG_PORT.println( F("Adlerweb GNSS Tracker v0.1.1") );
  DEBUG_PORT.flush();

  byte bootMode = getBootMode();

  if(bootMode == 0 || bootMode > 5) { //Unknown or first boot
    DEBUG_PORT.println(F("Enabling GNSS Power"));
    digitalWrite(GNSS_PWR_PIN, GNSS_PWR_ON);
    bootMode=1;
    system_rtc_mem_write(RTCMEMORYSTART, &bootMode, 1);
    DEBUG_PORT.print(F("Sleeping for "));
    DEBUG_PORT.print(sleep_GNSS);
    DEBUG_PORT.println(F(" Seconds"));
    DEBUG_PORT.flush();
    ESP.deepSleep(sleep_GNSS * 1e6);
  }

  if(bootMode == 1) { //Waiting for GNSS 3D Fix
    if (wait_3d()) {
      bootMode = 4;
    } else {
      bootMode++;
    }
  }

  if(bootMode == 2) {//Waiting for GNSS 2D Fix
    if (wait_2d()) {
      bootMode = 4;
    } else {
      bootMode++;
    }
  }
  
  if(bootMode == 3) { //Waiting for RF Fix
    //@TODO Not implemented
    bootMode = 5;
  }

  if(bootMode == 4) { //Fix Aquired - sending
    system_rtc_mem_read(RTCMEMORYSTART + 3, &dummy, 4);
    if (getFence() || dummy + (rf_force * 60) <= getTimestamp()) {
      bootMode = 5;
      if (rfSend()) {
        system_rtc_mem_write(RTCMEMORYSTART + 1, &lat, 4);
        system_rtc_mem_write(RTCMEMORYSTART + 2, &lon, 4);
        dummy = getTimestamp();
        system_rtc_mem_write(RTCMEMORYSTART + 3, &dummy, 4);
        bootMode = 0;
      } else {
        DEBUG_PORT.println(F("Transfer failed"));
        bootMode = 0;
      }
    }else{
      Serial.println(F("Position unchanged, no transfer"));
      bootMode = 0;
    }
  }

  if(bootMode == 5) { //No fix
    debugDump();
    bootMode = 0;
  }
  
  system_rtc_mem_write(RTCMEMORYSTART, &bootMode, 1);
}

void loop() {
  DEBUG_PORT.println(F("Disabling GNSS Power"));
  digitalWrite(GNSS_PWR_PIN, !GNSS_PWR_ON);
  DEBUG_PORT.print(F("Sleeping for "));
  DEBUG_PORT.print(sleep_off);
  DEBUG_PORT.println(F(" Minutes"));
  DEBUG_PORT.flush();
  ESP.deepSleep(sleep_off * 60e6);
}

Inhalt

  • 00:35 Das Modul
  • 09:07 Das NMEA-Protokoll
  • 13:33 Test & Konfiguration per U-Center
  • 18:02 GPS mit ESP8266 und Arduino
  • 19:05 Test mit SoftwareSerial
  • 20:47 GPS/WiFi-Tracking mit OwnTracks

Hinweise:

Das GPS-Modul wurde mir von ICStation.com für dieses Video kostenfrei zur Verfügung gestellt.

BitBastelei #260 – TFT-LED-Steuerung

BitBastelei #260 - TFT-LED-Steuerung

(160 MB) 00:26:24

2017-10-22 10:00 🛈

Mal etwas aus der „schauen wir halt mal“-Ecke: Ein alter, kaputter Tablet-LCD aus der Restekiste. In diesen steckt auch eine LED-Beleuchtung, welche sich eventuell als Lampe eignen könnte. Schauen wir mal, ob wie die LEDs entnehmen und die Ansteuerung verstehen können.

[ICStation.com] BitBastelei #259 – Audio-Frequenzweiche: Soundsystem-Recycling

[ICStation.com] BitBastelei #259 - Audio-Frequenzweiche: Soundsystem-Recycling

(84 MB) 00:18:17

2017-10-15 10:00 🛈

Es ist Laubbläserzeit – wohl dem, der Soundtechnisch dagegen halten kann. Leider sind meine Eigenbau-Mediacenter da etwas dünn aufgestellt, allerdings liegt noch ein altes, analoges 5.1-System in der Kiste. Könnte man aus dem Stereo-Ausgang des Raspberry Pi nur ein Bass-Signal für den Subwoofer erzeugen. Kann man natürlich, und eine dafür notwendige Frequenzweiche bietet ICStation.com als Bausatz an.

Links

Inhalt

00:00 Warum das Ganze?
02:26 Der Bausatz
05:36 Die Schaltung
07:10 Simulation
09:45 Erste Messung
11:46 Das fertige Modul
12:00 Blick in das Audiosystem
15:05 Frequenzweiche an der Box
16:38 Ozi-Auswertung mit Last

Hinweise

Der Bausatz wurde mir von ICStation.com für dieses Video kostenfrei zur Verfügung gestellt.

BitBastelei #258 – LED in der Steckdose? Geht das?

BitBastelei #258 - LED in der Steckdose? Geht das?

(60 MB) 00:21:41

2017-10-08 10:00 🛈

Eine LED in die Steckdose stecken klingt nicht sonderlich klug – aber seit wann lasse ich mich davon abhalten. Schauen wir mal was passiert, warum man nicht wie sonst einen Vorwiderstand nutzen sollte und was ein Kondensator damit zu tun hat.

Links zum Thema

[ICStation.com] BitBastelei #257 – Singende Tesla-Spule

[ICStation.com] BitBastelei #257 - Singende Tesla-Spule

(214 MB) 00:26:45

2017-10-01 10:00 🛈

Teslaspulen sind immer faszinierend – und das nicht nur in alten Computerspielen. Durch hochfrequente Wechselspannung und ein großes Übersetzungsverhältnis wird eine Hochspannung generiert, welche optisch interessante Plasmablitze erzeugt. Klingt nach Raketentechnik? Nicht ganz – für ein paar Euro verspricht dieser Bausatz von ICStation.com nicht nur einen einsteigerfreundlichen Aufbau, sondern auch gleich noch eine Musikfunktion.

Achtung: Hochspannung ist gefährlich. Nicht ohne Schutzmaßnahmen betreiben.

Links

Hinweise

Der Bausatz wurde mir von ICStation.com für dieses Video kostenfrei zur Verfügung gestellt

BitBastelei #256 – Analog-Multimeter Fehlersuche

BitBastelei #256 - Analog-Multimeter Fehlersuche

(94 MB) 00:10:21

2017-09-24 10:00 🛈

Ein alter Bekannter auf dem Basteltisch: Das Elavi 15n aus den 70ern war bereits in meinem alten Intro zu sehen. Nun kam es mit einer wenig aussagekräftigen Fehlermeldung in die Reparaturkiste: Bei Widerstandsmessung geht der Zeiger ins Negative. Schaun wir mal.