motor wireless transmittion

hey all, i ve been given a project..where u have a motor which is connected to a pulley...so when the motor rotates the pulley rotates with it..doing whatver work it needs to do...the motor is set to 100revolutions per minute...however whenever there is load shedding or whenever electricity is shut down in the plant..the circuit stops and the motor has to start all over again...2nd problem is dat it needs to be manually checked every three hours..of how much rotatoin has taken place...

so i ve been given two tasks...the first one..is there any way through wireless transmittion i can tranmit how much revolutions is taking place in serial monitor in the office..i was thinking of using RF modules for wireless transmittion..would appreciate if anyone gives a start of how to go about it??

secondly whenever load shedding occurs..or electricity shuts down..maybe it can blink an led at the office...or send data stating that load shedding has occurs..or smeting along dat line....

thank you....

RF is good if you have little interference and a fair distance, but how far is it going to be away from the computer? You may need to use an Ethernet or Wifi connection.

HazardsMind: RF is good if you have little interference and a fair distance, but how far is it going to be away from the computer? You may need to use an Ethernet or Wifi connection.

yeah i dont think distance would be a problem...it would fit in the RF range.but how do i initiate the design of circuit...mind u the motor is a 220V motor..how do i utilize the arduino...in da circuit..

Do you have any schematics of da circuit?

nope....one of the employees just showed me the actual pulley....and told the problem..its not even a compnays project...its his own personal issue..so dats y he asked me for help..since i have little bit knowledge on electronics...

Could you post a picture of it, circuit and all? It might not even be possible with an Arduino, but we won't know for sure until we see it.

yeah sure il send u the pics soon..actually another thing i forgot to mention..is dat that there is a proximity sensor as well which is attached to the control unit...dat control unit u can set when to start motor..how much revolutions to set etc etc..so maybe we need to deal with the control unit..like connect the output from control unit to arduino obv not directly...or smething along this line...and den connect the uno with RF modules...i need to recheck but i think the control unit..is around 20 volts...

these are the pics…more pic comin up…

the first two pics..i posted in the previous messege..was the main circuit...the last one i posted is a control unit..which is linked to a proxmity sensor....

Ok, you just want to measure the RPM, and if any shredding has occurred. Well you will need a rotary encoder, and an attachable wheel, roughly the same size as the one on the motor (for easier calculations).

Circumference = pi*diameter = pi * 1inch = 3.1415927inch = 1 revolution (60 in/min)(1 revolution/3.1415927inch) = 19.1 rpm

There should be an encoder library that already calculates RPM, based on the given diameter. Im not sure what the library is, but the arduino playground may have what you need.

infact i dont even need to know rpm..to keep thins simple..whenever electricty is shut down in plant..i just need a notice in da office room..dat electricity has shut down...via either by blinking led...or through wireless messege stating electricity shut down or wtver..somewhere along dat line..just a alert basically

Then why not use a relay to do that? The relay could be wired from the common pin to the normally closed pin, and when you energize the relay, it will open the circuit thus no Buzzer, but if you kill the power, then circuit closes and a buzzer or light will turn on.

Its actually extremely simple and does not require a arduino, unless of course you still want it to be wireless, in which case it is still simple.

the reason y i was mentioning wireless is because the the office is about say almost half a kilometre from the machine..so we cant possibly connect a wire all da way from the circuit to our main office....so this is y i was talking about wireless transmittion..

even simpler dis is wat i plan to do...the potential difference btween the control unit came out to be 24V dc...so ill just use voltage regulators to reduce it to 5v and then connect that to arduino uno..and link dat with RF modules..that should hopefully work...

Well it seems like you know what your doing, so what ever method you plan on going with, let me know and I'll help you with the code side.

ok sure..thanks a lot buddy....really appreciate your time and help....wil get to it as soon as possible...and yes will need your assitance in coding because no one in the company knows coding i think...its more of mechanical company...anywyz get to u as soon as possible..

ok i ve started with the coding iam posting it right below…most of it is done…iam stuck in one part…first can u let me know whether the logic of the code is right…ive uploaded it and it is not working…but the reason its not working…this is wat i feel is because of sme other reason…which ill post later…but first i wanna know whether the logic of the code especially on the reciever side is right or not…the concept is that it will pulley machine will be on…it will transmit the letter h…to the reciever and LED WIL NOT BLINK…the moment electricity is shut down in the plant…the machine stops working and the LED WILL BLINK…anyways here is the code
#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round
////////////////////////////////////////////

void setup()
{
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for RF Link module
vw_setup(2400); // Bits per sec
vw_set_tx_pin(1);
int led = 13; // pin 1 is the TX pin on our Arduino Duemilanove
}

void loop()
{
const char *msg = “h”; // this is your message to send

vw_send((uint8_t *)msg, strlen(msg)); // send the data out to the world
vw_wait_tx(); // Wait for sending of message to finish.
delay(200);
}

Reciever side
#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round
int led =13;
////////////////////////////////////////////
void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);
// wake up the wireless receiver
vw_set_ptt_inverted(true); // need this line
vw_setup(2400); // sets speed of data reception.
vw_set_rx_pin(8); // this is the RX pin number - 0 on a Duemilanove
vw_rx_start(); // start the receiver!
}

void loop()
{char c;
uint8_t buf[VW_MAX_MESSAGE_LEN]; // this is an array of unsigned integers 8-bits long. In other words, bytes between 0 and 65535
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // check to see if there is received data in the buffer
{
for (int i = 0; i < buflen; i++)
{
char c= buf*;*

  • Serial.print(c);// display the received data from the buffer*
  • }*
  • Serial.println("");*
  • }*
  • else*
  • digitalWrite(led,HIGH);*
    }

Not sure if you wrote this yourself or just copied it from somewhere, its a good effort, but try this and see if it works.

Transmitter:

#include <VirtualWire.h>

void setup()
{
    Serial.begin(9600);	  // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_setup(2000);	 // Bits per sec
    vw_set_tx_pin(3); 
}

void loop()
{
  char *msg;
  msg = "H";
  vw_send((uint8_t *)msg, strlen(msg));
}

Receiver:

#include <VirtualWire.h>
long timer = 0;
const byte LED = 13;
const long Delay_time = 500;

void setup()
{
  Serial.begin(9600);	// Debugging only
  Serial.println("setup");
  vw_setup(2000);	 // Bits per sec
  vw_set_rx_pin(2);     // receiver pin
  vw_rx_start();       // Start the receiver PLL running

  pinMode(LED,OUTPUT); // On-board LED
}

void loop()
{ 
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;

  if (vw_get_message(buf, &buflen)) // Non-blocking
  {
    for(int i =0; i < buflen; i++)
    {
      Serial.print(buf[0]);
      if(buf[i] != 'h' || buf[i] != 'H')
      {
        if(millis() - timer > Delay_time)
        {
          timer = millis();
          digitalWrite(LED, !digitalRead(LED));
        }
      }
    } 
  }
}

no mate…I didnt make the code…thats one of the best things of arduino…u pretty much get all the codes online…anyawyz…i tried your code…and the result…was that when its transmiting…led will keep blinking…whearas the the moment cut the connection from transmitter the led light stays on…(stationary)…is that what u were intending to do??? and a couple of doubts regarding the code…u gave an if statement stating if(buf != ‘h’ || buf != ‘H’) which basically u were tryin to state that…when the data is NOT h OR not H…then it would do remaining actions…BUT the data we are transmitting IS H…so hence it would never enter the if statement right??
Just for experimentation i mucked around with your code…and i removed the if statement…then tried it …it still gave the same result…then i furthur removed the
if(millis() - timer > Delay_time)
* {*
* timer = millis(); *
statemnets as well…and i still got the same result…it was blinking during transmittion and led light was solid but stationary when u remove transmittoin wire from transmitter…so iam kinda confused.what u were trying to do…if you can clear that part…that would be nice…
and i actually wnted the make the LED not lit…when transmittiing and make it Light up…when transmittion is cut,…

After doing much testing, and trying all different possible ways to get it to indicate that the transmitter is off, it cant be done. Once you power off the transmitter, "vw_get_message(buf,&buflen)" never changes. I tried to take that into consideration, using the pulseIn function and latches, but all failed to work. In order for your project to work properly, the transmitter my have constant power.

So killing the transmitter power is not a good way to go. your best bet would be to take a reading using either a digital or analog pin, and if there is a voltage, send "H", if not send "L".