unable to get a reading from from 10 bit mcp3008 adc

286 views
Skip to first unread message

Son Huynh

unread,
Apr 4, 2017, 12:31:21 PM4/4/17
to Node-RED
I was wondering if anyone ever used this node from the node-red flow library:


for some reason I'm unable to get a reading following this guide hooking it up to a potentiometer or a ACS712 current sensor:


I was wondering if it has some kind of conflict with raspi-io, wiring pi, or johnnyfive. I was able to get a reading of 512 (base) before but after the installation of those nodes, the mcp3008 node stopped working. I have it hooked up to 5v on sensor and the adc with channel 0 and CE0.


Mark Setrem

unread,
Apr 4, 2017, 4:48:36 PM4/4/17
to Node-RED
You might want to check if the mcp3008 is compatible with 5v.

Dave C-J

unread,
Apr 4, 2017, 5:35:12 PM4/4/17
to node...@googlegroups.com
It can be tolerant to 5V - BUT it should only be used up to VDD +0.6 V - so less than 3.9V on a Pi... - ideally inputs should be less than 3.3V in line with the power supply of the Pi and its input pins.

Also it uses the SPI input pins - so yes may be a conflict with those nodes if they also try to read SPI in some way.

Son Huynh

unread,
Apr 4, 2017, 6:35:00 PM4/4/17
to Node-RED
I've changed my voltage to 3.3V but still getting zero reading. Is there a way for me to tell if there are conflicts?

Son Huynh

unread,
Apr 4, 2017, 9:14:02 PM4/4/17
to Node-RED
I think I found my answers:


"Here's a guess: During the initialization phase of a Johnny-Five/Raspi-IO application all available GPIOs on the Raspberey Pi are automatically configured as GPIO outputs, irrespective of whether the Johnny-Five/Raspi-IO application actually use those GPIOs or not. On the other hand, node-red-node-pi-mcp3008 requires that the SPI specific GPIOs be configured as SPI GPIOs, not as GPIOs outputs. They were actually configured as SPI GPIOs at boot time but the fact that Johnny-Five/Raspi-IO reconfigures everything to be a GPIO output then breaks node-red-node-pi-mcp3008."

Here's the link to the thread:



On Tuesday, April 4, 2017 at 4:35:12 PM UTC-5, Dave C-J wrote:

Son Huynh

unread,
Apr 4, 2017, 9:57:04 PM4/4/17
to Node-RED
do you guys have any suggestions on how I can get readings from the mcp3008?

Dave C-J

unread,
Apr 5, 2017, 1:22:45 AM4/5/17
to node...@googlegroups.com
Given what you day in your first post, I would make sure Johnny five and raspi-io, and node-red-contrib-gpio are not installed, then try.

Son Huynh

unread,
Apr 5, 2017, 9:14:50 AM4/5/17
to Node-RED
I need them to run another sensor :/ is there a work around it? like a way to reconfigure?

Dave C-J

unread,
Apr 5, 2017, 1:32:52 PM4/5/17
to node...@googlegroups.com
Well I would get it working first... 
Though again, your first post would seem to indicate it's not possible using that sensor (well not one that isn't supported by raspi-io directly)

sent from phone
Reply all
Reply to author
Forward
0 new messages