Jump to content

sgl_imaging_challenge_2021_annual.thumb.jpg.3fc34f695a81b16210333189a3162ac7.jpg

Arduino Project - Voltage and Current Sensor


Recommended Posts

 

Hi all

I have an idea for a little fun project that I hope will get me a good inroad into Arduino and electronics - but need a starting hand!

So, what I'm thinking is to build a portable power box that houses the USB ports, power switches for the mount and camera, etc, but also has a 2-line LCD display showing a variety of different measurements from the system - Voltage, Current, Temperature, Dew Point, LST, and eventually reading the mount for DEC and RA position. Possibly!!

The power box has a 7-port 12v USB hub, 1 USB input, 2 x 12v inputs each one supplying 3 outputs. There will be a button to cycle through the different sets of readings. One of the USB ports will be used for the Arduino, the others will be mount, camera, guide camera, focuser and SQM Reader. One of the 12v supplies will feed the mount and camera, the other will be for the dew controller and any other 'dirty' outputs needed. Power supplies will be a 13.8v Maplin bench supply (5amp, 7amp burst) - for the mount and camera side, and then another 12v 5amp for the 2nd inputs (don't have this yet...).

 

So, first step is get the Arduino to read the voltage and current from the two circuits. So, from digging around, I think an ACS712 is what I need to measure the current. Now the questions...

1) Are the eBay ACS712's OK to use?

2) For the voltage measurement, will a voltage divider be sufficient, or should I look for a dedicated module? Absolute accuracy is not vital I guess...

3) Other than fuses on all the lines, is there anything else I should look at for current protection for the Arduino?

 

I don't have a shopping list yet as I still have lots to think about, of course, so any recommendations on the LCD (HD44780 based one?), or anything else, feel free to shout!

Thx

 

 

  • Like 1
Link to post
Share on other sites

Yes the ACS712 will work, as would the MAX471, both of which can be purchased as simple cheap modules. A simple voltage divider would also work fine for voltage messurement and there are plenty of example Aduino sketches for reading the analogue inputs.

Ive done the same as your suggesting and monitor the voltage and current draw to my systems, and with a relay also automatically shut-down the supply if the current draw gets too high.

 

  Cheers, Mark.

Link to post
Share on other sites

This is what I am building atm using a Nano interfaced to a 4D Systems LCD displaying Voltages, temperatures, humidity, RTC etc.  The only limit is the size of memory on the Nano so I'm thinking of have another as a slave to take care of the LCD and Windows coms whilst the master takes care of the inputs.  Still needs debugging (DHT21 keeps dropping off!) but is usable.  It's all going into a Peli case with PS and 2 4 port USB hubs.  I decided against having one hub as to me it would share the load with imaging having two

 

A normal voltage divider will do for the volt readings.  Ensure that the max possible  input on the Analog pin is 5V.  Beware that some Arduino's also only accept max 3.3V

image006.jpg

--

Mark

 

 

Edited by MarkyD
  • Like 1
Link to post
Share on other sites

Thanks guys!

MarkyD - That LCD looks the danglies!! I think that's outside my capabilities for now, but something to aim at! :D

  • Like 1
Link to post
Share on other sites
  • 2 weeks later...

So... an update!

After much digging around and pestering the good folks on the Arduino forums, I have a circuit for measuring the voltage on my two supplies. This turned out to be not quite so straiht forward as I thought, as a) I don't know enough about electronics and b) I don't know enough about electronics!!

Anyway, I found a bunch of tutorials that showed how to use the Arduino reference voltage functionality to measure the analog input voltage as a % of the reference, and from that the real voltage. This means that it will work for being connected to a regulated mains supply or a battery pack in the field.

I've built this on a breadboard and testing is going well - I have the measurement of the primary circuit (i.e. the one that the Arduino is also powered from) and now need to find another source of power to check and test the secondary circuit. I also need to update the sketch to read both inputs and must remember to scale the output for 12v and not 5!

I attach my schematic if anyone fancies pulling it apart! The resistor values I settled on were 120K and 68K, as these ensured that no more than 5v hits the Arduino regardless if a bench supply or battery.

When I finish this part and the testing, I'll post the sketch and breadboard diagram as well...

 

Off to figure out my 16x2 LCD display!

 

 

My Voltae Divider_schem.png

Link to post
Share on other sites

Good progress!

As above I2C LCD's are nice & easy, however they will require pins A4 & A5 so you might want to pick another pin for the voltage measurement. Also, and I'm sure you have this covered, Gnd of the power supply your measuring should be connected to Gnd on your circuit.

 

  Cheers, Mark.

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

If the battery is connected then the power is likely to vary from 15V downwards... 

It may be better to setup to 0-15V range instead.

I'm no help on the resistors or capacitors etc.. but I have just implemented a voltage read using the stepper sense resistors to understand the current being applied to each coil.

The analogRead() results in 0-1023 range so 0V is 0 and 5V (AREF sets the analogue reference - the max value) is 1023 for the UNO board (same as mine). So 1V is (1023.0f/5.0f) and then that gives you the capability just to say sensor value / (1023.0f/5.0f) if my brain is working right that this time of night.  The AREF can be set to internal (which it is by default) and the maximum value for the ADC is 5V (or whatever the internal operating voltage is).

So the external circuit you develop must provide a scale 0-15V and then rescale that measured value to 0-5V max (0=0 and 5V presented to the ADC=15V measured). The in the software rescale back up - you'll loose some precision. So 0 value 0V and 1023 (5V into the analog pin) would mean 15V in the real word and the software can scale and display that accordingly.

I wouldn't know how todo that scaling 0-15->0-5V in hardware.. :/

 

Link to post
Share on other sites
9 hours ago, NickK said:

If the battery is connected then the power is likely to vary from 15V downwards... 

It may be better to setup to 0-15V range instead.

I'm no help on the resistors or capacitors etc.. but I have just implemented a voltage read using the stepper sense resistors to understand the current being applied to each coil.

The analogRead() results in 0-1023 range so 0V is 0 and 5V (AREF sets the analogue reference - the max value) is 1023 for the UNO board (same as mine). So 1V is (1023.0f/5.0f) and then that gives you the capability just to say sensor value / (1023.0f/5.0f) if my brain is working right that this time of night.  The AREF can be set to internal (which it is by default) and the maximum value for the ADC is 5V (or whatever the internal operating voltage is).

So the external circuit you develop must provide a scale 0-15V and then rescale that measured value to 0-5V max (0=0 and 5V presented to the ADC=15V measured). The in the software rescale back up - you'll loose some precision. So 0 value 0V and 1023 (5V into the analog pin) would mean 15V in the real word and the software can scale and display that accordingly.

I wouldn't know how todo that scaling 0-15->0-5V in hardware.. :/

 

 

Just need a voltage divider

Vout = Vin . R2 / (R1 + R2)

Choose R1 to be 10Kohm would be typical so R2 would need to be 5kohm

voltage-divider.gif

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By sulaco
      Hi, 
      Thinking of getting the Asiair pro whenever they come back into stock but wondered about the voltage output for dslr, it states that it’s12v but would that not need to be stepped down to 7.5v for dslr. 
      im wondering if the Pegasus power box micro with Stellarmate might be a better option as the dedicated power box is controllable. 
      I tried Ekos a couple of years back and had nothing but problems but tried again last night and was amazed at how slick it was, best guiding and first time plate-solvingwas effortless. 
      I have the original zwo  120mm  so reluctant to get a new one unless I have too. Has anybody been using the new advanced or micro  power boxes either stellarmate?
      Thanks
       Campbell
    • By HN50
      My attempts at SID monitoring have been languishing for a while due to radio problems, though I have been getting to grips with Arduino and even had a go at building my own.
      In order to move things along I went to the UKRAA stand at Astrofest and bought the VLF radio kit, their signal generator and the 15V power supply.
      Last weekend I soldered the board.  It wasn’t too difficult following their instructions which are pretty clear.  The only fiddly bit was soldering on an SMD capacitor but they also give you a through-hole one as well.  Initial tests suggest it is working but I will have a better idea when it is all connected.

      This weekend I have been working on the housing and hopefully tomorrow get the leads soldered.  From left to right will be led power, 15V in, 15V out, antenna in, then analogue -ve and +ve (can be 5V or 2.5V).  
       


      I am building it as-is, so the first iteration will have the radio running off mains power and in turn the radio will power the Arduino.  That seems a bit backwards but I would just like to get logging data.  For the time being it will write to an SD card, but the Arduino MKR 1010 looks rather good and comes with WiFi and encryption.
      That though, is a long way off..!  Anyway, this shows progress so far.
    • By lenscap
      My diy Onstep GoTo controller is basically an Arduino Mega 2560 with a RAMPS 1.5 shield, rated for 12V normal, 20V max & uses about 2A max.
      It is powered from a 12V car  battery. The lead has crocodile clips at the battery & connects to 5A screw terminals on the RAMPS.
      When I "power-up" by connecting the clips there is a spark at the terminal. This is expected, but does the sparking reduce the life of my electronics?
      If so is there a cheap/simple way to reduce or prevent this?
      I know I could put a switch in the lead but I assume the sparking would then happen inside the switch, making no difference.
       
    • By angryowl
      This will be a thread detailing some of the changes and additions I will be doing to my ASC/Weather Station project. This is version 2.0 as I'll be making some very big changes from the initial project and I think continuing on in the existing thread would not have made much sense.
      So, I still want to use an APS size sensor as after seeing the quality and light capturing capabilities of the now defunct Opticstar DS-616C XL camera and Meike lens I simply cannot go back to using a smaller lens/sensor combination. One thing is certain, I won't be paying £400 or potentially more for another APS astro sized camera so with that in mind I plan on heavily modifying a Nikon D50 DLSR and use the same lens. I chose the D50 primarily due to it having a CCD sensor (ICX453AQ) very close in specs to the one in the Opticstar (ICX413AQ) and the fact that I got a hold of a fully working body for £25.
      Now there's a few issues with going down the DSLR route which I plan on addressing as follows:
      The oversized camera body can be stripped down to bare essentials and fitted in the existing case with some moving of parts around Uncooled, the sensor is quite noisy so to cool it I plan on using the existing Opticstar enclosure with the TEC and hopefully get it purged with Argon to avoid dew formation. Also, since the box will need to be completely sealed to achieve this, there's simply not enough room inside for the main board to which the sensor connects to. The only way around this is using an 39pin 150mm long FPC extension which I managed to find and will be arriving shortly. This means I can have the sensor completely sealed with enough slack in the connection to place the mainboard anywhere I want. The D50 uses the NEF file extension as a "RAW" file format but it's not truly RAW and a heavy median filter is applied to all long exposure images to smooth out the noise. It works great for day to day shots, but in an application such as mine it'll most probably eliminate or severely affect my stars as most of them at the FL I'll be using the camera at will be a few pixels across and the Nikon median filter is very aggressive with such small features. The way around this is what's commonly known as Mode 3 on Nikons. Nikons have a additional Noise Reduction mode which takes the long exposure light first then straight after an equal length dark with the shutter closed, then applies the dark on the light and you get a further noise reduced image which again works very well, but not so much for AP. With mode 3 you essentially have the NR feature on and take an exposure but then immediately shut down the camera after the light has finished exposing. What this does is it causes the camera to dump a REAL RAW image onto the SD card without applying the median filter OR the Noise Reduction process. This obviously results in a much noisier image as expected, but all the stars will still be there and the image in this way can then be dark-subtracted and processed to my liking. I'll post some test shots I've taken to illustrate this. The D50 uses a hybrid shutter, both the CCD electronic shutter and mechanical shutter are used depending I think on the exposure length. If a high enough exposure is used, from what I understand, one can use exclusively the electronic shutter, but for longer exposures the shutters work in conjunction. Now I know the ICX413AQ in the Opticstar is more than capable of taking long exposures solely with its electronic shutter despite the fact that in its datasheet they recommend a mechanical shutter for proper use. So, my thinking is since the D50's sensor is similar to the ICX413AQ the only thing preventing the camera from being able to take any exposure using exclusively the electronic shutter is that its mechanical shutter is in the way and I don't think that the camera would prevent the CCD electronic global shutter itself to still open and close when required. However, this is all a theory at the moment and the only way to confirm it is to test the camera with the sensor outside when the FPC cable arrives. More on this later... In terms of capture software available, the D50 is actually very poor and I could only get digiCamControl to see and control the camera via USB. But I won't be using this as when the camera is hooked up to the PC its SD card is identified as a storage drive and the camera can be used as it would normally with the images appearing on the drive after being written to the SD! Since I'm using my VB app to process the images I would just point the app to that folder and should work. That's all I can think of for now but if and when new ones come up I'll add them here.
      Next I'll be describing some of the other changes planned.
    • By bottletopburly
      So  my birthday just past so money to splash on astro stuff , i will have my 1000D modded by juan at cheapastrophotography and also have ordered an autofocuser from deepsky dad https://deepskydad.com/autofocuser i know they can be done DIY but this is a neat package  and costs about the same as a SW autofocuser and a hitechastro focusmaster and i`m no electronic wizard and pavel seems to have a good product and works with ascom and confirmed it works with APT i will update in a few weeks time when hopefully i will have received and tried out . 
       
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.