Sun Computer

From Black Metal Forest
Jump to: navigation, search
CLICK HEREfor more photos

I built a little Solar Sensor for the team. It was for detecting solar power(W/m2) and XY sun angle, ahead of the solar car while it was on the road. The box had an GPS to couple the solar measurements with position data. The solar sensor module itself was donated to the team as apart of a SolarMEMS sponsorship of the team. It was a huge pain to get working as it used RS-485, and did not follow the RS-485 standards very well. I really don’t recommend it unless you get it for free like we did. :(

Teensy 3.1

Teensys are great. They don’t have the USB data pins “broken out” so I had to make a little extension out of the main port so I could have a durable USB-B port on the outside of the box.

Solar Sensor

The sensor is a SolarMEMS ISSD60. It uses a 4 quadrant silicon solar sensor, can detect X and Y angles, ±60° from the normal. It also detects solar radiation in W/m2, but dose not compensate for the angle of incidence. You probably can compensate for the angle of the detector and get the "normal" Solar Radiation back.

The data protocol on the SolarMEMS was very poorly implemented. The datasheet says it uses the Modbus standard. NOPE. First, the differential A and B lines were swapped AND labeled + and -. The sensor data registers began at 1 instead of 40001 (at least I got an error response). The first bits of the response were always corrupted, i'm not sure why, but I knew is was static data about the model number and serial number, so I was simply able to ignore that data. phew! Despite it's awesome function I do not strongly recommend this device.


I used the TinyGPS library for easily decoding NEMA messages.

ARDUINO GPS WARING: NEMA messages are often more than 64 characters long. Most Arduinos and in my case, Teensys, have a Serial buffer only 64 chars long and need to be configured to be longer. On a Teensy, the Serial core files need to be modified.


The Fact about LCDs: When displaying things on standard character LCD, the screen needs to be cleared between every update to erase extra chars if a displayed number shrinks in number of chars. However clearing and redrawing a 20x4 screen can take long enough that it flashes annoyingly. The easiest remedy is to increase the data rate. A direct hook up instead of a I2C backpack can increase transfer rate and reduce the flicker. Somebody needs to write a library to manage the screen to avoid having to clear and redraw the whole thing, I can't be bothered to do so though, I'll just will use a more modern OLED screen next time. ¯\_(ツ)_/¯

There is still a TERRIBLE bug I cannot track down, it only happens when other people are looking at it! The LCD will become completely corrupted. It seems to happen more often in a car where there is a lot of vibration. The only way to fix it is to reset the box. In professional product design for anything that will be in a vibration rich environment, tests are done using a machine like this.

SD card

For a microSD adapter slot, you can solder directly to a generic microSD->SD adapter.

ARDUINO SD LIBRARY WARNING. A frustrating “bug” i ran into with the default Arduino library is that it only accepts TEN character filenames. An example is “data.txt” which is 8 characters! I recommend using a different library. I don’t think you need a file name extension as long as you open it with a text editor, example “datasheet” will make a file with no extension which is ok.

Potentiometer Control

The Potentiometer changes screens. The code includes historesis to prevent jittering between screens.

This device has proven useful in getting quick measurements of The Phoenix's performance before we began tearing it down and refurbishing it. Most prominently doing coast-down tests with the GPS and testing the Array output power. Measuring 964 W/m2 one day gives us 760 W from the array, we can extrapolate the max output power if the day was 1050 W/m2, 828W max from the array

Other Notes

Originally the box Is supposed to mounted on the hood of a car, possibly with a suction cup. The box is water resistant in case it rains.

Internet of Things Support

Originally, The box was to have internet connectivity and serve its data to a MySQL server. I worked with both WIFI and Ethernet modules but ran I into issues with both.

I tried to use a stock ESP8266. After a week of work, I determined the AT commands were too buggy to be reliable. For example sending a basic AT? read command would CHANGE some seemingly unrelated setting. Other people confirmed to have these types of problems, the ESP8266 is good for a quick project but it needs better firmware. Updates may be out by now, and more custom firmware exist everyday.

I tried to use my Ethernet and had luck! it was reliable to any type of data stream interruption. However my particular Arduino Ethernet shield knockoff must of had its reset pin zapped! Neither high or low pulses reset the device, only by touching the reset pin with my finger would the Ethernet shield reset. :)

The project would have used the basic protocall, Telnet, the standard for shuttling ascii over internet since 1973.

Power Supply

The box is powered externally through the USB port. I find this is the most compatible method for any situation. A wall charger, PC USB port, Car charger or USB backup battery can all be used to power the device.