Node-RED and MCP3008 A/D Converter in differential mode

I’ve managed to display voltages (using Node-RED) as sampled from a MCP3008 A/D converter.
I would like the MCP3008 A/D converter to now instead read the voltage in ‘differential’ mode, but I’ve been unable to work out how to configure this using Node-RED i.e. by default Node-RED configures the A/D to read in singular mode (not differential mode).

Hi Robert

Awesome work getting voltages in Node-Red. Can you post a wiring diagram as well as any relevant component details for example if you are using and Rpi or some other micro board?

sorry, yes i’m using a Raspberry pi. It’s all working, quite simple, don’t have a wiring diagram sorry but it’s very basic.
My problem is that I want to use the MCP3008 A/D Converter in ‘differential’ mode, not just ‘single’ mode as I’m doing now.
So I’m wondering does anyone know how to use Node-RED to configure the MCP3008 to use DIFFERENTIAL mode?

1 Like

Hey Robert

I have not had a chance to try my ideas in Node red but I thought I would give you what I have so far. I have been reading the datasheet, page 19 has a list of configuration bits.
The Node Red module for the MCP3008 says the channel is chosen by sending a msg.payload from 0-7. This would be sent to the chip as a binary number 1XXX for it to work in single-ended mode. In order to get the chip into differential mode, we need to find where we change that 1 bit to a 0.

1 Like

Yes, but i don’t really know anything about Node Red, I’m just following up on a project someone at work started.
I’m hoping someone out there has has already done this i.e. interface a MCP3008 in differential mode to a Raspberry Pie running Node Red.