Wireless serial project and me, the beginner

Discussion in 'The Projects Forum' started by magnadyne, Jun 27, 2011.

  1. magnadyne

    Thread Starter Member

    Mar 4, 2008
    16
    0
    This forum has already been a big help, and now I am hoping to really get in over my head.

    I have been working on tracking machine down time on a few machines at work, and as I mentioned this forum has helped out greatly with that. However, it was a very simple task. No circuit board or electronics required because each machine had its own PC. I simply wrote a program to communicate with the serial port.

    Well, this went over so well that my company is asking to do this to more machines. The problem now is I no longer have the luxury of every machine having a PC. Therefore my idea is to make a circuit with a micro controller send data to a central PC wirelessly (aka a 'black box') when it is triggered by the machine. The data would be hard coded into the chip, and the signal can be just about anything. I am thinking at this point simply pressing a button will work.
    I would imagine that giving this box its own power supply may be the easiest so I do not have to worry tapping in to each unique machine.

    This central PC would monitor many machines near by and write a record to a database when it received a signal from one of the 'black boxes'.
    The monitoring part on the central PC will be a program I can write, but I am clueless on the electronics side of things. Although I am (and have been for some time) very interested in getting into programming PICs and other electronic wonder. So I am hoping to use this not only to improve the company, but as a great learning experience.

    So, the questions:

    Is what I am wanting to do even possible? (with in reason) I have seen modules out there to make sending / receiving data wirelessly easy, so I don't think this would be too difficult, but what do I know? :)

    Based on searches here it seems the PIC3 Starter kit would be a great place to get going, but I understand these things are all based on the PIC family you want to program. Based on my description of what I want to do, what would be a good chip to use, and will the PIC3 work?

    What all am I going to need in my circuit, and can someone help design one?
    Based on my current research I will need the PIC, and a RF module, correct? Maybe a MAX232 as well? Even after I get all of the pieces I am still not sure how to put them all together.

    Lastly, now that I am finally starting PIC programming, is everyone prepared to get posts with stupid questions like this? :)

    Many thanks in advance.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    How far away are the machines?
    Are they all in one room.
    Are they all visible from the central PC? If so you may consider IR (infra-red).
    Is this an industrial application where there is a lot of EMI (electromagnetic interference)?
    Or is this in an office setting?
     
  3. wayneh

    Expert

    Sep 9, 2010
    12,153
    3,059
    You might want to look at home automation technology, where various devices in the home can communicate to (and be controlled by) a central PC. I believe the communication is accomplished by putting the network traffic onto the power lines, and that may not be appropriate in your environment. But surely some useful ideas there.

    There are also ways to put "anything" onto to the internet with an IP address. A wireless game adapter (<$50) will put an ethernet-connected device onto a wireless network. You might be able to get your machine, when on, to appear as a connected device on your network. When off, it disappears. So you could poll the network, say every second, to determine which machines are on at any time. Just thinking out loud.
     
  4. magnadyne

    Thread Starter Member

    Mar 4, 2008
    16
    0
    If I can get this to work I picture having multiple 'central PCs' and groups of machines signalling a single specific pc. (or I can program the pc to look for specific machines)
    However, all machines in a group will be no more than 100ft away from its central pc. Most often much less than this.

    It is a very industrial application, it is dirty and noisy (both audibly and electronically).
    IR may work, but I do not know enough about IR to guess how well this will work in my environment. My concern is while everything is housed in a warehouse-like building there is still random duct work, conduit, and piping dropping from the ceiling. I am guessing the best way to do an IR setup would be to mount a receiver high up and point the transmitters on the machines to it?

    I figured RF would eliminate the need, or should I say worry, of having the receiver & transmitter visible to each other.

    I also want to send specific data to the PC to help the PC filter through what is a legit signal, and what is noise. I found signal noise to be an issue with my last go around, and after a lot of testing I found I could always get data through just fine though.

    Feel free to comment or correct my thoughts here. These are the ideas I came up with based on the very limited knowledge of this stuff. I may be on the right track or completely off my rocker.

    Thanks!
     
  5. magnadyne

    Thread Starter Member

    Mar 4, 2008
    16
    0

    I have seen these, and they are very cool. However, I don't know if this will give me what I am looking for. All of our machines are running on 3 phase 480 and normal 110 outlets are hard to come by out on the shop.
    However, I will try to keep these in mind in the future as they are hardly the first thing you think of for a solution, but do have some unique capabilities!
     
  6. russpatterson

    Member

    Feb 1, 2010
    351
    16
    check out the Xbee or nordic radio breakout boards at SparkFun.com.

    I'm not sure what the PIC3 starter kit is exactly. Do you have a link to one that you're looking at?
     
  7. magnadyne

    Thread Starter Member

    Mar 4, 2008
    16
    0
  8. russpatterson

    Member

    Feb 1, 2010
    351
    16
    Yep, that's a good kit to get started with the PICs. Run the sample programs on that starter board.
     
  9. magnadyne

    Thread Starter Member

    Mar 4, 2008
    16
    0
    I ran across this in my endless quest. This looks like the start of what I am looking to do.

    http://www.mcuexamples.com/PIC-Serial-Communication.php

    The major differences being after the max232 I assume I add a RF or IR module.
    The second being I will have to program my pic to send the specific data I want.
    I will also have to change the 'trigger' for the pic to send data. This example just sends what ever it receives, but I think I could change this to send my data when a switch it thrown.

    Any thoughts on if I am on the right track here?

    Thanks for all of your input so far!
     
  10. russpatterson

    Member

    Feb 1, 2010
    351
    16
    I think that if you look at Sparkfun.com and get one of those radio breakout boards you can just communicate directly to them. I think the Nordic is SPI, which IMO is easier than serial but either one just requires some time and debugging. Do you have a scope or a logic analyzer to use? In the past I've just got a USB dongle that had a Nordic radio then the PIC just sent data that came into the PC via the dongle. You could have your PIC send data on a timer, when a switch got hit, whatever.

    None of this is too hard but it will take some time as there's a lot of walk before you can run stuff before you get the system doing what you describe. The Microchip and Sparkfun forums have more PIC and microcontroller people than here.
     
  11. magnadyne

    Thread Starter Member

    Mar 4, 2008
    16
    0
    Great info, thanks Russ! I will have to study these components a bit more, and make sure I completely understand their function.

    Unfortunately I do not have a scope or analyzer. I think this projects calls for one though. I have seen software solutions for this where you just turn your pc into a scope & analyzer. Would something like this work?
     
  12. russpatterson

    Member

    Feb 1, 2010
    351
    16
    Yes, you can use your computer, sound card, and programs like winscope. Just be careful not to put in a high voltage and fry your sound card mic input. A logic analyzer is just a bunch of low quality scope inputs so you can see digital communication on several pins and record it for later debugging. You can do it w/out any of these but you're guessing instead of debugging. You can get a cheap, plug into your PC, scope and logic analyzer for about $250 at Sparkfun.com.

    Start with that PIC dev system and get some LED's blinking.
     
  13. wayneh

    Expert

    Sep 9, 2010
    12,153
    3,059
    +1
    This is harder than you might think, because your PC and whatever you're testing may not share the same ground. Merely connecting their grounds together could overload your sound input card. Also, I've used even 10 MΩ resistors on the inputs and still got strong signals at not-so-high test voltages. Of course that didn't put my card at risk, but my point is to start with high ohms resistors on the inputs and only move down when you know how things are going. Use a ~200Ω resistor if you need to connect the grounds, and check whether it's warm or if you can see a voltage across it.
     
  14. russpatterson

    Member

    Feb 1, 2010
    351
    16
    If you can possibly afford it, buy a scope and/or analyzer. You can't get too far with this electronics stuff w/out the right tools. You can do most everything with a two channel scope but having 8 channels for logic stuff can be really handy and save a lot of time.
     
  15. magnadyne

    Thread Starter Member

    Mar 4, 2008
    16
    0
    Something like such?
    http://www.amazon.com/100MS-Based-Digital-Storage-Oscilloscope/dp/B002Z34QUA/ref=sr_1_1?ie=UTF8&qid=1309370608&sr=8-1

    I am not really sure what to look for in a scope, so I am interested in your opinion.


    Also, I have been looking at the micro controllers, Nordic breakout boards, etc over at sparkfun. Can I program something like a ATmega328 using the same beginner kit I mentioned in earlier posts? Is it correct in saying that all of these micro controllers all run on the same hex files?
    Probably a stupid question.

    Thanks for all of the help!
     
    Last edited: Jun 29, 2011
  16. russpatterson

    Member

    Feb 1, 2010
    351
    16
    You need a different programmer for the Atmel MCU's (ATMega, etc.) than the Microchip MCU's (PIC's). It's kind of like Fords vs. Chevy's. I've used both, they both have their good and bad points but I like the PIC's because I've always been able to make their dev systems work and they are the leader with low power stuff and I'm into solar power, energy efficiency etc. The Arduino's are based on Atmel chips.

    That scope looks ok. I would search for reviews on it. Also if you have at least two input channels (that one looks to have only one) then it's easier to debug digital communications. Look at the one they sell at Sparkfun for $250, it has one analog scope input and a bunch of digital analyzer inputs. I've used it and it works ok.
     
Loading...