Note: This has been depreciated and is not available any more. Please see the new version of this device.

Overview

The pedalog is a power and energy monitor specifically designed for use with pedal generators. There are many pedal power generating devices around – for example: for recharging batteries, powering sound systems or cinemas.

The pedalog has been specially designed to monitor the power and energy generated by these devices. Data can be collected and used to increase the educational value of pedal power demonstrations.

pedalog monitors power, energy, voltage, current, maximum power, average power and time taken by the user. This information is displayed on an integral LCD screen.

The USB connection allows computer interfacing for data display and recording, either through the supplied software or into your own application.

Other uses for pedalog:

  • Wind and solar photovoltaics power and energy measurement
  • 12V/24V DC load energy monitoring

This is the design pages for those who would like to build their own, construct the kit or who would just like a bit more information on the device.

Note: This is a work in progress. If you would like to discuss this project then please get in touch.

 

Design overview

The pedalog unit is based around the PIC 18F4550 micro-controller from Microchip. This is basically a small computer which does all the processing, taking in data and sending out data. This IC has on-board USB connectivity, hence why it was chosen for this project.

The overview of the circuit is shown here:

The main elements are:

  • DC current measurement
  • DC voltage measurement
  • PIC microcontroller
  • USB interface
  • LCD display
  • Battery charge circuit
  • 5V regulation circuit

These are discussed in this article.

Circuit diagram

Here is the full circuit diagram. As with all the circuit diagrams from re-innovation, this has been produced using KiCad, an open source PCB design package.

The main functions of the various parts of the circuit have been highlighted. They are discussed in more detail in this article. Download a pdf of this circuit here.

Here is an interactive version of the schematic (done using circuit bee, which I am just trying out for this kind of application):

http://c.circuitbee.com/build/r/schematic-embed.html?id=0000000182

The full KiCad files (including libraries, schematic, PCB) are available from this link. ***LINK***

DC current measurement

The options for measuring DC current are discussed on this page.

We have chosen to use the INA168 high side current measurement IC. This is only available in a surface mount package and is the only surface mount component. A very low ohm (0.005ohm) resistive shunt is used across which the voltage drop is measured. This voltage drop is proportional to the current flowing and the output voltage of the INA168 is in direct proportion to the current. A 5v1 zener diode protects from any voltage spikes. An op-amp used as a buffer ensures there is current available for the analogue to digital conversion.

DC voltage measurement

The output voltage of most pedal generators varies as the cyclist pedals. Power = Volts x Amps, hence we must know voltage at the same time as the current to find the actual power.

DC voltage measurement is relatively easy, although we have to be careful to keep within the safe operating range of all components. In this case we use a simple potential divider to change the input voltage range (of 0-30V DC) to the safe input range of the microcontroller (0-5V DC). Precision resistors are used to ensure that the readings are accurate and linear. A 5v1 zener diode is used to protect the input from any spikes which may occur. An op-amp is used as a buffer to ensure that there is enough current for the microcontroller to perform the correct analogue to digital conversion.

PIC microcontroller

A PIC 18F4550 microcontroller is used in this device. This is relatively inexpensive but with a vast array of features. It has on-board USB capability, numerous digital inputs and outputs, a 10 bit analogue to digital converter and 32kB of program memory. This was deemed the best choice of microcontroller for this project.

Microchip provide a number of free of charge (but unfortunately not all open-source) development tools for this device including:

I have written an article on microcontrollers and which ones to use for different projects, which may be of interest.

USB interface

We wanted to use a simple, plug and play interface such as the USB port. We did not want to mess around with additional USB to serial leads (as required with the Arduino) hence we wanted a microcontroller which had the ability to run as a USB device.

Microchip offer the USB framework for some of its products, which has been used for this project.

USB is a relatively complex protocol which will not be discussed in detail here, but please email if you would like to know more.

LCD display

The LCD was a simple 16 x 2 LCD screen with LED backlighting and HD44780 communications protocol. The device can work either in 8 wire or 4 wire mode. To save on I/O pins we used the 4 wire mode, which is a bit slower and more complex. Please research on this protocol to see how the communications work. Microchip had libraries available to use which would perform various functions, such as writing information to the display.

Battery charge circuit

This was harder to design than first expected. The specifications are that the device must be able to take 0-30V DC on the input terminals. The PIC microcontroller requires between 4 and 5V DC to function. A TL783 adjustable voltage regulator is used here. This has a high maximum input voltage (125V DC), thermal shut down and high current supply (800mA).This component requires 2 resistors to set the output voltage. I am using a rechargeable battery pack comprised of 4 x AAA batteries. This needs a recharge voltage of around 1.6 x 4 = 6.4V DC, hence the resistor values chosen. Check the datasheet for the resistor calculations. This will provide the maximum current it can, so a current limiting resistor of 5-10 ohms is also used in the path to the batteries. Low voltage drop diodes are also used to stop any current flowing in the wrong direction (i.e. the batteries can be recharged, but not power the circuit they are meant to be monitoring).

5V regulation circuit

The 5V regulation circuit is a standard circuit using a low voltage drop 5V regulator and some stabilising capacitors.

Parts List:

List of parts.

NetList

 

Is available. Exported from KiCad.

 

PCB layout

Image of the PCB

 

The full KiCad files (including libraries, schematic, PCB) are available from this link. ***LINK***

 

 

Download the PCB from this link.

3D image:

From KiCad

 

Code flow diagram

*******code flow diagram**********

Code download

Where from? Hex code

 

Software – link to the software page.

 

Uploading new code

With PIC bootloader

Leave a Reply

Your email address will not be published. Required fields are marked *