We are a group of university students who are working on a project which involves setting up a weather station. Our problem is this:
Our Irradiance sensor is transmitting data using a CANopen protocol, so we added a CAN bus shield to an Arduino Uno,
But now we are stuck on the software and we are unsure of how to proceed. With the shield up and running do we only need to read the data transmitted over the SPI from the shield to the Arduino, and how would we go about doing that?
If we need to take the CAN protocol into account, how would we do that?
We have found some code examples, but all of them involve automotive applications or communication between two Arduino boards which does not seem to be applicable in our case
If you feel that this description is inadequate for you to be able to assist us, please let us know and we will provide further details to the best of our abilities.
We would appreciate any advice, help or guidance you may be able to provide.
Did you see the link on that Sparkfun page to "Demo Code (SK Pang Site)" ?
There you will find example code, like this: "CAN-BUS ECU Reader demo sketch v4 - For use with Arduino 1.0"
However, you are getting into a difficult situation for just a irradiance sensor, which is in many cases a solar cell or a chip like this:
Can you tell what kind of sensor that is ?
Perhaps there is something inside that can directly communicate with Arduino.
Yes, this is a rather complicated setup for an irrandiance sensor. This is the sensor we have available for the project so we would like to make it work, if possible.
That is a solar cell with a microcontroller inside.
It is easy ot make something like that. Buy a solar cell, or solar led light, or a garden light with a solar cell. It doesn't have to cost more than 2 dollars/euros. Use the solar cell from such a device and connect it to the analog input of an Arduino (use a protection resistor of 1k before going into the analog input). That is all there is to it.
If you set the analogReference to INTERNAL, you will have a good resolution.
According to the documents, the CAN interface is not very hard. You can start by trying to read the default values for the sensor type.
I used a CANbus "sniffer" at AMAT. The format is LITTLE ENDIAN. (LSB transmitted first, MSB last, as opposed to BIG ENDIAN, which is MSB first)
According to the documents, the CAN interface is not very hard.
I don't know about that. The only reason I was hired at AMAT was that they needed someone to troubleshoot CANbus Motor issues and nobody at AMAT wanted anything to do with it. It was DeviceNet. (CANbus based protocol).
But now we are stuck on the software and we are unsure of how to proceed.
Your post is a little hard to follow . Can you give a succinct SITREP (Mil-Speak for SITUATION REPORT)
(ie:
"We can't read anything"
or
"We have no code"
or
"We have example code (link) but can't get it to do this..."
Can you please include your project requirements (specifications, criteria, etc...)
Since you have provided us no code, how are we supposed to advise you ?
You must have something, (example code)
Give us something to start with ...