Тёмный

VOLTAGE SENSOR (0-25V) - Arduino tutorial #17 

Bas on Tech
Подписаться 7 тыс.
Просмотров 58 тыс.
50% 1

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 106   
@BasonTech
@BasonTech 4 года назад
👉 Don't forget to check arduino-tutorials.net for more Arduino tutorials and projects. If you have questions, don't hesitate to ask them in de comments. Remember: There are no stupid questions 😃
@sapoty
@sapoty Год назад
The current draw by an analog input pin is less than 1 micro amp so any voltage dividing resistors in the kilo ohm range will give a pretty accurate measurement.
@TheMrPaisu
@TheMrPaisu 4 месяца назад
Super clear Sketch!! thank you for your service 🙂
@BasonTech
@BasonTech 4 месяца назад
You're welcome! 😃
@jiriblahos4051
@jiriblahos4051 2 года назад
Hi! Could you explain a bit more the plus pin on the sensor? In many tutorials, people simply ignore this pin, don't connect it to anything. They only connect the - and S pin. What's the difference?
@BasonTech
@BasonTech 2 года назад
I have honestly no idea. It could be that the sensor is not using this pin. Sometimes they have 3 pins to match the standard sensor wires which have 3 connectors and these are not all used.
@ViktorSolenoid
@ViktorSolenoid 4 года назад
super nice tutorial and clear sketch. thanks mate
@BasonTech
@BasonTech 4 года назад
Thanks! :)
@sapoty
@sapoty Год назад
A better way to do this would be to use a zener diode eg 20v to clip the signal down from eg 23v to 3v and measure the 3 volts and add it to the 20 in your code. That could give more resolution/accuracy.
@noccloud
@noccloud Год назад
Can you please elaborate this procedure?
@sapoty
@sapoty Год назад
@@noccloud say you want to monitor a voltage about 26 volts and you have a zener diode at say 24v. I would put the zener diode at the positive side of the 26v in series with a 1K ohm connected to zero volts. The voltage across the resistor is 26-24 =2 volts. The Arduino can measure the 2 volts. The software can add the 24 volts to give an accurate reading of the 26 volts.
@IceCream786
@IceCream786 3 года назад
What if we want to measure voltage greater than 25V then the sensor work?
@BasonTech
@BasonTech 3 года назад
No this could be very dangerous! The max voltage is 25V Higher will damage the sensor or worse. You then should look for a sensor which suits the voltage range you want to measure.
@sapoty
@sapoty Год назад
@@BasonTech why not just put a zener diode in series. Say a 5 volt zener diode dropping a 28v battery down to 23 V to enable estimation of the battery voltage?
@chl3284
@chl3284 5 месяцев назад
Thanks you so much! But, I have a question can this sensor measure the negative voltage?
@BasonTech
@BasonTech 4 месяца назад
My pleasure! I am not sure if it can.
@darrenp1711
@darrenp1711 4 года назад
Thanks very much, really clear to follow !
@BasonTech
@BasonTech 4 года назад
Great to hear! Thanks! 😃
@kahramankara1502
@kahramankara1502 2 года назад
Thank you.
@BasonTech
@BasonTech 2 года назад
You're welcome! 😃
@bradley9856
@bradley9856 Год назад
im really confused as to what you are using for V in and V out for calculating the factor, can you explain?
@DirtNerds
@DirtNerds 7 месяцев назад
I NEVER SAW you connect the 12vdc on your video I m trying to calculate this 5000vdc and the R1 is equal to 5meg ohms, what is the required R2?
@BasonTech
@BasonTech 7 месяцев назад
I think this voltage divider calculator will help you with that ohmslawcalculator.com/voltage-divider-calculator 😃
@bassph
@bassph Год назад
Can we add a relay module. Function of relay is when the voltage reach example 14v relay will on and if it goes down to 11v relay will off? It is possible? Thank you...
@BasonTech
@BasonTech Год назад
With an Arduino for sure! Just monitor the input of the voltage sensor and trigger the relay when you please 😃
@sarathsanthosh289
@sarathsanthosh289 Год назад
very helpfull
@BasonTech
@BasonTech Год назад
Glad I could help! 😃
@lutfirrahmananuar7847
@lutfirrahmananuar7847 Год назад
Hi! could you explain how to find the factor if i use ESP32
@jumbo999614
@jumbo999614 Год назад
Can we use this voltage sensor with current sensor (acs712) at the same time from the same source? I want to measure supply voltage and how much current flow into the Load.
@BasonTech
@BasonTech Год назад
I do not see why not, however I've never used this sensor so at your own risk 😄
@Pankaj-2001
@Pankaj-2001 2 года назад
Hi! I really needed help with connecting and taking readings of 2 or more than 2 voltage sensors simultaneously through the Arduino. The physical connections are do-able but I am facing difficulty with the code. Can you please help?
@BasonTech
@BasonTech 2 года назад
On what part of the code do you het stuck?
@Pankaj-2001
@Pankaj-2001 2 года назад
@@BasonTech double adc_voltage1 = 0.0; double adc_voltage2 = 0.0; // Floats for resistor values in divider (in ohms) double R1 = 30000.0; double R2 = 7500.0; // Integer for ADC value int adc_value1 = 0; int adc_value2 = 0; void setup(){ // Setup Serial Monitor Serial.begin(9600); Serial.println("DC Voltage Test"); } void loop(){ // Read the Analog Input adc_value1 = analogRead(A0); adc_value2 = analogRead(A1); // Determine voltage at ADC input adc_voltage1 = (adc_value1 * 5.0 * 10.0) / 1024.0; adc_voltage2 = (adc_value2 * 5.0) / 1024.0; // Calculate voltage at divider input double in_voltage1 = adc_voltage1 / (R2/(R1+R2)); double in_voltage2 = adc_voltage2 / (R2/(R1+R2)); // Print results to Serial Monitor to 2 decimal places Serial.print("Input Voltage1 = "); Serial.println(in_voltage1, 4); Serial.print(" Input Voltage2 = "); Serial.println(in_voltage2, 4); // Short delay delay(500); }
@Pankaj-2001
@Pankaj-2001 2 года назад
i have done this but it is not working
@BasonTech
@BasonTech 2 года назад
what error do you get?
@dharma.vibrates
@dharma.vibrates 2 года назад
Hi Sir nice video, does an oscilloscope work on the same principle ?
@BasonTech
@BasonTech 2 года назад
Good question! I guess it depends on the oscilloscope, but I doubt if it works with the same principle.
@mohamedkhalif1686
@mohamedkhalif1686 Год назад
Can use this type of voltage sensor on a plc
@BasonTech
@BasonTech Год назад
I have no experience wilt a PLC so can't give any recommendation, sorry.
@fathurrachim7919
@fathurrachim7919 3 года назад
thank's for information
@BasonTech
@BasonTech 3 года назад
You're welcome! 😃
@Dungnguyen-yd5or
@Dungnguyen-yd5or Год назад
I have a question; I use both analog pin for precise voltage read and Voltage sensor for current that is over 12V. I noticed that when the voltage reading a separate source of 5V, my analog pin jump from 10 to 200 when it has no voltage supplied to it. Why is that happening?
@BasonTech
@BasonTech Год назад
That is hard to say, a guess is the sensor is broken. But that is just a wild guess.
@Mossycak
@Mossycak 4 года назад
I need your advice for my project. I connect voltage sensor and irf520 mosfet module to the power supply (12V lead acid battery). Without connecting the irf520 mosfet module, the measured voltage is correct. But, the measured voltage displayed by the serial monitor is 25.2V after I connect the irf520 mosfet module to the power supply. May I know how to fix it?
@BasonTech
@BasonTech 4 года назад
I am sorry, I have no experience with a mosfet so I can't help you with this issue. My suggestion would to ask this on the Arduino forum forum.arduino.cc/ or on Reddit at the www.reddit.com/r/askelectronics/ subreddit. Hope this helps 😃
@kwstaspol1
@kwstaspol1 3 года назад
THANK YOU. what if we want to monitor our voltage and if it drops under a certain value to do something ( alarm,etc). is it possible with this sensor?
@BasonTech
@BasonTech 3 года назад
Sure, as long as the voltage of the device you are probing stays within the sensor range 😃
@kwstaspol1
@kwstaspol1 3 года назад
@@BasonTech of course, but is it a software or a hardware issue? Let's assume that we have one battery standby and when we notice a big drop of the main, to change using a relay to the reserve. How could this, be done. Thanks in advance
@BasonTech
@BasonTech 3 года назад
Just measure the voltage till it drops below a certain threshold, then switch the relay.
@engjjd
@engjjd 3 года назад
how can get factor for esp32 vcc 3.3 v for this sonsor
@BasonTech
@BasonTech 3 года назад
I do not really have any experience with this sensor and the ESP32. I guess you can do the same measurements as I did for the Arduino. Only the ESP has 3.3V instead of the 5V Uno.
@daviderickennedy2194
@daviderickennedy2194 5 месяцев назад
What is that gold circle for? Anyone know?
@BasonTech
@BasonTech 5 месяцев назад
From what I understood it is a mounting hole. If is said the metal helps to keep PCB layers together if there are multiple.
@fanuelmunyoro9851
@fanuelmunyoro9851 Год назад
can i have the link for downloading voltage sensor module
@BasonTech
@BasonTech Год назад
You mean for the code?
@mubashirazmat2281
@mubashirazmat2281 2 года назад
There are a lot of fluctuations after decimals... Is there any possibility to fixed this ?
@BasonTech
@BasonTech 2 года назад
I guess you'll need a more accurate sensor if you wish such an accuracy.
@sapoty
@sapoty Год назад
Alternatively you can take 20 measurements in a second and calculate the average as a good estimate.
@projectpegasus1297
@projectpegasus1297 2 года назад
can these be connected in series? like for a 10s battery
@BasonTech
@BasonTech 2 года назад
Good question! To be honest I don't know. Maybe you can find it with the datasheet of this sensor?
@projectpegasus1297
@projectpegasus1297 2 года назад
@@BasonTech i found that it's not possible, because that would exceed the 5v per pin on the Arduino. you would need to design a circuit with specific resistors to be 0-0.5 V per pin adjust scaling factor, and now 10s of 0.5v modules is 5v and now the Arduino wont be fried, probably.
@226gopivishwakarma6
@226gopivishwakarma6 2 года назад
Can you build it with raspberry pi . I have a project of making voltmeter with raspberry pi. Pls help me
@BasonTech
@BasonTech 2 года назад
I never did, but I guess you can since the RPI has GPIO ports 😃
@propdork
@propdork 4 года назад
Hi friend, are you powering the Arduino from the middle pin + of the voltage sensor? I don´t get any voltage from that source only Signal, have i overseen something? thnx
@BasonTech
@BasonTech 4 года назад
Hi, have you connected your Arduino to the sensor the same way as shown on the circuit schema in the course material? arduino-tutorials.net/tutorial/reading-voltage-sensor-with-arduino
@johndoggett3324
@johndoggett3324 3 года назад
@@BasonTech I have wired it up the same and i get no power from the same pin, so where does the power come for the arduino?
@johndoggett3324
@johndoggett3324 2 года назад
@@BlondieSL hi there Yes I worked it out thank you. I pretty much did the same as you have said and all works good.
@sapoty
@sapoty Год назад
The + pin is not connected to anything... Forget it exists.
@ringgoap
@ringgoap 2 года назад
Sir, I need ur enlightment, i folow ur code, now then i want to change range of this sensor into 0 - 2500 mV ? Is it possible ?
@BasonTech
@BasonTech 2 года назад
I don't think this sensor has such high resolution. The way this sensor works is just an estimate of the voltage.
@sapoty
@sapoty Год назад
Just connect your wire straight onto an analog pin.
@Dartmud
@Dartmud 2 года назад
seems the voltage varies a lot any way to fix that i have a running set up.
@BasonTech
@BasonTech 2 года назад
Hard to say, could it be that there is some loose connection? Otherwise this sensor might not be the best for your project.
@ekabahenda
@ekabahenda 3 года назад
Does the voltage sensor measure AC voltages?
@BasonTech
@BasonTech 3 года назад
As far as I'm aware this one is just for DC
@bobl703
@bobl703 Год назад
How do we power an esp8266 microprocessor with the battery while also checking the battery's voltage with the voltage sensor? The 8266 uses 3.3V and the battery I'm using is a LiFePO4 3.2V. If I use a USB cable to the 8366, everything works as expected. But as soon as I unplug the USB cable from the 8266, there is no power to the esp8266 anymore. I tried plugging a jumper wire onto the sensor's + pin and the other end to the 3V3 pin on the 8266, but that doesn't give it power. I also tried connecting the jumper wire to the 5V pin on the 8266, but still no power. If I connect the battery's wires directly to the 3V3 pin via a breadboard, my 8266 works fine. Anybody have any ideas? Is there any documentation for this Voltage Sensor board?
@danialhaziq2907
@danialhaziq2907 4 года назад
hi, can i get the tutorial on how to measure the Vin on adaptor and Vout on arduino?
@BasonTech
@BasonTech 4 года назад
Hi Danial, I am not entirely understand your question. What do you want to achieve?
@sapoty
@sapoty Год назад
Hey everyone, forget the + pin and the silly wheel in the centre. Neither are connected to anything. Just there to confuse you hahaha 🤣 The circuit just takes the Vcc voltage and divides it down to one fifth at the S pin.
@sapoty
@sapoty Год назад
Just multiply what Arduino reads off the S Pin by 5 = your measured voltage.
@bobl703
@bobl703 Год назад
@@sapoty If we use this with an esp8266 or esp32 (which both use 3.3V), would we multiply by 3.3 instead of 5? Or do we still multiply by 5?
@Sanjay-ds1qj
@Sanjay-ds1qj Год назад
It can withstand 12v 1A ?
@BasonTech
@BasonTech Год назад
I think 1A is a bit too much for this sensor. But I can't proof it with a datasheet. All specs I could find talk about the voltage range and not the current limits.
@Sanjay-ds1qj
@Sanjay-ds1qj Год назад
@@BasonTech then 175mA ?
@BasonTech
@BasonTech Год назад
I assume it should work. Unfortunately without a datasheet telling me so, I can't confirm anything 100%. Use at your own risk 😉
@Sanjay-ds1qj
@Sanjay-ds1qj Год назад
@@BasonTech thank you 👍
@dinamics2
@dinamics2 4 года назад
why output is fluctuating when measuring voltage from external power supply
@BasonTech
@BasonTech 4 года назад
Is it perhaps an AC power supply? How much is it fluctuating?
@minhphuc1283
@minhphuc1283 4 года назад
thanh you sir
@BasonTech
@BasonTech 4 года назад
You're welcome! 😃
@minhphuc1283
@minhphuc1283 4 года назад
@@BasonTech When volt increase or decrease factor will change
@chandanalokesh1839
@chandanalokesh1839 7 месяцев назад
Can you share tge code
@BasonTech
@BasonTech 7 месяцев назад
You'll find a link to the code in the description of each video 😃
@marlonathome9241
@marlonathome9241 2 года назад
the + PIN has no function and does not need to be connected
@BasonTech
@BasonTech 2 года назад
Thanks for sharing!
@manideep1157
@manideep1157 3 года назад
Hey, can this module measure 24v continuously for 10 hours?
@BasonTech
@BasonTech 3 года назад
Hi, as long als you stay within the boundaries of the sensor there shouldn't be a problem doing so.
@manideep1157
@manideep1157 3 года назад
@@BasonTech what is the model of the module you used. Thank you.
@BasonTech
@BasonTech 3 года назад
arduino-tutorials.net/r/8xim06
@EliOfMilkyWay
@EliOfMilkyWay 3 года назад
Needs more board time lol
@sapoty
@sapoty Год назад
I wonder if this little board reduces noise or is it just a scam to make money because any pair of resistors are could do the job... And if one of the resistors was variable it would be fully adjustable.
@BasonTech
@BasonTech Год назад
I don't want to call this a scam. It just suits another target audience. There are many Arduino kits which use a 3 wires glued together for sensors, buttons etc. Therefore every PCB sensor has 3 pins even though they are not all connected. You can easily make this yourself with bare components as shown in the video. Some prefer not to and want to use an off the shelf component. The purpose of this tutorial is not to show the best / preferred way of measuring voltage. It is to show you to use and connect this specific voltage sensor.
Далее
How-to: Accurate Voltage Measurements with Arduino
12:15
Measure DC Voltage and Current with Arduino
37:29
Просмотров 200 тыс.
Ванесса 🆚 Крискас  | WICSUR #shorts
00:42
WOW! ⚡AC VOLTAGE⚡ Detector Circuit?! Can It Be?!
10:01
Different Ways for Measuring Current With Arduino
13:32
You can learn Arduino in 15 minutes.
16:34
Просмотров 10 млн
Your USB-C Cable probably SUCKS! Sooo is that Bad?
10:54