HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Feb 16, 2013, 12:21 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,592 Posts
Discussion
Communicating with the on-board microcontroller

There is a question nagging at me for a good answer, and I thought many of us might benefit from the right answer. I found myself asking lots of questions in various threads looking for information. So I would like to discuss this collectively and get a consensys. Many of us are working on projects that implement some form of micro-controller (MC) in our boats. The question pertains to getting signals to (and even from) the on-board MC. Not the obvious method, where the MC might monitor events (like transmitter stick position) coming from the receiver, but communicating directly with the MC in order to trigger an event, run a program, operate some on-board equipment, etc. Two way communications would even be better, so the vessel can send back operating and environmental data. Some of you have made great headway in this area, Skystream, tweety777 and Deckie immediately come to mind, and there probably are others that I am just not yet ware of (speak up!). So the real question is, what is a good, reliable method to accomplish this? I think what is needed is "serial communications". At first I thought about utilizing an existing channel on the radio system, but quickly realized that it's only one way and RC systems are designed to handle PPM/PCM communications. With a little research, some possible answers came to light, which in turn present even more questions:
  1. Use WIFI, but I don't think there is enough range?
  2. Use some form of networked communications, like Xbee or CAN bus?
  3. Use some form of non-networked transceivers (like Josse is doing)?
  4. Can one of the existing FPV systems be used/modified to accomplish this?
  5. Is OpenLRS a viable soultion?

So have you given this any real thought to this, and what do you think is a viable
method to accomplish it? If you have implemented a solution, what was it and what were your experiences?

Xbee information

CAN bus information

OpenLRS here, here and here.

Thanks,
Pete
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Feb 16, 2013 at 12:23 PM. Reason: spelling
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 16, 2013, 12:40 PM
Registered User
tweety777's Avatar
Vlaardingen, The Netherlands
Joined Nov 2008
1,336 Posts
I think all means of communication have they're advantages and disadvantages.
WiFi for example is well supported by pretty much any device that can run software and have any for of communications with the outside world but range is limited.
On the water the limited range shouldn't be all that much of a problem as there is pretty much nothing in the way but there are normal RF systems that have much more range.
The advantage of RF (also the reason why I chose to use it) is because there already are quite a few people who are using it and thus support will be good when experimenting at this level and the transceivers are low cost.
The other systems I do not know well enough to say anything about but I'm sure they'll have there advantages and disadvantages otherwise we wouldn't be able to buy it as it wouldn't have reached production and perfect systems don't exist.

Greetings Josse
tweety777 is offline Find More Posts by tweety777
Reply With Quote
Old Feb 16, 2013, 01:09 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
Hi there,
As you can see in my post, I use NRF24L01 units (Josse's system is based on my system). They come in different forms. Some short range, about 100 metre, some long range, up to 1500 metres. The last one is also depending the transferrate. I use a transfer rate of 115200baud. I have a very small delay in the software to let the 2 units communicate without sending new info and get a bufferoverflow. The delay is about 10 milliseconds. Still faster then the Robbe version (20milliseconds per channel).

These unit work on a open 2,4 gHz. range. You can define a channel on which the unit works. I use the NRF-network library.

For some reading, specs and library:
http://arduino-info.wikispaces.com/N...1-2.4GHz-HowTo

grtz.

Danny

**edit: the only downside is that the i2c function cannot not be used by arduino hooked up to the NRF. A slave unit is needed.
Dutchraptor is online now Find More Posts by Dutchraptor
Last edited by Dutchraptor; Feb 16, 2013 at 01:33 PM.
Reply With Quote
Old Feb 16, 2013, 02:23 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,592 Posts
Hi Danny,

I saw your post right after I posted this thread. It is an execellent source of information for this topic, thanks for putting it up for all to see. I am slowly wading thru it and the code to get a better understanding. You metioned in your response:

Quote:
Originally Posted by Dutchraptor View Post
......... the only downside is that the i2c function cannot not be used by arduino hooked up to the NRF. A slave unit is needed.
Can you elaborate a little on that point. Are you using the I2C in your system? If so, what is the slave device you have chosen.

EDIT: I went thru the receiver code, I see you are using SPI for the bus

Pete
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Feb 16, 2013 at 02:56 PM.
Reply With Quote
Old Feb 16, 2013, 02:45 PM
Guard-Cadet
Cadmunkey's Avatar
Canada, NS, Sydney
Joined Jul 2009
472 Posts
I'm going the Xbee path in my project. Its simple and has decent a decent range of 100m. That's more than enough for a scale boat in my opinion.

Cheers,
Cadmunkey is offline Find More Posts by Cadmunkey
Reply With Quote
Old Feb 16, 2013, 02:57 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
Quote:
Originally Posted by blutoh View Post
Hi Danny,
Can you elaborate a little on that point. Are you using the I2C in your system? If so, what is the slave device you have chosen.
I found that that when using the NRF, the i2c timing went south. Luckily the Mega has 3 extra RX/TX ports extra. I don't use the RX/TX (0) because it gives problems with uploaden when attached to an extra arduino. Slave unit can be my sound arduino's or LCD controllers (nano or uno). But there is also the possibily to use an extra function unit (any arduino). Attach that to the main controller and let them communicatie by serial commands (the system presented is just a basic version). The Slave arduino can use the i2c port and thus use port expanders. The main unit can use portexpanders which are based on a shift register principle. I like multiple units, Kinda multi-core computers. Let the slave unit function as a smart switch, or let it doe sequences (always nice on shows when the boat does things by itself in demo-mode).

Hope this clearifies it a bit.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Feb 16, 2013, 03:21 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,592 Posts
Hi Cadmunkey,

The range is adequate, and if not, Digi has higer powered units for those who need more range. Will you be using it in serial flow mode or packet mode via their API, and which microcontroller are you using?

Danny,
Yes, this helps a lot, thnx.

Pete
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old Feb 16, 2013, 04:40 PM
Guard-Cadet
Cadmunkey's Avatar
Canada, NS, Sydney
Joined Jul 2009
472 Posts
Blutoh,

I am using it in serial flow mode, there's only the pair of microcontrollers so there's no need to control packet flow to various nodes.

I have been playing with PIC16F913's for my tests, but will be switching to a PIC18FXXX for my end unit as that family has multiple serial ports and is a bit newer.

My theory for my system is to remain fairly simple and I am not thinking of mass production at all. Although there are a couple of guys in my local club, back home that are interested in my system.

Cheers,
Cadmunkey is offline Find More Posts by Cadmunkey
Reply With Quote
Old Feb 18, 2013, 09:11 PM
Registered User
steamboatmodel's Avatar
Toronto, Canada
Joined Nov 2004
1,269 Posts
I am glad to see that someone is going to use straight PIC’s as though the arduino's are nice I already have a PIC Kit 2 and some boards and chips and don’t want to have to spend a lot again to buy another system.
Regards,
Gerald.
steamboatmodel is offline Find More Posts by steamboatmodel
Reply With Quote
Old Feb 19, 2013, 05:40 PM
made of fire and pop rocks
bgnome's Avatar
Richmond Virginia
Joined Oct 2009
1,711 Posts
To be fair to the arduino, the thing is just a programer for the ATMega chip that makes it easy to pull the I/O out of it.

There is nothing keeping anyone from plucking the chip out of its socket and putting it into a custom board. You can get more ATmega chips from sources like mouser.com. and they are pretty cheap. There are instructions out there for installing the bootloader onto the chip.

I even have a bunk arduino board i was able to still use by programming it with a good arduino.

Right now im learning my self up on the Pi to get controll of the GPIO socket to do a simple hello world! LED blinky thing

This time of year though, time is always at a premium for me so its all been late night, right before bed stuff.
bgnome is offline Find More Posts by bgnome
Reply With Quote
Old Feb 19, 2013, 06:51 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,592 Posts
Wiring library for the Raspberry Pi

Beer Gnome,

Getting a handle on the GPIO on the Pi can get confusing because of the way Broadcomm numbers the pins. That being said, I found a great library by Gordon Henderson called wiringPi. It makes adressing the pins the same as its done on the Arduino, and infact offers the same commands found in the arduino's wiring library. It also provides simplified handling of SPI, I2C and PWM. I installed it and have been testing it, with good results. It will make communications between the R Pi and an arduino easier to handle as well. Once I have my arduinos in hand I will start testing that as well.

Pete
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old Feb 21, 2013, 11:55 AM
Registered User
Joined Dec 2012
113 Posts
I'm controlling the transmitter directly with an Arduino for my ship transmitter. I've replaced the analog potetiometers with digital pots controlled by the Arduino. Instead of "sticks", I have linear sliders that are ready by the Arduino. I've marked different positions as different engine orders (such as Ahead One-Half). The user doesn't control the transmitter directly... the Arduino does. This would actually allow me to program in some automated navigation sequences if I really wanted to. I could make the ship do figure-8's at a push of a button if I wanted to, for example. Anyway, I have a whole build thread going on over on the Scaled Boats forum, complete with video showing one of the motors being controlled.

http://www.rcgroups.com/forums/showthread.php?t=1800914
Skystream is offline Find More Posts by Skystream
Reply With Quote
Old Feb 21, 2013, 02:07 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,592 Posts
Hi Skystream,

Yep, I am subscribed to your build thread and have been following along with great interest. I've learned a lot from that (thanks!) One of the things we have been discussing is not using PPM / PWM at all, but using serial communications instead. Danny (dutchraptor)m and Josse (Tweety777) have made great headway in that area. They both have a thread going here in this forum about their experiences so far, and it's great reading.

Pete
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old Feb 21, 2013, 02:43 PM
made of fire and pop rocks
bgnome's Avatar
Richmond Virginia
Joined Oct 2009
1,711 Posts
Quote:
Originally Posted by blutoh View Post
Beer Gnome,

Getting a handle on the GPIO on the Pi can get confusing because of the way Broadcomm numbers the pins. That being said, I found a great library by Gordon Henderson called wiringPi. It makes adressing the pins the same as its done on the Arduino, and infact offers the same commands found in the arduino's wiring library. It also provides simplified handling of SPI, I2C and PWM. I installed it and have been testing it, with good results. It will make communications between the R Pi and an arduino easier to handle as well. Once I have my arduinos in hand I will start testing that as well.

Pete
I'll check that out, thanks Pete! the biggest issue I've been having for some reason is I can't get the Rpi.GPIO module to install for Python to use.

So, I'm reinstalling Wheezy and starting over..

I've got pi and arduino talking over USB no problem. Keep in mind that since the pi is doing a bunch of multitasking, talking is not in real time. the pi sends instructions to the arddy when it gets around to it.
bgnome is offline Find More Posts by bgnome
Reply With Quote
Old Feb 21, 2013, 02:51 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,592 Posts
Did you install SM Bus?

sudo apt-get install python-smbus

(SMBus = System Management Bus)
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Feb 21, 2013 at 02:59 PM.
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Kadet Senior with a Jazz HDV146 on board Tipover Aerial Photography 0 Jan 14, 2013 12:06 AM
New Product Pinoccio - A wireless, web-ready microcontroller with WiFi, LiPo battery, & built-in johnorama UAV - Unmanned Aerial Vehicles 0 Jan 08, 2013 01:52 PM
Help! Please Help On ESC interface with Basic Stamp Microcontroller MAX_MN DIY Electronics 17 Jan 20, 2012 03:45 PM
Discussion microcontroller- PC usb communication rocky79 DIY Electronics 21 Feb 19, 2006 10:48 PM