• What kind of solar panel? A small one, or a large one that might power a house?

    And what are you powering - or do you just want to measure the power produced by it?

    Espruino can directly measure voltage with a pin marked as ADC (so C0-3 are fine) using analogRead(pinName) - as long as it is in the range 0v to 3.3v.

    Getting the current flowing out of the panel is more difficult, but the usual way to do that is to use a low-valued resistor, such that a small amount of voltage is lost inside it due to the current, and then you can measure that voltage and then work out the current.

    If you give us an idea what you want to do we could suggest a circuit... Probably the easiest circuit would be if you had a very small solar panel and you didn't want to power anything from it - then you'd just need one resistor.

    Having said that, solar panels are odd in that the power they produce depends on the current that you draw out of them - so for trying to find the maximum power you can get out of a solar panel for a certain amount of light (rather than just what it's producing right now) gets quite difficult!

    edit: as @allObjects says, if you have a 'charge contoller' for your solar panel then it will get the maximum power out of it - so then all you're worried about is measuring what comes out of the contoller.

About

Avatar for Gordon @Gordon started