Hello forum..!
May i ask if it is possible to create a Script that can shut down my PC when the voltage goes less than 4,5V?
confused
By sakis33
— Last update
Discover more robots
Ericez's Rori The Coffee Robot For Movie
DIY low-cost robots and tutorials: donated EZ-Board enabled 3D-printed Rori coffee robot for an Indonesian web series,...
Ezang's My New Update Arm Robot 11/14/2019
Robot arm gripper upgrade: 5th MG996R servo for auto-positioning, five servos total using EZ-Builder and EZB4 with a...
Mickey666maus's Hey Guys...This Adafruit 16-Ch
Control Adafruit 16-channel PWM/Servo Shield with Synthiam ARC to drive multiple servos seamlessly.

Hi justin..,
as i write i want to create a Script that can shut down my PC when the voltage goes less than 4,5V?
i use V3 controller with a pc board. i want to know robot's voltage .
A jumber on ADC 0 between +5 & signal, like the photo?
You got it!
But, the GetADC() is gonna return an 8 bit value between 0-255 on the v3. So a little bit of math is needed to get the voltage.
255 = 5v 127 = 2.5v 0 = 0v
That means 255 / 5 = 51
So 4.5 * 51 = 229.5
Your code will actually be GetAdc(ADC0) < 229
I dont think it will work.
5v is the voltage reference, if the voltage drops to 4.5 the voltage reference will be 4.5 so the scale will be the same.
I m not familiar with ezb v3's voltage regulator does the board works with 4.5 ?
I'd recommend using a 2 resistor voltage divider to sense the voltage:
Voltage source ---VVV---ADC0---VVV-----GND
If the voltage source is 10V or lower a pair of 10kohm resistors would be fine to cut the voltage in half (5V max) and then tap the ADC0 sense line from the center connection of the resistors.
The EZ-Bv3 should work at input voltages 4.5V and a bit below but @ptp is right, as the voltage drops the analog voltage reference also gets lower the scale will stay the same so the ADC0 value won't change as you'd expect it should.
I guess we should clarify, are you using the same power supply for your ez-bv3 and your PC @sakis33?
Hello jeremie..,
yes i use the same power supply for ez-b v3 and my pc .
so you think that is not going to work ? i think that you have a point ...., i am going to try it again today and i give a reply
It'll work the way described as I have done with robots in the past. The latest version of the v3 uses a more efficient voltage regulator for the pic and Bluetooth that will operate as low as 3 volts.