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 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 } }
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.
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.
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();
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.
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..
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.. 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;