Jump to content
43oh

Recommended Posts

Since you didn't reference which platform you are using can't give you a definite answer on the ADC input voltage.  Most Launchpads have a 3.3V max input for the ADC so you will have to scale the voltage down so you don't exceed that with your sensor. Please double check the maximum ADC input voltage for the Launchpad you are using.  For the ADC code portion, the examples at the Energia.nu website or, if you are using CCS, the TI website should be good starting points.

Link to post
Share on other sites

Hi @@lilyhack,

 

I don't use the TM4C129 and am not familiar with that sensor, but here are some thoughts....

 

In the link you have posted there is a link to a datasheet.  Of interest:

  • The supply voltage to the sensor, assuming a LaunchPad is powering it, will need to be 5V
  • The offset voltage will be Vcc/2 or 2.5 V
  • Voltage will go up or down by 0.017 V per A depending on whether current is forwards or backwards

I can't remember if the TM4C129 pins are 5V tolerant or not.  It seems like they are, but in any case you don't want the voltage to go above say 3.3 V for measurement.  With only 0.017 V per A, you would have to have pretty high current levels to do that but I would put a voltage divider in.

 

The datasheet gives some Arduino code:

  Current = ((analogRead(1)*(5.00/1024))- 2.5)/ .017;

This code assumes 5V input to the sensor with no voltage divider for the output to Analog pin 1 of the microcontroller.  You will need to modify that as the Arduino only has 10 bit ADC and the TM4C129 has 12 bit.  So, divide by 4095 instead of 1024 and subtract 1.65 if you have a voltage divider that gives 3.3 V with a 5 V input.

 

EDIT:  Didn't see your post when I started writing dubnet

Link to post
Share on other sites

@@Fmilburn   No problem.  Your answer was far more complete than mine.  You induced curiosity so I did a quick check of the TM4C1294 datasheet (http://www.ti.com/lit/ds/symlink/tm4c1292ncpdt.pdf , page 1750/figure 27-1 and page 1793/figure 27-44) which confirms that digital pins are not 5V tolerant and the max analog input is equal to Vdda (Analog supply voltage) which has a stated max of 3.63V (nominal 3.3V).

 

EDIT:  For the sake of clarity it is not to infer that the analog inputs will tolerate 3.63V as the supply on the Launchpad is likely 3.3V.  So the 3.3V figure given by @@Fmilburn is correct.

 

EDIT2:  I always seem to miss the information contained in the title of the post, in this case the MCU model. My apologies to the OP.

Link to post
Share on other sites
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...