I've got a NodeMCU running with a MCP3208, all channels are working and I can get valid readings (thought i'm struggling with it being linear and stable/noisey). Could someone check the diagram below to see if this is corect based on what I've read in the datasheet?
I've managed to get rid of noisey results by using running average, this makes it pretty smooth how-ever results are definitely not linear. This may be an issue that I'm running into due to amount of bits I have to use within X voltage range.
Nice Drawing that tells a lot. I have a feeling the regulator is running warm. You have no bypass capacitors on it which the data sheet requires. Also no decoupling o the chips, a big No-No. I can understand why all the noise problems. I assume VCC at the bottom of the ripple is at least 7 volts.
gilshultz:
Nice Drawing that tells a lot. I have a feeling the regulator is running warm. You have no bypass capacitors on it which the data sheet requires. Also no decoupling o the chips, a big No-No. I can understand why all the noise problems. I assume VCC at the bottom of the ripple is at least 7 volts.
yeah the LMN7805 was running really hot, I added another one just for the MCP3208 VCC and AREF as a test, i think it is more stable/consistant now.
For the Bypass Caps on the LM units, isnt that C1 and C3 on the diagram?
For the Decoupling Caps on the chip, do you mean for the NodeMCU and MCP3208? If so, is that just the process of adding a Cap between Vin and GND pins on the NodeMCU and on betweem MCP VDD and AGND?
The NodeMCU uses almost all the power, the MCP3208 very little.
Powering a 3.3volt processor that draws about 100mA (with 400mA transmit peaks) with a linear regulator from 12volt is not very wise.
Better use a 5volt cellphone charger, connected to the USB socket of the NodeMCU.
or, if you must use 12volt, then use a 5volt buck converter connected to the 5volt/USB pin of the NodeMCU.
Powering the MCP3208 from 5volt is wrong.
The NodeMCU uses 3.3volt logic, so the MCP must also be powered from 3.3volt.
What are you measuring.
Connecting Aref of the MCP3208 to VCC makes it ratiometric.
Perfect for ratiometric sensors, but 'voltage' measurement will be unstable.
Leo..
Wawa:
The NodeMCU uses almost all the power, the MCP3208 very little.
Powering a 3.3volt processor that draws about 100mA (with 400mA transmit peaks) with a linear regulator from 12volt is not very wise.
Better use a 5volt cellphone charger, connected to the USB socket of the NodeMCU.
or, if you must use 12volt, then use a 5volt buck converter connected to the 5volt/USB pin of the NodeMCU.
Powering the MCP3208 from 5volt is wrong.
The NodeMCU uses 3.3volt logic, so the MCP must also be powered from 3.3volt.
What are you measuring.
Connecting Aref of the MCP3208 to VCC makes it ratiometric.
Perfect for ratiometric sensors, but 'voltage' measurement will be unstable.
Leo..
yeah i wont be using a LM for final setup, just nice and easy at the moment for testing.
I didnt realise that you cannot power the MCP3208 with 5v VCC and AREF if nodeMCU is a 3.3v logic, damn.
For AREF though, how do you provide a better stable voltage and avoid 'ratiometric', just have its own seperate path to a stable 5v source or?
Thanks, I'll have another look at that - I didnt find it easy though!
Regarding the AGND and DGND connections, how should it be done/improved?
I've done a simple diagram. You have not shown where the voltage being measured is coming from.
You need to ensure that parts that draw current (eg the arduino) dont affect the voltages due to track or connector resistance.
The best way to do this is
1: keep analog and digital grounds seperate and only connect at a "star point"
2: decouple with appropriate size (and type) capacitors.
In your case the ADC has seperate connections AGND and DGND
In the top fig all the currents flowing will disturb the voltage read by the ADC
In the bottom fig a capacitor supplies when needed some of the current to the changing load; and grounds are kept seperate to avoid this affecting the ADC reading.
hksmonaro:
For AREF though, how do you provide a better stable voltage and avoid 'ratiometric', just have its own seperate path to a stable 5v source or?
Again, "what are you measuring".
You can connect a reference voltage to the Aref pin of the MCP3208, but it must be <= than VCC of the chip.
You can of course run the chip on 5volt, but then you must level-convert all connections to the NodeMCU.
Could be easier to use voltage dividers on the inputs, but that can't be answered until we know what you're measuring.
Leo..
Edit: Saw in your post history that you were trying to measure a battery stack with an ADS1115.
Much better choice for voltage measurements IMHO.
Just need to learn how to not blow things up
You can connect a reference voltage to the Aref pin of the MCP3208, but it must be <= than VCC of the chip.
You can of course run the chip on 5volt, but then you must level-convert all connections to the NodeMCU.
Could be easier to use voltage dividers on the inputs, but that can't be answered until we know what you're measuring.
Leo..
Edit: Saw in your post history that you were trying to measure a battery stack with an ADS1115.
Much better choice for voltage measurements IMHO.
Just need to learn how to not blow things up
haha yeah, thats the trick,,,, not destroying. I think Im avoiding that now but would like to see if I can get some results with an MCP3208.
So if I use 5v to power the arduino (not USB), then can I use the MCP3208 VDD with 5v or like someone said the NodeMCU is 3.3v logic so therefore MCP3208 maxium VDD and AREF is 3.3v?
I am measure out 7s lithium battery pack, biggest issue with using voltage dividers and 3.3v VDD and AREF is that the amount of resolution I have available is pretty small, so I'm getting really high mV per bit, the best I have got is approx 1.1 to 1.3v measure range using voltage dividers across all 7 battery series.
Not sure if I see the problem.
In theory, with a 7-cell LiPo battery stack and a (genuine) ADS1115 (15-bit single-ended), you can get a resolution of 32768/29.4volt = <= 1mV.
Should be more than enough.
Leo..
Wawa:
Not sure if I see the problem.
In theory, with a 7-cell LiPo battery stack and a (genuine) ADS1115 (15-bit single-ended), you can get a resolution of 32768/29.4volt = <= 1mV.
Should be more than enough.
Leo..
yeah Im talking MCP it is an issue, as its on 12-bits.