Show Posts
Pages: [1] 2
1  International / Deutsch / Re: Mein neuestes Projekt - Temperaturlogger - Temperatur in Datenbank speichern on: January 21, 2014, 06:40:36 am
ntop nutzt die RoundRobinDatabase von Tobi Oetiker, der Autor von MRTG smiley
Also eher umgekehrt, ntop sieht aus wie MRTG
2  International / Deutsch / Re: Mein neuestes Projekt - Temperaturlogger - Temperatur in Datenbank speichern on: January 15, 2014, 10:24:53 am
Cooles Projekt.

Ich habe was ähnliches gebaut um die Temp. unseres Warmwasser-Boilers zu messen. Dazu habe ich ein ENC28J60 an ein Nano gehängt und einen MiniWebserver geschrieben der auf HTTP requests mit den Werten der analogen Temperaturfühler (LM35)  antwortet. Die Werte hab ich mittels Linux Befehl "curl" abgefragt und an MRTG übergeben, der mir die Graphs erstellt hat.
Hier der Code:

Code:
/*
BoilMonDuino 1.0
================
Designed and programmed by ReDiculum (Roland Hansmann)
 
This is an active heat monitor for our warm water boiler.
There is an LM35 analog temp sensor attached on a outbound
tube attached to the boiler.
Thresholds and alerting is handled by external tools querying
the temperature over periodical HTTP requests.

Example MRTG UNIX subcommand:
`curl IPAddress`

The basic code is provided from the Arduino Forum sample
for a basic web server using EtherShield and EHTER_28J60
libraries from
http://trollmaker.com/article11/arduino-1-0-with-enc28j60-ethernet-shield-v1-1

CS = D10 (brown)
SI = D11 (orange)
SO = D12 (purple)
SCK = D13 (grey)
RST = RESET (white)
VCC = 3.3V (red)
GND = GND (black)
 
Use at your own risk!
*/

// Libraries
#include "etherShield.h"
#include "ETHER_28J60.h"

// ethernet interface mac address, must be unique on the LAN
static uint8_t mac[6] = {0x54, 0x55, 0x58, 0x10, 0x00, 0x24};
static uint8_t ip[4] = {10,0,72,72}; // IP address for the webserver
static uint16_t port = 80; // Use port 80 - the standard for HTTP

// Declarations
#define TEMP_SENSOR_WARMWASSER_PIN 0      // Analog Input 0
#define TEMP_SENSOR_ERWAERMER_PIN 1 // Analog Input 1
unsigned int tempWarmwasser;
unsigned int tempErwaermer;


ETHER_28J60 e;  // Create object

void setup () {
  Serial.begin(57600);
  
  e.setup(mac, ip, port);
}


void loop () {
  
  // Softreset every 30min  
  if (millis() >= 1800000) {
     asm volatile ("  jmp 0"); // Soft Reset
  }
  
  char* params;
  if (params = e.serviceRequest())
  {
    tempWarmwasser = (4.2 * analogRead(TEMP_SENSOR_WARMWASSER_PIN) * 100.0) / 1024;
    tempErwaermer = (4.2 * analogRead(TEMP_SENSOR_ERWAERMER_PIN) * 100.0) / 1024;
    e.print(tempWarmwasser);
    e.print("\r\n");
    e.print(tempErwaermer);
    e.print("\r\n");
    e.respond();
  }
}
3  Community / Exhibition / Gallery / Playing with Nokia LCD 3310 on: January 10, 2014, 11:23:21 am
I spent some hours in playing with the Nokia LCD and some input devices, so I wanted to share that funny thing.
What you need:

- Breadboard
- Arduino (I used a nano)
- Nokia 3310 LCD
- DS1307 RTC
- 10kOhm poti
- Photoresistor and a 620ohm Resi.
- Some jumper wires

Attach all components like described in the links in the code or Arduino Playground and you should get this funny stuff working well.

Code:
/* Playing with Nokia LCD 3310 by ReDiculum Jan. 2014

Use at your own risk
*/

//https://code.google.com/p/pcd8544/
#include <PCD8544.h>

//https://github.com/davidhbrown/RealTimeClockDS1307
#include <Wire.h>
#include <RealTimeClockDS1307.h>

static PCD8544 lcd;

void setup() {
   lcd.begin(84, 48);
}

void loop() {
  // Potentiometer on A3
  lcd.setCursor(0,0); lcd.clearLine();
  int potValue = map(analogRead(3),0,1023,0,100);
  lcd.print("Poti: ");
  lcd.print(potValue);
  lcd.print("% ");
  drawBar(0, map(potValue,0,100,403,420));
  
  // Phototransistor on A6
  lcd.setCursor(0,2); lcd.clearLine();
  int phoValue = map(analogRead(6),0,1023,100,0);
  lcd.print("Phot: ");
  lcd.print(phoValue);
  lcd.print("% ");
  drawBar(2, map(phoValue,0,100,403,420));

  // RealTimeClock on A4+5
  lcd.setCursor(0,4); lcd.clearLine();
  lcd.print("Time: ");
  RTC.readClock();
  lcd.print(RTC.getHours());  lcd.print(":");
  lcd.print(RTC.getMinutes());  lcd.print(":");
  lcd.print(RTC.getSeconds());
}

void drawBar(int line, int val) {
  for (int i = 403; i <= val; i++) {
    lcd.setCursor(i,line);
    lcd.drawColumn(0,8);
  }    
}



Poti playing


Photoresi playing
4  Community / Exhibition / Gallery / Re: Fairy Tale Phone on: January 06, 2014, 04:41:35 am
Finally I also used the SimpleSDAudio library and finished the project. Here's the final code and some pictures
Code:
/*
=============================================================================================
Fairy Tale Phone 1.0
by ReDiculum (Oct. - Dez. 2013)
-------------------------------
X-Mas 2013 Arduino project.
Using an old Zellweger Modell 70 (anno 1982) telephone with dial wheel.
The wheel can be spinned to count impulses and then playing one of ten different
audio fairies stored as 8bit full-rate (62500) mono PCM files named from 1.PCM to 10.PCM

SD Card > Arduino pinout:

CS (1)   -> Pin 10 (Chip select)
MOSI (2) -> Pin 11
MISO (7) -> Pin 12
SCK  (5) -> Pin 13

Ear phone  -> Pin 9 (protect with Diode against Pin 3) and GND
Dial wheel -> Pin 2 and GND
 
=============================================================================================

SimpleSDAudio library for audio playback from SD card
http://www.hackerspace-ffm.de/wiki/index.php?title=SimpleSDAudio
*/
#include <SimpleSDAudio.h>

#define IMPULSE_PIN 2 // Digital Pin 2. Read impulses
#define PHONE_PIN 3 // Digital Pin 3 (PWM) for phone tone output (protect with Diode against Pin 9)
#define SD_CHIPSELECT_PIN 10  // Digital Pin 10. SD Card chip select.
#define LED_PIN 13 // Digital Pin 13
#define TIME_WAIT 2000 // Waiting 2sec during dial wheel turns. Sufficient to catch 10 impulses
int countImpulse = 0; // The magic number to "dial" the music track number.

/* Sum of running millis and TIME_WAIT.
Must be long integer if kids are not dialing quickly :)
*/
unsigned long timeWaitEnd = 0;

void setup() {
  Serial.begin(57600); // Set console to 57600 baud
  Serial.println("=== FairyTalePhone based on SSDA ===");  

  pinMode(LED_PIN, OUTPUT); // onboard LED

  /* Turn on internal pullup resistor, because we pull the pin to ground.
  When the wheel gives impulse, the contact is opened (no current). That's
  when we have a digitalRead = 1.
  */
  digitalWrite(IMPULSE_PIN, HIGH);

  Serial.println("Ready to dial ...");

  // Play tone and wait here until the dial wheel has sent his first impulse
  tone(PHONE_PIN,420);
  while (digitalRead(IMPULSE_PIN) == 0) {
    delay(1);
  }
  noTone(PHONE_PIN); // Pssht! Here we go!

  Serial.print("Counting impulses ");
  timeWaitEnd = millis() + TIME_WAIT; // Summarize already passed millis since Arduino runs and TIME_WAIT.

  // Count all the dialed impulses until timeWaitEnd has reached
  while (millis() < timeWaitEnd ) {      
    if (digitalRead(IMPULSE_PIN) == 1) {
      /* Increment the amount of impulses if the contacts are opened.
      The wheel pulses with an interval of approx 70ms
      */
      countImpulse++;
      Serial.print(".");
      digitalWrite(LED_PIN, HIGH); // Blink LED ...
      tone(PHONE_PIN,1000); // ... and short tone (70ms) of 1khz to fill the gap
      delay(70);
      digitalWrite(LED_PIN,LOW);
      noTone(PHONE_PIN);
    }
  }

  Serial.println(" "); // New line

  /* If the dial wheel has been turned more than once by nervous kids
  and the amount of counted impulses exceeds 10, we just restart Arduino
  */
  if (countImpulse > 10) {
    Serial.print("Count exceeded 10 ("); Serial.print(countImpulse); Serial.println("), restarting");
    hangOff();
    asm volatile ("  jmp 0"); // Soft Reset
  } else {
    Serial.print("Preparing fairy tale number "); Serial.println(countImpulse);
    

    // Set Chip Select Pin
    SdPlay.setSDCSPin(SD_CHIPSELECT_PIN);
    // Initialize SD Card with library SimpleSDAudio
    if (!SdPlay.init(SSDA_MODE_FULLRATE | SSDA_MODE_MONO | SSDA_MODE_AUTOWORKER)) {
      tone(PHONE_PIN,100); delay(250); noTone(PHONE_PIN); delay(400);
      tone(PHONE_PIN,80); delay(600); noTone(PHONE_PIN);
      Serial.println("Error initializing SD Card");
      while(1);
    }

    /* define a char array with an index size of 6 and convert
    integer "countImpulse" to char "track" using utoa() function
    http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html
    */
    char track[6];
    utoa(countImpulse,track,10);
    // Append the suffix .PCM to the char array
    strcat(track, ".PCM");
    
    // Set the audio file if it exists and play it
    if (SdPlay.setFile(track)) {
      Serial.print("Playing..."); Serial.println(track);
      SdPlay.play();
      while(!SdPlay.isStopped()) {
        ;
      }
      SdPlay.deInit();
      hangOff();
      // That's it, we jump into loop() function
    } else {
      SdPlay.deInit();
      Serial.print("File "); Serial.print(track); Serial.println(" not found");
      tone(PHONE_PIN,80); delay(250); noTone(PHONE_PIN); delay(400);
      tone(PHONE_PIN,120); delay(600); noTone(PHONE_PIN);
    }
  }
}

void loop(void) {
    ; // Nothing to do here
    //asm volatile ("  jmp 0"); // or Soft Reset?
}

void hangOff(){
  // Hang off tone 5x
  delay(1000);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
}

Fritzing Layout






5  Community / Exhibition / Gallery / Re: Fairy Tale Phone on: December 13, 2013, 06:27:06 am
You say "fairy tales"; unless they are very short, are you including a function to remember the present position (and rewind a couple of seconds) when it goes on-hook?
I will upload max 5min swiss fairy tales which I ripped form old compact cassettes (tapes).
By hooking on, the power will interrupt the Pro Mini. Hooking off will power on the board. No store of current playing position.
6  Community / Exhibition / Gallery / Fairy Tale Phone on: December 13, 2013, 02:16:22 am
Hello Arduino Community

Here's my recent project as a X-Mas gift for my daughters. Using an old telephone with dial wheel and build in a Pro Mini with SD Card to play fairy tales over the ear phone.
I am not yet finished since I am waiting for the SD break out. Until now I soldered some pins on a MicroSD Adapter and a L78L33 regulator to get the stuff working properly

Here's some impressions:




Fist try to catch the impulse signal from the dial wheel and count them. Also playing with tone().


Prototype with all components


And here's the code with the TMRpcm library
Code:
/*
=============================================================================================
Fairy Tale Phone 1.0
by ReDiculum (Oct. - Dez. 2013)
-------------------------------
X-Mas 2013 Arduino project.
Using an old Zellweger Modell 70 (anno 1982) telephone with dial wheel.
The wheel can be spinned to count impulses and then playing one of ten different
audio fairies stored as 8bit 16.000khz mono WAV files named from 1.wav to 10.wav

SD Card > Arduino pinout:

CS (1)   -> Pin 4 (Chip select)
MOSI (2) -> Pin 11
MISO (7) -> Pin 12
SCK  (5) -> Pin 13

Ear phone  -> Pin 9 (protect with Diode against Pin 3) and GND
Dial wheel -> Pin 2 and GND
 
=============================================================================================

TMRh20's pcm library for Arduino
https://github.com/TMRh20/TMRpcm
*/
#include <SD.h>
#include <TMRpcm.h>
#include <SPI.h>

#define IMPULSE_PIN 2 // Digital Pin 2
#define PHONE_PIN 3 // Digital Pin 3 (PWM)
#define SD_CHIPSELECT_PIN 4  // SD
#define LED_PIN 13 // Digital Pin 13
#define TIME_WAIT 2000 // Waiting 2sec during dial wheel turns. Sufficient to catch 10 impulses
int countImpulse = 0;
unsigned long timeWait = 0;

TMRpcm music;  // Create object "music" from class "TMRpcm"

/* Sum of running millis and TIME_WAIT.
Must be long integer if kids are not dialing quickly :)
*/
unsigned long timeWaitEnd = 0;

void setup() {
  Serial.begin(57600); // Set console to 57600 baud
  Serial.println("=== FairyTalePhone based on TMRpcm ===");  

  pinMode(LED_PIN, OUTPUT); // onboard LED
  
  music.speakerPin = 9; // Set Pin for SD card audio output

  /* Turn on internal pullup resistor, because we pull the pin to ground.
  When the wheel gives impulse, the contact is opened (no current). That's
  when we have a digitalRead = 1.
  */
  digitalWrite(IMPULSE_PIN, HIGH);

  Serial.println("Ready to dial ...");

  // Play tone and wait here until the dial wheel has sent his first impulse
  tone(PHONE_PIN,420);
  while (digitalRead(IMPULSE_PIN) == 0) {
    delay(1);
  }
  noTone(PHONE_PIN); // Pssht! Here we go!

  Serial.print("Counting impulses ");
  timeWaitEnd = millis() + TIME_WAIT; // Summarize already passed millis since Arduino runs and TIME_WAIT.

  // Count all the dialed impulses until timeWaitEnd has reached
  while (millis() < timeWaitEnd ) {      
    if (digitalRead(IMPULSE_PIN) == 1) {
      /* Increment the amount of impulses if the contacts are opened.
      The wheel pulses with an interval of approx 70ms
      */
      countImpulse++;
      Serial.print(".");
      digitalWrite(LED_PIN, HIGH); // Blink LED ...
      tone(PHONE_PIN,1000); // ... and short tone (70ms) of 1khz to fill the gap
      delay(70);
      digitalWrite(LED_PIN,LOW);
      noTone(PHONE_PIN);
    }
  }

  Serial.println(" "); // New line

  /* If the dial wheel has been turned more than once by nervous kids
  and the amount of counted impulses exceeds 10, we just restart Arduino
  */
  if (countImpulse > 10) {
    Serial.print("Count exceeded 10 ("); Serial.print(countImpulse); Serial.println("), restarting");
    hangOff();
    asm volatile ("  jmp 0"); // Soft Reset
  } else {    
    Serial.print("Preparing fairy tale number "); Serial.println(countImpulse);
    
    // Initialize SD Card with library SimpleSDAudio
    if (!SD.begin(SD_CHIPSELECT_PIN)) {
      tone(PHONE_PIN,100); delay(250); noTone(PHONE_PIN); delay(400);
      tone(PHONE_PIN,80); delay(600); noTone(PHONE_PIN);
      Serial.println("Error initializing SD Card");
      while(1);
    }

    /* define a char array with an index size of 6 and convert
    integer "countImpulse" to char "track" using utoa() function
    http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html
    */
    char track[6];
    utoa(countImpulse,track,10);
    // Append the suffix .wav to the char array
    strcat(track, ".wav");
    
    // Play the audio file
    music.play(track);
    Serial.print("Playing..."); Serial.println(track);
    while (music.isPlaying() == 1) {
      true; // play WAV file number and wait until it's finished
    }
    hangOff(); // That's it, we jump into loop() function    
  }
}

void loop() {
  ;// Nothing to do
  //asm volatile ("  jmp 0"); // Soft Reset
}

void hangOff(){
  // Hang off tone 5x
  delay(1000);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
  tone(PHONE_PIN,450); delay(250);
  noTone(PHONE_PIN); delay(250);
}
7  Topics / Interactive Art / Re: Project - LASERino (Laser Staging Box) on: March 21, 2013, 03:16:28 am
Here here's almost the final result:
Top view


Front view


Rear view


Running live:
8  International / Deutsch / Re: Mit welchem Arduino soll ich anfangen? on: February 22, 2013, 06:01:59 pm
Wir Schweizer haben als Eselsbrücke unseren Kanton Uri  smiley-yell smiley-yell
9  Topics / Interactive Art / Re: Project - LASERino (Laser Staging Box) on: February 21, 2013, 02:59:06 am
Another 3h spent in drilling and soldering. The stepper and the 400rpm DC motor arrvied

Here's the ULN2003 driver just next to the laser driver. Above the LM7805 with its cooling unit. All cables will be attached at the end.




The Nano has all its necessary wires attached. Screwed to the bottom and USB is now pluggable from outside


This will be the final position of the DC and stepper (the stepper mirror is not adjusted yet)


The 400rpm DC motor with its mirror glued


And here's an updated version of the Fritzing schema
10  International / Deutsch / Re: Anfaenger Frage zu Arduino Projekt (LED / IR / Touchscreen) on: February 20, 2013, 10:15:16 am
D) Kappt das mit der Spannungsversorgung? Arduino hat 3,3V die Stips / LEDs sprechen 5V. Muss ich das noch hochsetzten?
Eher runtersetzen. Z.b 9V oder 12V Eingangsspannung und dann:
- LF33CV fürs DUE
- LM7805 für die Stripes
11  Using Arduino / Motors, Mechanics, and Power / Stepper store position while power off on: February 20, 2013, 08:46:31 am
Hi, I tried to search for an existing topic but could not find anything.

If a stepper motor has to start on a specific angle when starting up Arduino but has been powered off at random angle, is there a way to ensure the start angle is always the same? Like start position? Servos for example are always controled by degrees, but not steppers.
I was thinking about using EEPROM or is there another way? I hope you guys understand what I mean.
12  International / Deutsch / Re: Mit welchem Arduino soll ich anfangen? on: February 18, 2013, 03:45:11 am
Viel Spaß und Warnung: 'Arduino kann süchtig machen! Pflegen Sie weiterhin zwischenmenschliche Kontakte.' smiley
Oh ja, und die Nacht ist auch zum Schlafen da!  smiley-yell

Wenn wir schon bei Conrad Produkten sind. Das Widerstands-Set find ich echt praktisch. Musste ich mir auch bestellen.
13  Topics / Interactive Art / Re: Project - LASERino (Laser Staging Box) on: February 15, 2013, 05:25:14 pm
Here some updates:

Part of cabling soldered on the Nano. D13 Laser TTL, D12 Servo signal, 5V and ground


More stuff in the box. The small yellow board contains an 7805 voltage regulator to have 12V and 5V


Still waiting for the stepper and the dc motor to continue the work.
Additionally I am thinking about driving the DC motor through a PWN and transistor to regurlate the speed.
To calibrate the stepper mirror at startup I am thinking about an attached phototransistor on the side.
14  International / Deutsch / Re: Mit welchem Arduino soll ich anfangen? on: February 13, 2013, 03:48:19 am
StarterKits sind für den Anfang, also ein UNO:
http://arduino.cc/en/Main/ArduinoStarterKit

Wenn man jedoch gleich ein fix verbautes Projekt anfängt, sind Nanos, Minis und Lilypads sicher gut geeignet.
Ich persönlich habe mir 2 Nanos gekauft. Eines mit Pins fürs Breadboard zum testen und eines wird dann direkt verdrahtet.
15  International / Deutsch / Re: analogRead on: February 11, 2013, 06:11:41 am
http://arduino.cc/en/Reference/AnalogRead

Parameters
pin: the number of the analog input pin to read from (0 to 5 on most boards, 0 to 7 on the Mini and Nano, 0 to 15 on the Mega)

Der Parameter ist also eine ganze Zahl (Integer).
Pages: [1] 2