Connect with us

How to communicate between two devices?

Discussion in 'General Electronics Discussion' started by AndreeU17, Aug 2, 2014.

Scroll to continue with content
  1. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    Hey everyone, I'm an Electrical Engineering student working on his Bachelor. I have a personal projects I'd like to work on (a bunch of projects actually)!

    I'm planning to buy a motorcycle this coming month, I'd like to install LED on to the bike as we'll as the helmet for extra visibility from other cars bumping into me! I want the light to be able to communicate with the motorcycle! What I mean is that, while the motorcycle is riding, the lights will remain a constant red, as soon as I press on brake, I want the red light to flash bright much like a typical car brake lights! I want it to all be simultaneously link and run at the same time! I can manage installing the LED in the motorcycle, however, how would I be able to communicate from the LED on the helmet to That of the brake!

    I currently have an Arduino, I'm hoping this microcontroller can help me!!!

    We're talking theory, so if you have any though of opinion, please don't hesitate on sharing it, the worse I can say is, sorry bro that's not exactly what I'm looking for !!!

    Again if you have any questions about what I want to accomplish, please ask! I'll do 10x better on explaining !!!
     
  2. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Whatever your outcome, you must be cautious and think carefully about what and where you attach things to your motorcycle helmet.
    No modifications should be done to the shell or the foam inside. Take care of your gear so it can take care of you.

    I am assuming you want a wireless link?

    https://www.sparkfun.com/products/12031
     
    Last edited: Aug 3, 2014
  3. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    Yes your right, however, I'm not making any modifications to the helmet itself! I will be adding plastic designs on to the helmet as if it is part of the helmet, obviously those extra plastic attachments will be hallow to allows any cables, battery etc to be place! I want the LED on the helmet to communicate with the motorcycle whenever I brake! Is that called a wireless link? I'm not very familiar with it, what else can I use to achieve this?
     
  4. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    I've been riding around with the same idea, but for my jacket instead.
     
  5. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Sorry 'wireless link' was not very technical of me.
    I figured you would not want to plug your helmet into anything...
     
  6. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    How are you with electronics?
    Using a small simple Microcontroller and an rf tranceiver will allow two or more modules to speak to each other. You will need a battery, and possibly a charging circuit though as well perhaps
     
  7. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    I'm in my sophomore year of College, I've taken about two classes regarding Electronics (both 3 months), I'm not a pro but I know what I want isn't really a hard task! I'm willing to research ahead since it benefits me tremendously! The jacket idea is a nice one, maybe add arrows lol but I don't see myself using the same jacket when riding a ninja 650cc !!! I'm planning to use and Arduino that connects to the helmet thru a Bluetooth shielding if possible! Also would like to add some type of battery (lithium if possible) that helps me to charge the helmet LED that run on battery, since the lower LED on the motorcycle will be powered by the battery itself, that is easy, I only see the helmet been troublesome !!!
     
  8. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,270
    Nov 28, 2011
    Just a thought... Any battery that can drive lighting-grade LEDs for a significant time will add some mass to your helmet, which might limit your ability to turn your head quickly. If that was a problem, you might need to move the battery off the helmet, and connect to the helmet with a very flexible wire that runs down your back, inside your clothing perhaps. If so, you could power the whole thing from the bike without using any radio communication.
     
  9. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    Your right as well, i forget that adding a battery could increase the weight of the helmet. However, the helmet temperature? I dont really mind much about the weight since the increase my be very small, but what about the fact that the battery will heat up, would that burn my head? What type of lithium battery should i choose? Specifically and as well one that is light weight and compact!
     
  10. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Yes, adding a battery will add mass, but there are many many bluetooth devices that clip to the helmet with decent enough battery for 8 Hours of talk/music time plus the ability to conference with other headsets in the group you may ride in. Very very doubtful that you will get anywhere near this time with the same kind of size/form factor as these bluetooth modules, but you should easily be able to get a couple hours at least out of it.


    I would urge you to stay away from the Arduino and a shield due to the size of the things :p
    Unless you plan to butcher the parts off of it and repackage it...

    In the interest of keeping the cost and size down. I would suggest using an AVR or PIC with a wireless transceiver. (Or get a generic wireless transmitter/receiver... you can find them on sparkfun for example. )
    Wireless Category : https://www.sparkfun.com/categories/79
    Small Transceiver : https://www.sparkfun.com/products/152
    AVR : https://www.sparkfun.com/categories/21 (These things are the heart of Arduino... they just aren't put on a board an pre-programmed with a boot-loader)

    The transceiver will essentially 'translate' communication from the AVR (or PIC) into wireless for the other transceiver to pick up. Your component count will stay down. Some smart programming and use of LEDs will help keep the current draw down (and thus longer battery life)
    Bluetooth is a decent idea, but you are merely sending an on/off signal, so you can get away with using many many alternatives just so long as it is low power, and simple to interface with.
     
    KrisBlueNZ likes this.
  11. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,270
    Nov 28, 2011
    I don't think that would be a problem. But it would help if we knew more about the LED(s) you plan to use, and how much current you will be running them at - in both normal mode, and while braking, and what run time you need between recharges.
     
  12. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    Well im planning to use the :LED Strips that are already together and come with all the necessary components! The thing is, that i wanted to use an arduino and inserted into the motorcycle that will control the brightness of the LED, however, i was directed by one of the users, to stay away from an arduino due to they're size! Also considering were i can place it were it would be good against different types of weather (California, USA)!
     
  13. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    Thanks i will look into it, so in your opinion i should really do a Bluetooth? However, i do plan to have the LED on as long as the motorcycle lights are on, and when i brake thats when they will "Shine Bright Light a Diamond" lol. I was also wondering, would it be a good idea to have a toggle switch that lets me turn it on and off or at least the helmet light to save battery life?
     
  14. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    I want to make this a bit simple, let's first start of with specific materials we needs or could use then from there we choose the most convenient one !!!

    According to @Gryd3 he mention this is some basic components I'll need:

    Wireless Category :https://www.sparkfun.com/categories/79
    Small Transceiver :https://www.sparkfun.com/products/152
    AVR :https://www.sparkfun.com/categories/21

    Now that's is something I will look into, as of now the only tools I'm considering because of what I already own is the Arduino Uno!

    Any other components that can either benefit or can simply improve this list is helpful !

    Now much of a list but it's best to state some material we which to work on that way we can comment on whether that specific component is worth it
     
  15. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Well.. Let me backtrack momentarily here..
    The suggestion to stay away from Arduino and a bluetooth shield was to help avoid adding too large of an item to a motorcycle helmet.
    You have much more freedom on the actual bike to put whatever you want.

    To assist in keeping the project easy to maintain, build and troubleshoot. I would suggest against using Arduino Bluetooth shields, and instead using an alternative part called a transceiver (for two way communication... or a transmitter / receiver if you only need one way communication)
    By using the same hardware family in the helmet and the bike, it will be easier to learn, build and troubleshoot.
    Your project is very simple from a function point of view.

    Please correct me if I'm wrong / miss something.

    You need a transmitter on the bike that will turn on with the bike, and have one input: 'Brake'
    When Brake is detected, it will send a signal to the helmet to light up nice and bright. When Brake is no longer detected, the helmet will resume normal dimmer operation.
    The helmet will have a receiver that will listen for the 'turn bright!' command, but other than that, it sounds as though the only other things your helmet module need is an on/off switch and a battery.
    In theory... you could build your circuit without an Arduino, AVR, or PIC... the only thing that is absolutely required is that sender/receiver can send the 'light me up!' signal.
    By using an AVR or PIC, you unlock a lot more potential into how you want your lights to behave.
     
  16. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    Omg you cleared it so much better lol, now I understand exactly what I need lol ☺️ Also I'm only looking for a one way communication which is motorcycle to helmet !!! Anyways tomorrow morning (it's midnight right now) I will look at some components and price to make myself a list of what I need !!!

    Once again thank you so much !!!
     
  17. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Not a problem.

    Once you start looking at components, you may want to answer or start to think about answers to how you want the communication to proceed.
    Typically the RF Transmitter / Receiver units will receive a serial message, send it over radio frequency, and replay it back.
    Some of these Transmitter / Receivers will allow you to pick a 'channel' to operate on, but there will always be a chance that something else is operating on the same channel which could cause interference. This is unlikely as you will be mobile and any interference may only be for a moment, but think about how you want your circuit to behave IF communication dies. Also think about how you want to be able to change channels.

    Once you have an idea for that, think about your lighting a little more... I know you want to use the strip lighting, but they typically require a higher voltage than most suitable battery packs will provide... If you want to stick with it anyway (you can still make it work with a 'boost converter') limit the length of your strip light to avoid using more energy than absolutely required. If you want to do your own lighting you can look into surface mount LEDs... I am unsure if this is mainly for night riding or for daytime visibility as well... Building your own LED strip will allow you to tailor it to your needs.

    Now you need to think of options... the wonderful list of options and extras that you can think of.
    If you could buy this from the store as a finished product... think about all the extra features you could possibly think of.
    You can always buy hardware that supports all of these wonderful additions, and you can add them in later, or reprogram your microcontrollers afterwards to add the features.

    Once you have some parts, play around with serial communications between 2 or more AVRs, PICs, or arduinos. (Or hell... mix em up and have an arduino talk to a PIC) Once you can make them talk to each other via a serial connection over wire, it will be trivial to do the same thing using the wireless transmitter and receiver. (Also, consider using a sort of 'watchdog' in your helmet... so that if it does not receive a message from the bike it should turn off it 'shine bright like a diamond' mode)
     
  18. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,270
    Nov 28, 2011
    You only really need a paired radio remote control transmitter and receiver with a single momentary or data input. Any pair that will transmit arbitrary data can be used to send either a logic 0 for one state or a logic 1 for the other state.

    http://www.google.com/search?q=radio+remote+control+transmitter+and+receiver+modules

    Or search for the same string on eBay. You can get a transmitter and receiver pair for under USD 5. I don't know whether they will be very good or not though. Buying from a company like sparkfun or adafruit would be safer.

    Using microcontrollers is not necessary, but has some advantages. Without some kind of error checking, it's possible (but unlikely if you're riding on the street) to get interference. Also you're limited to a single piece of information. But you could expand on that later if necessary by adding a microcontroller at each end. Using a microcontroller in the receiver may also make it easier to provide the low/high brightness for the LEDs.

    You still haven't told us anything about the LED strips. Their power consumption at low and high brightness, and the required time between recharges, will determine what battery you will need.
     
  19. AndreeU17

    AndreeU17

    42
    1
    Apr 23, 2014
    You recommend using a microcontroller on the receiver? If i'm correct, the transmitter will be located on the bike which according to you will transmit data signal of 0 or 1 (binary values), and the receiver inside the helmet will receive the signal which will then determine how the LED strips will act.

    So if thats the case, isn't having a microcontroller in the helmet cumbersome since the size will be bigger. About the LED strips, i'm not 100% sure which i will use, i planning to just buy some decent cheap led strips of ebay, or try making my own strips for educational purposes.

    Once again i'm understanding the who procedure much much better, now all i need to do is wait till my paycheck this coming friday to buy all the equipment and test/troubleshoot before mounting onto a helmet that i have yet to buy :(
     
  20. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Exactly correct. These would be simplified versions of what I had shown you earlier, but would be more than capable of sending the trigger to turn your LED's to full brightness. Using the more complex items would allow you to send additional commands... ie, if you wanted turn signals to cause a reaction in the helmet

    Have you seen the size of the AVR microcontrollers I had shared? The 8-pin AVRs would have more than enough horsepower to handle many simple commands and to manage more than one set of lights. The sizes shared are no bigger than a 555 timer in the same package, which you would most likely require anyway along with a couple other components. Ideally, when your LED's are dim, you will want to be driving them with PWM which will require some sort of logic whether it is built into a microcontroller, or built out of other components.
    Remember though that the same parts can usually be purchased in surface mount packages which can reduce the size considerably. The advantage of a microcontroller is freedom ;) At anytime you can change how the circuit functions by changing the program. You want the LEDs to flash twice before staying constantly lit? no problem! You want the to turn on hard, then fade back to the original brightness? again, no problem! You can even program in multiple modes, and choose which one you want to use when you turn your helmet on ;)
    As far as the LED strips are concerned... this is the consideration that needs to be made: power consumption. If you buy a pre-made light strip, you may be stuck with a strip that wastes power through current limiting resistors which will reduce your battery life considerably. Building your own may not be the easiest... but once you have some ideas on hoe bright and how many, we can work out some numbers to determine what kind of battery is required, or if we will need to modify the light strip to comply with the requirements.
    Have you put any thought into how long you want the helmet to remain powered in between charges? (I would recommend rechargeable Li batteries as they are lighter, and can be built into the case you will use to hold your components... using AAs or other disposable/rechargeables will greatly affect weight and size due to their shape, and the metal casing used.)

    Before you buy any equipment to test/troubleshoot or build with, it would be a great idea to plan out the circuits first so you know what parts you will be using.
    Remember this is the planning stage, so you are more than welcome to plan your helmet circuit with and without a microcontroller to see what parts will be required in the end product.

    This is something I would have no problem working on with you, as like I have said, I have been thinking of the same idea for my jacket. ( I have also thought of using EL Sheet or EL Wire... but they degrade pretty quickly in the sun. My thought process was more for night riding anyway though, so overall brightness was not a concern.)
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-