Coder Social home page Coder Social logo

chrisb2 / battery-monitor Goto Github PK

View Code? Open in Web Editor NEW
21.0 4.0 3.0 573 KB

Particle Photon based 12v car battery monitor. Useful for alerting you that the battery is becoming discharged.

License: MIT License

Arduino 72.48% JavaScript 27.52%
battery-monitor thingspeak particle-photon

battery-monitor's Introduction

Car Battery Monitor

Particle Photon based WiFi 12v car battery monitor. The idea is to monitor the battery voltage in order to get early warning that the battery is becoming discharged. The project is intended to be directly connected to the battery via its main terminals.

I used IFTTT to send notifications to my phone for the low battery events generated by the program.

Another method I used to collect data was ThingSpeak using a Particle webhook. See webhook-thingspeak-template.json for a template which only needs your ThingSpeak API key and Particle device id adding.

The program uses the deep sleep mode of the Photon between voltage measurements, in this state the current draw from the battery is ~1mA. It takes about 15 seconds to wake-up, connect to WiFi, take a measurement and send an event containing the measured voltage. With a sleep time of 1 hour, a 1mA current should have negligible impact on charge state of the battery in a car which is driven every day.

Over the air (OTA) firmware update is supported by the node.js script ota-update.js, which when the Photon wakes, sends an event to prevent it going back to sleep. Updated firmware can then be flashed using Particle Dev or Particle Build. To run the script add a file auth.js containing:

module.exports = {
    username: '<your email>',
    password: '<password>',
    device: '<deviceId>',
    token: '<auth token>'
};

Circuit

circuit diagram

The 20V Zener and the ratio of R1/R2 means that the voltage seen by the Photon at A0 cannot exceed 1.8V.

Completed Project

project

Installation

The project needs to be installed somewhere near the engine bay where the WiFi signal will not be blocked the body of the car. On my car a good place was behind the front bumper (plastic).

BOM

  • Particle Photon
  • Traco Power TSR-1-2450 DC/DC Step-Down Converter
  • 1N4747 Zener Diode, 20V, 1 Watt
  • 1000uF 35V Electrolytic Capacitor
  • 0.1uF 50V Ceramic Capacitor
  • 150uH RF Choke, 4.2Ω, 175mA max
  • 1KΩ Resistor
  • 220KΩ Resistor
  • 22KΩ Resistor
  • In-line fuse holder and 250mA fuse
  • 2 core cable (2 Meters)
  • Solder tags (6mm ID) x 2
  • Waterproof box (with silicone rubber seal)
  • Silicone sealant (for cable exit)

References

I used the following to design the components which provide protection from noise in the car electrical system caused by the alternator and hopefully more severe events like jump starting.

battery-monitor's People

Contributors

chrisb2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

battery-monitor's Issues

Use with particle electron

Hi,

I would like to use it with the electron, because i have no wlan signal in the garage.

Do you think, your code could be use one to one?

greetings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.