RasPiComm – a Raspberry Pi piggyback board
August 2, 2012
Posted by on Update: visit our forum on our freshly relaunched website amescon.com to comment or ask questions about the RasPiComm!
After finding out about the GPIO header of the Raspberry Pi it was inevitable to build some kind of extension board for it. I was working with Arduino, Netduino and FEZ Boards in the past and they all are quite expensive compared to their capabilities and not really stable, especially when it comes to Ethernet communication. The Raspberry Pi seemed to be a perfect alternative for complex applications and easy development. Of course it is an application processor not a microprocessor, so they are not quite comparable but nevertheless a great platform for a very decent price. I want to thank the Raspberry Pi team for bringing out this awsome piece of hardware!
After checking out the available documentation I built the first version of the extension board. Even though it was working as intended I wanted to get rid of some limitations so I built v2 which is slightly different. I will write a seperate blogpost about the technical details, here I just want to share the basic concept and capabilities.
Features
- RS-485 port
- RS-232 (‘serial’) port
- 5 inputs connected to an onboard joystick and screw terminals
- 2 outputs (5V) with LEDs (green and red) also connected to screw terminals
- I2C connection
- Real time clock (RTC) with backup battery
What for? RS-485! And why?
The main reason I built the RasPiComm was the RS485 interface to control stepper motors. You can of course use I/Os in PWM mode and a second I/O for direction to drive this, but since the Raspberry Pi is not a realtime system it does not behave well especially with start/stop ramps. And you would have to write code that does all of that. But I like elegant solutions, and this is certainly not one. There are a lot of stepper motor controllers out there with rs485 support. I’m using the steprocker board (http://www.motioncontrol-community.org), a very powerful open-source solution with state-of-the-art stepper control. This board supports a 256 microstep resolution for ultra-smooth stepping. And it implements the TMCL protocol, which is very easy and fast. The neat thing about RS-485 is that you can control up to 256 devices. The steprocker board is capable of driving up to 3 motors. So if you want you can control 768 stepper motors with one Raspberry Pi. If you really want to.
RS-232
This is always nice to have. It simply connects to your “/dev/ttyAMA0” serial device to the outer world. It outputs the correct RS-232 levels so you can connect it directly to a PC serial port if you want. You can open a console and watch the debian debug output for example.
5 inputs
I added them because the GPIOs are there and I don’t like unconected I/Os. Who knows, someday I (or you?) will need them. The onboard joystick is handy for launching actions and to test your program.
2 outputs
The main reason for adding them were the LEDs. In version 1 these 2 outputs were only connected to two LEDs. In version 2 I added 2 transistors and they switch 5V. I added screw terminals, so if you want you can connect two relays (with a supressor diode).
I2C connection
The I2C connection is also connected to a header. I attached a small I2C OLED display. There are a number of cheap I2C displays on ebay.
Real time clock (RTC)
And last but not least: I attached a real time clock to the I2C bus. The Raspberry Pi does not come with a hardware clock. It forgets the time when it looses power. Its very well understandable that they did not do that, the RTC chips aren’t cheap. But nevertheless a clock is a nice thing to have, especially if you want to trigger actions based on the time of day (home automation for example).
I placed the battery on the backside of the board. Debian supports the chip I used directly, so there was no programming, it simply works with a few calls and your system time is synced with the hardware clock.
Piggyback board design
As I mentioned before, I like elegant solutions. And I also like compact solutions. So my goal was to create a small, elegant extension board without using a flat cable to connect to the Raspberry Pi, my desk already is cluttered enough. It should be a shape which does not change the footprint of the Raspberry Pi and doesn’t cover the processor to maintain heat dissipation. Ths ‘piggyback’ design was born. It doesn’t provide a lot of PCB-space, but there is still plenty of room to realize a couple of features if you go with smaller SMD parts. They are all still hand-placable since I only use tweezers to populate my prototype boards.
In part two I’ll cover the technical details and software.
If you have ideas how to improve the RasPiComm go ahead and post a comment. Want to see other features? Form factors? Colors?
This looks great. How about adding a 5V DC-DC converter, so that you can power the Raspberry Pi from a wider voltage range. You can put 5V’s into the GPIO, instead of the mini-usb. Handy for in-vehicle applications. One of these maybe? http://uk.mouser.com/Search/ProductDetail.aspx?qs=uJpRT2lXVNXJP%252bo08dQqJQ%3D%3D
That’s a great idea! I thought about building a step-down converter for the Raspberry Pi, but integrating this would be nice! I have to check if the 5V lines are directly connected to the usb plug and its safe to source it from the GPIO port. It will definately need a larger PCB to do that, I have some concerns covering the CPU with the board, but I’ll definately keep this on my list! Thanks!
The Raspberry Pi works fine powered via the GPIO. I’m using a DC-DC converter I found on e-bay, and connected it to the +5v & 0v. Picture here http://www.logicethos.com/Blog/2012-06-08%3a_Raspberry_Pi_arrives%2c_RS232_board_works!
I think it goes up to about 32v, which is great for any 12 or 24v vehicle. With vehicles in mind, an OBD/CAN bus interface would be cool too.
Great! Yes, the power range is interesting, also for industrial applications which widly rely on 24V. CAN was on my list, dropped in favour of RS-485 and due to cost/space requirements.
But this seems the next step: A larger “B” Version with onboard power supply and CAN interface. I really like where this is going! 🙂
I have just tried the OKI-78SR on my Pi, and it works great. Should of got the horizontal mounting model, but never mind. Great value for money.
Your RaspiCom board is very interesting. My thought is you will be most successful if you identify and focus one or two niche use cases, stuff other RasPi add-on boards do not offer. RS-485 s a solid choice, needed in some industrial settings. CAN would also be interesting. The better power supply someone suggested is also a Good Idea. To control cost and thus end-user price, consider options where a board could be RS485, but could be stuffed differently and be a CAN board.
Do not attempt to compete directly with a “kitchen sink” solution, such as the brilliant IMO Gertboard. And note well, his kitchen sink does not support RS485 and or CAN. 😉
Great work!
Thank you for your input!
As I stated in my ealier blogpost I think Gertboard and RasPiComm have totally different priorities and are not competing.
I am already designing a RasPiComm Plus, it will have the wide range power supply and CAN-bus.
Thanks for your thumbs up 🙂
I’m interested in the RasPiCom+ card. Book one for me! 🙂
Wouldn’t this be totally useless for vehicles, the 12 or 24v is irrelevant, it’s the 100-200V load dumps that destroy everything. Automotive power supplies require a lot more protection, and considered design.
Dont see why not. Have you looked inside a mobile phone adaptor? Not much too them.
I plan on using the Pi on an industrial product and have had one of the engineers design a 24 vac to 5 vdc converter that mounts on the pi. He is on vacation till Monday but we will send it along then.
Where can I get my hands on one of these? Very exciting stuff!
Soon hopefully! I currently built only one prototype, it worked without modification so it is basically ready to go. I will do another post about the hardware design and a third one about the software. Schematics and sourcecode too. So for DIY people this is ready in about a week.
I also plan to sell these things for a decent price to cover the costs, but I need to manufacture 1000 pcs to get the price down. So the more people want this the sooner I can start the production 🙂
Count me in the “interested parties!” Any idea approximately what “a decent price” will be?
It depends on the final parts, I’ll do some research but right now I would think something around $35. Seems a lot when you look at the price tag of a Raspberry Pi, but I won’t sell 200k of them:-)
Where can you buy such a board? How much does it cost? I’m quite interested if it isn’t to expensive
See my last reply. I cannot give you an exact figure yet – the parts are rather expensive (that’s why there is no RTC on the Raspberry Pi in the first place) but when enough people are interested in it I will get a quote for 1.000 pcs (thats the number we need to get production costs down). That said, we will try to keep the costs for the RasPiComm as low as possible,
If you’re making a list of interested names, count me in please! Even if you can’t keep costs down, please let me know how much I can buy one for 🙂
Daniel, have you considered crowd-sourcing to fund initial production, i.e. get interested partis to put money forward for guaranteed return? If it works for software and 3d-printer variants, why not for this great idea?
I did not yet think about this, but I will have a look at this option. Distribution is an issue, I’m located in Vienna, Austria – so Kickstarter won’t work. Indiegogo is an option, but I will have a talk with RS-Components and/or Farnell, they have worldwide distribution logistics. I will keep you updated on twitter.
Seeedstudio can also help you perhaps? Or sparkfun, Adafruit, lot’s of options.
Interesting board!
Ever thought about doing Kickstarter to raise funds for the 1st run? ANd people donating over “X” amount get a board?
This is a great idea and great place to start to gain some interest. At least if you don’t get the interest it stays as a DIY kit by instruction.
Thanks! Yes, software and hardware instructions will follow for the DIY guys. But when this continues to get attention like in the last hours I’ll be able to start the first batch production soon 🙂
See my answer to Steve. I’ll keep you posted on twitter
Can you count me in please for two, one for each of my Pis
Still counting. 990 to go 😉
Go on to kickstarter and get the funding through it
hi,
could it be possible to read out some data over RS-485 from a Mastervolt XS3200 solar inverter?
I’m not a specialist in writing software !
THX,
Thomas
Hi Thomas,
every device that communicates over RS-485 should be able to talk to the Raspberry Pi and vice versa. Regarding software: I plan to do an open-source library for a lot of devices communicating over RS-485 with the Raspberry Pi. I am pretty sure we will get the driver implementation to the solar inverter done when the RasPiComm is on the market!
Daniel
Daniel,
there is some official software available on Mastervolt.com running under Windows, maybe we can use this on the raspberry? We don’t have to find out hot water a second time 🙂
Is your interface already on the market for Belgium ( yes… a little country in Europe )
THX a lot
Well, if they also posted the source code wie can port it. I am from Austria so I am very well familiar with small countries in Europe 😉 The board is a prototype, I am workingon making it available for all
hi, was this ever followed up as I have an mastervolt XS3200 and need to get the data out wirelessly. Currently, I have to run a cable from the mastervolt to my pc which is ridiculous in this day and age of wireless technology. Don
Yes it was, take a look at http://www.amescon.com, you’ll find all you need there.
Hi,
for the XS3200 :
someone of The netherlands has send me an image for raspbery to collect the data and much more like sending e-mail and upload data to the internet. I had not enough time to check this out, but he is working with this ( wrote by himself )
if you want, i can search for the image and upload it
I am using 2 inverters, and the software needs to be written to read both XS3200’s data
if someone know how to… i would be happy
I also asked Mastervolt to create there software for android, but they will not
and now they have new inverters with Wifi
Thomas
good job, i wish i could make something like this. count me in on wanting one (if the price is right).
Put me down for one poss two, I definatly need a hardware clock for my main project.
Good stuff 🙂 I will definetly want this one 🙂
Great job! Count me in! I’m very excited about this.
Awesom, Count me on for three.
Ill take a couple.
I was considering the adafruit plate kit before I saw this, now please count me in. 🙂
Pingback: RasPiComm – Raspberry Pi Expansion Board | CNXSoft – Embedded Software Development
sounds nice 🙂
Looks like a great addon for Pi. Another interested buyer here!
Awesome idea and implementation! Count me in for one as well 🙂
just tell me where to place order 🙂
WoW… I was just looking for something like that… Can you count me in for one-two pieces … I’m very interested
Pingback: RasPiComm – a Raspberry Pi piggyback board 1/2 #piday #raspberrypi @Raspberry_Pi « adafruit industries blog
Interested here 😉 I have 3 Arduino’s and 4 Raspberry’s, would be great to have the Raspberries join the Arduino’s in real world communication. Thanks for this initiative.
I’d take a couple too. Was planning to do an I2C clock with PCF2127A high stability but it might not have the built in support yours does. I like the RS485, and the option for the small stackable OLED. With that and the joystick you have a minimal UI right there without monitor and keyboard. How hard is it to add some interface to that into the OS? For many embedded systems you want the RasPi to be headless but you also want to be able to see status locally and maybe tweak small things like IP configuration.
It is not hard at all. In fact I will write a blogpost about the software and how to interface the RasPiComm.
… and another one here too. RS-485 is ideal for multi-drop process control and I have a lab application with many small sensors that are all RS-485 terminated. Good guy – you’ve resurrected my project.
Cool, what kind of lab is this and what are the sensors you use? I am very curious when hear the word ‘lab’ 🙂
A small pilot plant in the chemical research area. Real time is important (within a second or two) for data acquisition. I can use this as the “capture unit” polling the sensors ….. temperature, pressure, flow ….. where linearisation processing is done at the sensor and then I just capture the data periodically. By periodically, I mean that I can live with timescales of a minute or more to capture up to 30 sensors. This would run headless and then, over Ethernet, communicate with my office. Local storage would do longer term storage of data. I already have a rudimentary “proof of concept” running.
My aim would be to use one Pi per pilot plant.
Sounds cool! Capturing data within a second is not an issue, I did my tests with a stepper motor controller and checked timings with an oscilloscope – the delays were within a few miliseconds alltogether.
That is why the Pi is so attractive for my use. The application isn’t too demanding, but commercially-available units are priced at an eye-watering €500 each!
The Pi is incredibly low priced. That’s why I try to keep costs down as much as I can for this extension board. But that’s not easy honestly. Today I’ll publish the hardware article, next week I want to publish the software to the RasPiComm, both open-source. I hope that I can build a little community who helps me adding drivers to external hardware (sensors, motor controllers,…). So that the Raspberry Pi becomes the perfect platform for automation and robotics for hobbyists and (semi-)professionals.
Count me in for 2
Sounds good. What I am looking for is an RTC with [unconnected] interrupt output so I can connect the interrupt line to a power relay to switch the Pi on at some scheduled time.
Which chip are you using for RTC? Does it have an interrupt output? Can we have it connected to a solder pad?
I used the DS1307. It has an output but as far as I know you can only use it as a programmable square wave driver with 1Hz, 4kHz, 8kHz and 32kHz.
Your idea is interresting. What would your application look like? I probably would rather use a microcontroller which would be more or less instant on when the interrupt occurs. The Raspberry would have to boot up, so you could not do precise timed actions.
Very clever design, congrats! A few thoughts for your consideration:
SPI is important for many important use cases, including but not limited to talking to radios, and many important sensors use SPI.
you need more board space IMO. I am not sure conforming to RasPi dimensions is required. If someone wants to use a case with this or other add-on boards, they won’t use a stock case.
So give yourself permission to go wider (at a minimum. As to concern about heat issues with teh two warm(er) chips, you can make your PCB longer, but allow for some ventilation various ways, including a cutaway small section.
If your PCB grows either at each end or on each side, then you can have holes that allow stand-offs to physically support the add-on board.
I’m sure I’ll buy at least one of your cards. Keep up the clever work!
.
Thanks for your comment!
I think thats a big advantage that I can use stock cases. What features do you think need a bigger PCB? Of course a wider voltage input range would need a step-down (buck) converter and a larger PCB. Just adding a header for SPI would not need that.
In fact version 1 had an SPI connector. In version 2 the RS-485 uses one SPI line. Version 1 was either RS-232 or RS-485, version 2 can do both, which comes with other advantages I’ll describe in my next blogpost.
…and one for me 🙂
Just to let you know that this is going to attracr a lot of attention. Keywords: photovoltaic diy rs485 to ethernet or internet..
Thanks for the keyword tips!
Daniel,
i found some sourcecode from the same family of inverters on the web, i will sent it to you by mail? it’s written in dutch, but the sourccode explanation is in english.
they made almost the same on ARDUINO board. Something like raspberry, but less performant i guess
Sure, you can send it to daniel.amesberger(at)gmx.at. Replace the (at) accordingly. I hope we will have a discussion forum soon as well as an open source platform (either github or codeplex I think) where we will be hosting the source-code compatible with the RasPiComm.
Henrik, are you also in need to monitor your solar inverter by RS-485?
I plan to do the same. I have two inverters from Mastervolt ( XS3200 )
Please keep me in touch.
Yes, but as I have acess to a linux server and strangely, time pressure from my nerdy wife, I might go with a rs485 to ethernet converter
is it more easy with this converter to ethernet?
if you want to, you can send me by e mail
demeyert (at) telenet dot be
Hi Thomas
I think the raspberry solution will enable direct writing to PVoutput.org and like services. Using RS485 to ethernet devices requires a separate server. I’ll let you know how this progresses
henrik
Update: ordered rs485 to usb device to get going on a pc. Also ordered raspberryPi as this is easier to set up.
What amount is required to reachan acceptable price here?
Henrik
Ok, it`s a thousand units youre looking at. What is the price point you are looking for?
Yes, 1000 pcs and a unit price of $35 would be my goal currently, but no guarantees yet. Still working on it, but it will be somewhere in this area.
Hi, nice work on this, the amount you’ve squeezed into this footprint is impressive. Will you be offering this for sale at any point?
Yes, I definately want to bring this to market later this year. Until then I need as much support as possible, so spread the word!
2 for me please!
Hi. I’m intrerested in one or two boards.
Things I would like to be added is output protection of the GPIO pins so that the RPi isn’t damaged during my childrens experiments. 🙂
Count me in for 2, initially, then an order of 10 to follow. Are you planning on open sourcing the schematics?
Have a look at the RasPiComm hardware blogpost, you’ll find the schematics there! http://wp.me/p2gMgK-1e
Daniel, how about adding RX & TX LEDs for the RS-485? Also, pluggable connectors (i.e. euro style) would be nice. 🙂
Thanks for the suggestion! I’ll keep that in mind for the bigger ‘B’ version – with this little board these connectors would use too much space, the screw terminals are very small ones. With RS-485 transmitting and receiving is done on the same lines, so TX and RX leds must be coupled with the RE line of the MAX3140. Can be done of course, but needs additional logic (two transistors I’d think without checking ;))
Interesting board – and YES, count me in for one.
One thing to add: the pluggable connectors made it in version 3, without footprint change!
Daniel, that’s great news. Count me in for a few of the version 3 boards initially (say 3), and then more after that.
Pingback: RasPiComm บอร์ดต่อขยาย มี RS-485 และ RTC ด้วย | Raspberry Pi Thailand
Daniel, Fantastic needless to say more. Count me in for a version 3 board.
Also very interested ! both rs232 and rs485 come to use. But I wonder, can those be accessed from python ? (using pyserial now to read rs232 via a usb adapter..)
Sander.
Yes you can! The rs232 port is connected to the /dev/ttyAMA0 of the Raspi. So you can use it like any other serial port in Linux. We are currently working on a serial device driver for the rs485 port so you will be able to access the rs485 port via /dev/ttyAMA1. Currently you can already use rs485 with an API, but the rs485 serial port driver will be ready when the board is available.
Great, thanks ! Looking forward to the release !
Pingback: Wooden case | My Raspberry Pi
Can’t wait to see this in http://www.raspberrypi.org/ 🙂 Will you sell it and if yes what will the price be 😕
Yes, we will sell it, but give us a couple of weeks to figure it all out, the board exists since 2 weeks, so I cannot tell you a price yet. We are working very hard to bring this to market soon. We are working on a target-price of $35, depends on the requests. We do not have the user-base of raspberrypi.org so it’s much harder for us to produce quantities that make it cheaper 🙂 The first batch is planned with 1000 pcs. I also hope to see it soon on raspberrypi.org, would help us enormously to go to production soon! 😀
Have you thought of offering a “sign-up list”. You would get a better idea of immediate demand and we would sleep better knowing we were in line to order. :o)
We are currently going through the redesign of our website, after that there will be a community site for the RasPiComm. We will also try to make a sign-up list, just give us a week or two. We are trying to move forward as fast as we can, please stay tuned, I’ll twitter/post all the news!
ditto this… but count me in for one as well since I neglected to mention this in my last post 🙂
You didn’t build this…Obama did. 🙂
I’m interested to; I’m building a proof of concept for a project using a stepper motor; I really like the configuration.
Please inform me when (pre-) sales start.
Just follow @DAmesberger on twitter, that keeps you up to date.
Reblogged this on Gigable – Tech Blog.
Nice job. I may be interested in making this work and interface with some ModBus stuffs. Please let me know when (pre-)sales start
Pingback: Stepper motors and the Raspberry Pi « d0tproduct
Great job with the post. Very happy to hear all this.
-Sharone Tal
Pingback: ส่งข้อมูลรายงานการติดตามดวงอาทิตย์ ด้วย Raspberry Pi | Raspberry Pi Thailand
Daniel
I look forwarding to getting one of your Raspicomm boards from RS sometime. However one application I have is to provide a gateway between RS485 devices and a BACnet system, which requires two RS485 ports. Is this a future possibility for your product?
We are working on a RasPiComm Plus which will be much more flexible, so yes, I think there is a good chance.
We will set up a website where you can post your ideas and requirements, so we have a guideline what users want and need in our future prodcts.
As soon as the website is online I will post the URL in the blog.
Pingback: All Things of World
hello,
to implement a modbus 485 RTU master, can we use your module with an existing library (p.e. libmodbus)?
Andrea
Yes, using existing libraries will be possible since the driver will have tty serial drivers. The RS-485 port of the already available RasPiComm also has this driver by the way (maps the RS-485 to /dev/ttyRPC0).
Hey there! I’ve been reading your weblog for a while now and finally got the courage to go ahead and give you a shout out from Porter Texas! Just wanted to tell you keep up the good work!
Great work!