Sunday, July 21, 2019

UPDATE: Solar Powered Weather Station - 3. nRF52 Programming Progress & SES Config

nRF52 Programming Progress

After getting some good advice from members of EEVblog/Nordic/reddit and burning a bit of time with my crude nRF52 dev kit I have managed to make some good progress in terms of programming the nRF52832. So here is what I have completed thus far and what I still have left to do:

Task Complete? Notes
LED Blinky Yes Pin config is quite simple
LED PWM Yes Pin config is a bit more complex here
UART Comms Yes As always make sure your logic voltage levels are compatible
ADC Read no Will be used to monitor voltage of supercapacitor
BME280 Comms Yes I2C/TWI up and running :D
SGP30 Comms ~ Basic function working, need to add humidity compensaiton
BLE Comms ~ Have done some basic tests with making a BLE peripheral

Reading data from BME280 (Temperature, Pressure, & Humidity)

Reading data from SGP30 (tVOC & eqC02)

SGP30 testing in Hong Kong

Segger Embedded Studio (SES) Configuration

Also I have found out that setting up a completely new nRF52 projects in SES is not so simple, your best bet is to copy and modify an example project that resembles what you want to achieve. Here & here are a couple of suggestions on how to create a new nRF52 project in SES, also below is my summary that has worked well so far:
  1. Download the nRF52 SDK and place it not so deep in the main drive: 
    • C:\NORDIC\nRF5_SDK_15.2.0
  2. Make up a working directory near same folder, again this can't be too deep into your main drive: 
    • C:\NORDIC\_WorkDir
  3. In the working directory create a project folder, for example when I was testing the PWM function I worked out of:
    • C:\NORDIC\_WorkDir\11_2019May21_PWM-test_v12a
  4. In the examples folder of the SDK find a project that closely resembles what you want to achieve, then copy the following files into your project folder:
    • C:\NORDIC\nRF5_SDK_15.2.0\examples\peripheral\pwm_driver\pca10040\blank\ses\pwm_driver_pca10040.emProject
    • C:\NORDIC\nRF5_SDK_15.2.0\examples\peripheral\pwm_driver\pca10040\blank\ses\flash_placement.xml
    • C:\NORDIC\nRF5_SDK_15.2.0\examples\peripheral\pwm_driver\main.c
    • C:\NORDIC\nRF5_SDK_15.2.0\examples\peripheral\pwm_driver\pca10040\blank\config\sdk_config.h
  5. Now your project folder should look something like:
    • C:\NORDIC\_WorkDir\11_2019May21_PWM-test_v12a\pwm_driver_pca10040.emProject
    • C:\NORDIC\_WorkDir\11_2019May21_PWM-test_v12a\flash_placement.xml
    • C:\NORDIC\_WorkDir\11_2019May21_PWM-test_v12a\main.c
    • C:\NORDIC\_WorkDir\11_2019May21_PWM-test_v12a\sdk_config.h
  6. Rename the SES project in explorer: "pwm_driver_pca10040.emProject" to "PWM-test.emProject"
  7. Open up the renamed SES project in a txt editor and change the following:
    • "<solution Name="pwm_driver_pca10040" target="8" version="2">" to "<solution Name="PWM-test" target="8" version="2">"
    • "<project Name="pwm_driver_pca10040">" to "<project Name="PWM-test">"
    • If using a custom board make sure to state this in "c_preprocessor_definitions": "c_preprocessor_definitions="BOARD_PCA10040;" to "c_preprocessor_definitions="BOARD_CUSTOM;"
    • Using the find & replace function of your txt editor change the path depth of all mentioned files/libraries/directories so that they agree with your nRF52 SDK directory: "../../../../../../" to "../../nRF5_SDK_15.2.0/"
    • Update the directory of "main.c": "<file file_name="../../../main.c" />" to "<file file_name="main.c" />"
    • Update the directory of "sdk_config.h": "<file file_name="../config/sdk_config.h" />" to "<file file_name="sdk_config.h" />"
    • Lastly update "c_user_include_directories" so that it looks at the correct directory for "sdk_config.h": "c_user_include_directories="../../../config;" to "c_user_include_directories=".;"
  8. Try opening up the updated project in SES and hitting the compile button (F7), given that everything has been done correctly the project should compile without any issues

Wednesday, May 1, 2019

TRAVEL: Solar Around The World

Here I show some cool solar related stuff that we found on our travels


Tokyo - Solar powered road sign

Tokyo - Solar powered road cone

Tokyo - Solar powered traffic light

Tokyo - Solar powered street light

Tokyo - Solar powered info station

Tokyo - Solar powered trinket (kinda moves like a fish)

Nikko - Solar powered road light

Kyoto - Solar powered info station

Kyoto - Solar powered path lamp

Kyoto - Solar powered toilet something

Kyoto - Solar powered taxi station light

Kyoto - Solar powered path light

Mount Koya - Solar powered thermometer

Outside Mount Koya - Solar panels on a hill

Outside Mount Koya - Solar panels on a field

Onomichi - Solar powered road light (seen better days)

Onomichi - Solar powered bike path light

Onomichi - Solar panels on a field

Onomichi - Solar panels on roofs

Onomichi - Solar panels held with scaffolding

Onomichi - Solar powered road light

Onomichi - Solar powered traffic light

Hiroshima - Solar powered street lamp

Hong Kong

Hong Kong - Solar powered mosquito zapper

Hong Kong - Solar powered mosquito zapper

Hong Kong - Solar panel on Ngong Ping 360 cable car (see top)

Hong Kong - Solar powered road light


 Central - Solar panels on roofs

Arad - Solar powered bus stop display

Arad - Solar panels on roof

Be'er Sheva - Solar powered bus stop display (and a bunch of ants digging up dirt...)

Be'er Sheva - Solar powered utility box

Jerusalem - Solar powered radio speaker

Tel Aviv - Solar powered something on a lifeguard building

 Tel Aviv - Solar powered bike light

Tel Aviv - Solar powered wireless phone charger


Kiev - Solar powered bench ;^)

Kiev - Solar powered rubbish bin

Kharkiv - Solar powered bike hire stand


Krakow - Solar powered hire bike

Krakow - Solar powered car park ticket machine


Venezia - Solar powered data gathering?

Venezia - Solar panel on a boat

Venezia - Solar powered art piece (lighting)

Florence - Solar powered road light

Florence - Solar powered hire bike (see basket)

Florence - Solar powered car park ticket machine

Rome - Solar powered pedestrian crossing lights (near Vatican City)

Rome - Solar powered car park ticket machine

Rome - Solar powered traffic lights


Saint Petersburg - Solar powered radio bus

Saint Petersburg - Solar powered bike hire stand

Altai - Solar powered camping hut (no power or cellphone reception in region)

Altai - Solar powered street lamps

Altai - Solar powered street lamps, now with wind power :D

Tomsk - Solar panel beside window (large window, 2nd from bottom)