sameh4
Posts: 50
Joined: Wed Nov 29, 2017 6:58 pm

Analog to Digital Conversion for the Pi Zero

Tue Dec 19, 2017 12:47 pm

I've got the PWM working fine now in my single purpose bare metal OS.

It's doesn't handle interrupts yet, but I have a GPIO class hierarchy that lets me blink the LED, and control the speed and direction of the DC motors. https://github.com/RazazRobotics/XiaoCa ... /gpiopin.h

Even though it's cpp I've made sure that no stdlib is in there, so a lot of stuff is really hacked right now. But more to the point:

I am now trying to get the Sharp IR distance sensor to work, and since it's Analog, I've been looking at analog to digital converters like this one:

https://learn.adafruit.com/raspberry-pi ... sh-ads1115

That distance sensor has a minimum operating voltage of 4.5v. I've also been reading that the I2C on the Pi's only outputs 3.3V and some have recommended a voltage regulator.

I already have this from a previous project https://images-na.ssl-images-amazon.com ... L1000_.jpg

My questions are:

1) With this analog to digital converter, https://learn.adafruit.com/raspberry-pi ... sh-ads1115, how can I connect multiple sensors? Do I need to get more than one of these? How does that work?

2) Will the voltage converter from above work fine? I think it should. Not sure exactly how the pinout will work if there's multiple sensors, but it should be able to take the 3.3 from the Pi and level it up to 5v with no problem. I used it to do the opposite in my previous project.

3) I have some physical space constraints on this project (it is a very small radio shack remote controlled car that I am replacing its brain with the Pi Zero). Can anyone recommend a good voltage regulator that's compact in size?

henmina53
Posts: 20
Joined: Thu Apr 05, 2018 4:49 am

Re: Analog to Digital Conversion for the Pi Zero

Wed Apr 25, 2018 7:25 am

I was going thorugh some old post found out your question and I completely understand your requirement, you can use I2C ADC converter which will help you to connect multiple sensor at same time there are many deice available here which help you and If some devices has same registers you can use jumper pins also

Return to “Bare metal, Assembly language”