Show Posts
Pages: [1] 2 3 ... 7
1  Community / Exhibition / Gallery / Re: Computerized cat toilet on: February 06, 2013, 03:41:44 pm
what gas sensor do you use ?
MQ-4 Gas Sensor
http://www.ebay.com/itm/Methane-Gas-Sensor-MQ4-MQ-4-Module-Free-3pin-cables-/190791699716?pt=LH_DefaultDomain_0&hash=item2c6c124d04
2  Community / Exhibition / Gallery / Re: Computerized cat toilet on: February 06, 2013, 11:09:23 am
Can we subscribe to this twitter channel?
You should! smiley

Can we subscribe to this twitter channel?
If that twitter key is authentic, then you can probably do whatever you like to the channel.
No it is not smiley-wink
3  Community / Exhibition / Gallery / Computerized cat toilet on: February 06, 2013, 08:00:05 am
Here is it... Somebody says it is the 8th wonder of the world, but let's stay realistic.. it is just computerized cat toilet, that`s sends messages to twitter when the cat has done his bad job(we call it MEGATRON). So after you got a message rush to the toilet and clean it, no more bad smell in the room! If you are miles away and you get the message, immediately call your parents, friends and tell what`s happened, they should clear the problem. I have installed on my pc metro twit software, it makes bing sound when a new tweet is posted. 

Hardware:
Arduino UNO
Ethernet shield
MQ-4 Gas Sensor
9DC adapter

















Code:
#define SENSITIVITY 5 // 1 max, 20 min
#define SENSTIME 5000 // 5sec is a good time
const int SensorPin = A3; //Sensor pin.. with my ethernet shield pins A0-A2 are always HIGH(don`t know why), so I took A3.
char msg1[] = "Cat toilet is online!";  // Message after start
char msg2[] = "WARNING WARNING MEGATRON!"; //Warning message
char*msg;

#include <SPI.h>
#include <Ethernet.h>
#include <Twitter.h>            // http://playground.arduino.cc/Code/TwitterLibrary
#include <SignalFilter.h>       // http://jeroendoggen.github.com/Arduino-signal-filtering-library/
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,192,1,4 };                                            //IP
Twitter twitter("1133881105-X3pMth1pGFFs4m133881105-X3pMth1pGFFs4mj5yt6FIZ");  //get a token at http://arduino-tweet.appspot.com/
SignalFilter Filter;
int sensorValue;
int value_1;
int value_2;
int value_read = false;
unsigned long read_value_time;
unsigned long lastsend;
unsigned long debugtime;


void setup()
{
Filter.begin();
Filter.setFilter('b');
Filter.setOrder(1);
Serial.begin(57600);
Serial.println("WARM UP"); 
delay(60000);    // warm up time for sensor
msg = msg1;
sendtotwitter(); // send message to twitter
}

void loop()
{
readValue();
//debug();  //if you want to see sensor value
}


void readValue()
{
sensorValue = Filter.run(analogRead(SensorPin));
if(millis() - read_value_time > SENSTIME)   
{
read_value_time = millis();
if(value_read == false)
{
value_1 = sensorValue;
value_read = true;
}
else
{
value_2 = sensorValue;
value_read = false;
}
}
if(value_1 > value_2)
{
  if(value_1 - value_2 >= SENSITIVITY)
  alarm();
}
else if(value_1 < value_2)
{
  if(value_2 - value_1 >= SENSITIVITY)
  alarm();
}
}


void alarm()  // here you can add alarm activities, in my case it is only sending message to twitter
{
if(millis() > lastsend)  // Please avoid sending more than 1 request per minute not to overload the server! My time is 200sec.
{
msg = msg2; // which one message we will send to twitter
sendtotwitter();   // Send
}
}

void sendtotwitter()
{
  Ethernet.begin(mac, ip);
  Serial.println("connecting ...");
  if (twitter.post(msg)) {
    int status = twitter.wait();
    if (status == 200) {
      Serial.println("OK.");
    } else {
      Serial.print("failed : code ");
      Serial.println(status);
    }
  } else {
    Serial.println("connection failed.");
  } 
  lastsend = millis() + 200000;
}

void debug()
{
 if(millis() - debugtime > 1000)
 {
   debugtime = millis();
   Serial.print("value_1 "); Serial.print(value_1);Serial.print("  value_2 "); Serial.print(value_2);Serial.print("  sensorValue "); Serial.println(sensorValue);
 }
}
   
   
 
4  Community / Exhibition / Gallery / Re: Engine start button with fingerprint and remote webasto control. on: January 26, 2013, 10:27:59 am
Thanks! I am reading signals from door lock actuator, when I press close button, there are 12volts for couple seconds on the first wire and when I press open button, 12volts are on the second wire of door lock actuator(motor). To run webasto you need to give constantly 12v. Actually it is not difficult.
5  Community / Exhibition / Gallery / Engine start button with fingerprint and remote webasto control. on: January 25, 2013, 12:36:20 pm
Engine start button with fingerprint and remote webasto control with original key from factory. Board based on the ATmega328, it controls engine start function, climate control, battery voltage, coolant fluid temperature, and so on. Fingerprint scanner BIOCODE Auto M10.
6  Topics / Robotics / Re: 12VSTEPPER MOTOR CONTROL WITH ANALOG--NEED HELP on: June 27, 2012, 03:26:14 am
Let's say you take 10K potentiometer. When you connect it(potentiometer) to arduino, it will show you the numbers from 0 to 1023.
Middle position of potentiometer should show you something about 510-512.
So(if i am not wrong) the code should look like:
val = analogRead(potentiometer_pin);
if(val >= 510K && val <= 512)
stepper.stop();
else if(val >= 513)
turn.right();
else
turn.left();
7  International / Deutsch / Re: Bastler gesucht gegen Bezahlung on: June 04, 2012, 03:53:58 am
Hi Fishburn,
Ich habe dir PM geschickt.
viele grüsse
8  International / Deutsch / Re: Automatik Schaltung für Fahrrad on: May 28, 2012, 02:06:19 am
Das war ein kompliment..smiley-wink
9  International / Deutsch / Re: Automatik Schaltung für Fahrrad on: May 27, 2012, 03:07:41 pm
Ich glaube das ist eine etwas sehr schwer rechtfertigbare Investition.   smiley-wink smiley-wink smiley-wink
Grüße Uwe

Na ein paar hundert euro für so ein Projekt ist nicht viel.. insbesondere für die reichen Deutschen smiley
10  International / Deutsch / Re: Automatik Schaltung für Fahrrad on: May 27, 2012, 08:15:49 am
Genau das meine Ich... Kettenschaltung tauschen auf Nabenschaltung.
11  International / Deutsch / Re: Automatik Schaltung für Fahrrad on: May 27, 2012, 07:04:08 am
Vorderen Zahnrad nicht schalten:). Normalerweise man fährt immer auf Stufe drei beim vorderen Zahnrad. Und hinten eine neu Nabenschaltung  einbauen. So eine Schaltung ist auch ideal fur servo, weil es lässt sich besser schalten. Und so wird die Kette seitlich nicht verschoben.


12  International / Deutsch / Re: Automatik Schaltung für Fahrrad on: May 27, 2012, 03:18:58 am
Hallo,
1. So ein Servo wird das schaffen: http://www.hobbyking.com/hobbyking/store/__12450__Turnigy_MG958_Composite_Digital_Metal_Gear_Servo_15kg_65g_0_2sec.html
2. Ich würde vorschlagen einen Sensor auf die Kette einzubauen und einen auf den Pedalrad, so wie auf dem Bild, der sollte messen wie tief oder hoch Kette ist. Wenn die Kette zu hoch ist wird die automatik Gang runter schalten, wenn wird die Kette zu tief sein, Gang hoch schalten. Und wenn die Kette in "normal" bereich sein wird - nicht schalten. Es sollte funktionieren.. Der code wird relativ einfach sein, und tunen kann man am ort mit Sprungfeder die den Sensor Straff Halt. Die automatik wird nur dann arbeiten, wenn du den Pedalrad drehst.
Hoffe hast du mein Deutsch verstanden..smiley

13  Community / Exhibition / Gallery / Re: My first robot on: March 08, 2012, 04:47:05 pm
First try that the watcher drives alone:) It was more front sensors test than autonomous driving:)
14  Using Arduino / Programming Questions / Re: Robot won't go straight forward on: February 27, 2012, 01:48:33 pm
Thank you MarkT for your answer! But I really don`t get what you mean..smiley-sad "Make the increments/decrements proportional to the error.... " ?
15  Community / Exhibition / Gallery / Re: My first robot on: February 27, 2012, 11:52:40 am
Hello everybody,
I have a little problem with my robot. The problem is that it doesn't goes straight forward. Sometimes it change direction by it self..smiley I wrote the code that I’m using and I shoot a video how it looks like in reality. Maybe someone has a better solution(code) how to get it working. My encoder wheel has 12 counts for one rotation, so every 30 degrees comes a count.
Thank you very much!



Code:
void forwardesc()
{

if(L_forward_esc_counter == R_forward_esc_counter)   ///If  left and right wheels has the same counts                 
{
  forward();                                                                         //We go forward with both wheels
}

else if(L_forward_esc_counter > R_forward_esc_counter) // If left wheel has more turns then the right
{
analogWrite (MOTORAF,(speedo - trimminus));        //Slow down left wheel
digitalWrite(MOTORAB, LOW);
analogWrite (MOTORBF,(speedo + trimplius));         //More power to right wheel
digitalWrite(MOTORBB, LOW);
}
else                                                                          //else if right wheel has more turns then the left
{
analogWrite (MOTORBF,(speedo – trimminus));       //Slow down right wheel
digitalWrite(MOTORBB, LOW);
analogWrite (MOTORAF,(speedo + trimplius));       //More power to left wheel
digitalWrite(MOTORAB, LOW);
}
}

P.S.
speedo – is speed that I set up from processing. In another words if speed is set to 100%, speedo will be 255.
Trimminus and trimplius is the number how much slower or faster should the wheel spin.
For example if speed set to 50%, the speedo will be 150, and trimplius 40, trimminus 40.

Here is the whole table:
/////SPEED SET TO 0%(MINIMUM)//
trimminus = 0;
trimplius = 30;
speedo = 70;

/////SPEED SET TO 25%//
trimminus = 30;
trimplius = 30;
speedo = 100;

/////SPEED SET TO 50%//
trimminus = 40;
trimplius = 40;
speedo = 150;

/////SPEED SET TO 75%//
trimminus = 50;
trimplius = 50;
speedo = 200;

/////SPEED SET TO 100%//
trimminus = 60;
trimplius = 30;
speedo = 255;
Pages: [1] 2 3 ... 7