# ADC and a solar controller

**URL:** <https://forums.pimoroni.com/t/adc-and-a-solar-controller/19325>\
**Category:** Support\
**Created:** [April 16, 2022, 11:43pm UTC](https://forums.pimoroni.com/t/adc-and-a-solar-controller/19325 "2022-04-16T23:43:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrewX](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@DrewX](https://forums.pimoroni.com/u/DrewX)\
**Post date:** [April 16, 2022, 11:43pm UTC](https://forums.pimoroni.com/t/adc-and-a-solar-controller/19325/1 "2022-04-16T23:43:45Z")

</div>

Hi there, and thanks for the help!

I have an off-grid orchard and I use the Automation Hat to let me run a well pump from a solar power system. I want to be able to read the voltage on the battery and the voltage on the panels using the ADC.

I went to a different school, so I am learning some foundational things. I am bench testing my idea using a variable power supply set to 12 volts and connecting the positive to the ADC 1 post. No ground, because I don’t know any better yet. I run this script and get the following results, different each time.

for x in range(0, 10):  
value = automationhat.analog.one.read()  
print(value)  
3.34  
9.87  
0.28  
11.82  
11.82  
11.82  
-0.85  
-0.85  
10.74  
10.74

I’ve set the supply to 12 volts and to 6 volts with similar results. All three lights on the ADC flash.

In the field, the solar panels will generate around 10 amps. This is a 12 volt system with a 100Ah battery I need to keep from dying with the panels connected least the panels pop the controller. Again.

Can you tell me how I might use the ADC properly before I break it?

Thanks again for the help!

DrewX

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [April 17, 2022, 12:06am UTC](https://forums.pimoroni.com/t/adc-and-a-solar-controller/19325/2 "2022-04-17T00:06:07Z")

</div>

You need a common ground as a reference for the adc measurements. Connecting only the + won’t work. As long as its one of the 24v tolerant adc it should be fine.

---

<div class="post-metadata">

**Author:** ![DrewX](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@DrewX](https://forums.pimoroni.com/u/DrewX)\
**Post date:** [April 17, 2022, 12:15am UTC](https://forums.pimoroni.com/t/adc-and-a-solar-controller/19325/3 "2022-04-17T00:15:10Z")

</div>

Thank you, alphanumeric. Do I connect the negative from the panel and battery posts on the controller to the GRD posts on the Automation Hat or to something outside of the device. Connecting a 10a circuit through my Pi is counter-intuitive.

Seriously. Lots of school, none in electronics, but I am good at listening. Thanks again.

DrewX

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [April 17, 2022, 8:19am UTC](https://forums.pimoroni.com/t/adc-and-a-solar-controller/19325/4 "2022-04-17T08:19:13Z")

</div>

Connecting the negative from the panel and battery posts on the controller to the GRD posts on the Automation Hat should be fine, and safe.  
To measure a voltage you measure across the “+” and “-”. The “-” is in this case also the ground connection. If you check I’m pretty sure you will find that the solar panel -, battery -, and controller - are all connected together. Connecting that point to the - on the hat will let it measure the individual voltages. The Pi +5V power supply will power the Pi and Hat just fine.

Doesn’t hurt to be sure of what your doing, and double check if you have doubts.
