1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Arduino for managing Solar powered wireless router volts/amps/temp/light

Discussion in 'Project Logs' started by Geofrancis, Mar 31, 2014.

  1. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i have built a solar powered wireless router and to manage it i have designed a system around an arduino board connected to the network via a serial port and SER2NET on openWRT.

    the idea is to use the arduino to monitor the battery voltage, solar panel current output, sun brightness, uptime and monitor the battery temperature to turn on the cooler.

    so using what i have picked up from school doing Comal and messing around with flight controllers i managed to google and hack enough code together to almost do what i need it to do. (i think)

    does anyone know a better way of doing any of the code ? this is my first time so assume its crap

    the solar readout is a bit basic i need to figure out a way of calibrating the LDR so 100% is a sunny day in summer and 0% is darkness

    it looks okish on my test arduino with nothing connected but im sure thats why the measurements are a bit whacky.

    the fan control will eventually run a small TEC to cool the batteries transferring the heat to the aluminium back plate. i figure if its hot enough to overheat the batteries i can spare some power to cool them.



    Attached Files:

    • .jpg
      .jpg
      File size:
      793.8 KB
      Views:
      94
    • arduino.png
      arduino.png
      File size:
      67.4 KB
      Views:
      86
    Last edited: Mar 31, 2014
  2. james888

    james888

    Joined:
    Jun 27, 2011
    Messages:
    4,283 (3.78/day)
    Thanks Received:
    1,425
    You sir always have the most interesting projects I must say.
    Geofrancis says thanks.
    Crunching for Team TPU
  3. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i want to mas produce these soon so i am doing my best to keep the costs down so far its:

    20W solar panel £32
    TP-link wr703n with openWRT £14
    4s 5800mah lithium pack £30
    arduino lillypad £4
    4s battery protection pcb £4
    temperature sensor £2.30
    light dependant resistor £2.75
    5a current sensor £2.66

    if it gets too hot during the summer i will add
    5a transistor
    30w TEC plate connecting the aluminium plate against the batteries to the backplate of the router.


    and a couple of random resistors

    I could probably use just one of the batteries during the summer and 1/4 of the solar panel but I live in Scotland where the days are very short during the winter with sunrise around 8:30 and sunset around 4pm but im on the west coast so it doest get too cold for very long. so i hope to get away with using cheap lithium packs.
    Last edited: Mar 31, 2014
  4. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i am replacing the cheap ebay regulator at 4v and the linear regulator in the router with a TRACO TSR 1-2433 - 3.3V/1A switching regulator to try and get power consumption down as low as i can. if i bypass the regulator and run both the arduino and the router direct from the 3.3v switching regulator i should get much more efficiency.
    Last edited: Mar 31, 2014
  5. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i have make singificant progress on the arduino software i now have functional voltage,amps,temperature, light, cooling and heating.

    i have even managed to add graphing to it using SimPlot http://www.negtronics.com/simplot



    im just waiting for some sensors and the routers now.


    Attached Files:

    Last edited: Mar 31, 2014
  6. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    my TP link router arrived today
    [​IMG]
    [​IMG]
    [​IMG]


    what i have to do:
    install OpenWRT,

    configure the serial port to run at 9600 baud rather than 115200 to hopefully save a little more power

    install ser2net

    setup ser2net to forward the onboard serial port

    solder 2 wires from the serial port to the arduino

    chop the antenna off the pcb and solder on a pigtail

    bypass the onboard 3.3v regulator and run it from a TRACO TSR 1-2433 - 3.3V/1A switching regulator along with the arduino.
  7. Sasqui

    Sasqui

    Joined:
    Dec 6, 2005
    Messages:
    7,504 (2.37/day)
    Thanks Received:
    1,314
    Location:
    Manchester, NH
    A friend of mine built an arduino controlled solar powered hydroponic tower. The arduino controls the solar charging, pump on/off timing and measures temp (he plans on PH as well), logs all information to an SD card. The setup looks like a crashed satellite with tomatoes growing out of it ;)

    Needless to say, I'm interested in this! Can't help much as I was just watching it all. Subbed.
    Geofrancis says thanks.
  8. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    my first prototype was a little funky looking it ran from 2x 5v 1A solar panels in parallel charging a 1s 6p rewired laptop battery. everything is mounted to a spare tv antenna that was ideal for adjusting the panels for the optimum angle. but this time im trying to put everything inside a solar panel rather than all the elaborate mounting.

    Attached Files:

    Mindweaver and Sasqui say thanks.
  9. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    this is the soldering to be done

    Attached Files:

  10. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    ok using a combiation of the firmware from here and guide here

    I have managed to get ser2net running on openwrt and accepting connections from my pc over the network. when my arduino arrives il find out if it works properly.
    blobster21 says thanks.
  11. blobster21

    blobster21

    Joined:
    Oct 24, 2004
    Messages:
    292 (0.08/day)
    Thanks Received:
    55
    Location:
    Vandoeuvre - France
    very interesting build !
    Geofrancis says thanks.
  12. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i have been spending the last few days working out the best way to setup a transparent wireless repeater on DD-WRT or OpenWRT. unfortunately i didn't realise the universal repeater function was only available on broadcom and not on my atheros based routers so eventually after not being able to find an acceptable solution i have got it working using WDS. i didnt want to use it originally because of vendor lock in but since all my ubiquiti and tp-link routers are atheros its not really an issue.

    i think i have everything working now. transparent wireless bridging and the serial output for monitoring @ 115200 since that is the routers default speed but i will change that to 9600 once im sure its working.

    the key was disabling the console on the serial port removing "ttyATH0::askfirst:/bin/ash --login" from the /etc/inittab

    and adding "1024:raw:600:/dev/ttyATH0/1:115200 NONE 1STOPBIT 8DATABITS -XONXOFF -LOCAL -RTSCTS" to /etc/ser2netconf

    and "ser2net" to the startup.


    im just waiting for my arduino. and current sensor before i can test it properly.
    Last edited: Apr 5, 2014
  13. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i soldered the wires on for the 3.3v voltage regulator and hot glued it in place along with the wires for the serial and a led to make sure the pads were working.

    Attached Files:

  14. Mindweaver

    Mindweaver Moderato®™ Staff Member

    Joined:
    Apr 16, 2009
    Messages:
    5,148 (2.66/day)
    Thanks Received:
    2,653
    Location:
    Statesville, NC
    Nice work man! :toast:
    Geofrancis says thanks.
    Crunching for Team TPU
  15. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i hooked up my test arduino nano v3 via a couple of 1k resistors to the routers serial port and got it kind of working...

    its getting a lot of corruption at 115200 but to change it i would have to compile openwrt from source as the serial baud rate is hard coded into the kernel but i think it should be ok with my new arduino as its also 3.3v .


    OK... After some more testing and changing the firmware I have the serial port talking to the arduio at 9600 baud and all the corruption has gone.

    Attached Files:

    Last edited: Apr 6, 2014
  16. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i have got sick of waiting for my arduino lillypad and decided to just convert my arduino pro mini to 3.3v and use it for calibrating everything.

    now the ardino is talking to the router i can start connecting sensors.

    Attached Files:

    Last edited: Apr 7, 2014
  17. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    i have hooked up a pair of resistors as a voltage divider and calibrated it for my 3.3v arduino,
    10k LDR and 10k resistor to measure sunlight
    TMP36 thermistor is working but needs better calibrated

    the only thing stopping me installing this in a router just now is waiting for my current sensor.

    Attached Files:

  18. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    everything apart from the current sensor is now working damn slow china post.

    next step is to learn about the power management on the arduino so that i can minimise its power consumption.

    Attached Files:

    Last edited: Apr 7, 2014
  19. Geofrancis

    Geofrancis

    Joined:
    Mar 12, 2009
    Messages:
    1,041 (0.53/day)
    Thanks Received:
    153
    Location:
    SCOTLAND!
    ok some more progress!

    done some thermal testing to see if the batteries would overheat but with the 6mm depron between the panel and the batteries they are barely getting warm. then i done some cold testing by sticking the router in my freezer for a week at -20 to see the effect on the battery but it was minimal since im only using 80ma from the batteries.

    external rp-sma connector is now soldered to the router.
    Light Dependant resistor is now on the front of the solar panel.
    Router led now mounted to the outside of the solar panel.

    still to do

    waiting for the damn current sensor!!
    change the charger pcb since this one goes up to 4.35v which is far too high for these lipo batteries.

    Attached Files:

    blobster21 says thanks.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page