High Precision AD/DA Board (Waveshare)

892 views
Skip to first unread message

Martin Probst

unread,
Jan 26, 2017, 11:43:20 AM1/26/17
to Node-RED
Hi all,
I recently got a AD/DA Board from Waveshare (http://www.waveshare.com/wiki/High-Precision_AD/DA_Board) that I would like to use within Node-RED. I am fairly new to this but managed to quickly setup a relay board over i2c bus. However, the aforementioned AD/DA board seems to be a lot trickier and I have to clue where to start. It operates through SPI and BCM2835. C++ libraries for testing purposes work just fine.
Does anybody have an idea how I could integrate this board into Node-RED. Just a starting point and some directions would be really appreciated.
Many thanks,
Martin.

Mark Setrem

unread,
Jan 26, 2017, 12:57:55 PM1/26/17
to Node-RED
A good place to start would be by googling "BCM2835 node-red"  there are several tutorials that should get you through installing the BCM2835 libraries and 
demonstrate how to access data in node-red.  

If you get stuck, pop back here and I'm sure someone will be able to help, we're a friendly bunch 

Martin Probst

unread,
Jan 26, 2017, 4:31:38 PM1/26/17
to Node-RED
Thanks, Mark, I already ended up doing this for the last few days in a row... I got the bcm2835 libraries installed (they are also used by the C++ test programs) but most tutorials focus on DHT11 or DHT22 sensors which work differently. I would somehow need to implement SPI communication with the ADC and DAC on the board through bcm2835 and this is where I struggle. After having gone through lots of documentation it seems to me that SPI is not that well supported but I couldn't find a i2c ADC/DAC board.

Today I was looking into the Johnny-five library but didn't get all too far... :(

Bart Butenaers

unread,
Jan 26, 2017, 4:33:29 PM1/26/17
to Node-RED
Hi Martin,

I'm also a new member in the Node-red club, but as I understood there are a couple of ways to communicate with the pins:
  • The RPI.GPIO nodes (that ship standard with Node-Red) make use of a Python libary, which doesn't support I2C or SPI yet.
  • The Johnny-five nodes have a plug-in for Raspberry that makes use of the WiringPi library.  I suppose these nodes will (beside I2C) also support SPI, because wiringPI does support it.  And also the NodeJs wrapper of wiringPi does support SPI.
  • I think that node-red-contrib-dht-sensor is the only Node-red node that uses the BCM2835 library.  And that only supports the DHT11/DHT22 temperature sensors over SPI.  But there are NodeJs wrappers available for that library.
From this I assume that wiringPi offers the most support for SPI and all kind of other pin-related stuff.  If the Johnny-five nodes are not sufficient, you can always use a function node to call the wiringPi functionality yourself.  

But it is only theoretical knowledge.  If you get it working, please share your solution!

Kind regards,
Bart

Martin Probst

unread,
Jan 30, 2017, 1:20:28 AM1/30/17
to Node-RED
Hi Bart,
thanks a lot for the overview of ways of communication! I had some trouble with the Node-Red Johnny-five plugin: Node-Red would always crash after having injected some sample code from https://github.com/nebrius/raspi-io. I am now working my way through using node.js since it offers better debugging functionalities. However, if I look at the sample C++ code used to test AD and DA functionalities, I doubt that my skills allow me to transfer this to node. We will see...
If I got something, I will keep you posted.
Regards,
Martin.

kik...@googlemail.com

unread,
Mar 30, 2017, 6:28:12 AM3/30/17
to Node-RED
Hi,

I don't know if this still is of interest. I'm also using this AD/DA board with node-red. At the moment I'm only interested in the ad capabilities of the board. I wrote some js code based on the c code from waveshare and this python code https://github.com/jrosenstein/PyADS1256/blob/master/pyads1256.py which is imho quite informative and very well documented. I do not have yet a working node-red node but this should be the case within the next week I hope. If everything works out as planned the code will be on npm/ flows.nodered soon. For now I managed to config the ads1256 and read from it on the with node on the command-line. I can confirm that it works well with wiringPi and also the rpio library. I ended up with rpio because I found it somewhat better documented and nicer to use (but you could easily swap one against the other without much effort).

Piekacz Geoffrey

unread,
Jul 4, 2017, 8:30:03 AM7/4/17
to Node-RED, kik...@googlemail.com
Hello, do you still work with this board? I'm also trying to setup this with node-red & i'm very curious how you managed it to work.

Regards,

Geoffrey

Levent Bal

unread,
Jul 4, 2017, 4:32:01 PM7/4/17
to Node-RED, kik...@googlemail.com
Hello Geofrfrey,

I think everybody can use their board. I have 5 board but I can not use too. Is there any demo, manage analog channels.

giulio....@gmail.com

unread,
Jul 23, 2017, 12:52:08 PM7/23/17
to Node-RED, kik...@googlemail.com
Hello,

did you finally succeded in defining the node for the waveshare board? I have just started working with the AD part of it but I could not find your solution on npm.

Best regards,
Giulio

Martin Probst

unread,
Jul 23, 2017, 3:11:23 PM7/23/17
to Node-RED, kik...@googlemail.com

HI all,

 

I managed to get it to work using some cool C++ libraries and the help of this website https://nodeaddons.com/building-an-asynchronous-c-addon-for-node-js-using-nan/

However, it’s a while ago I touched the code and it is far from being finished. It works in the console only and you need to wrap it for node-red.

You can find the code here: https://github.com/probstmartin/npm-demo-pkg

 

Good luck,

Martin.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages