Showing only posts from category: MicroPython

MicroPython

Read more

#MicroPython: Camera stabilisation application!


To continue the series of posts "connecting sensors to MicroPython", this article is about the MPU6055 (you can use also the MPU9255, I am still waiting for the Chinese sensor package) and the WiPy 3.0. Combining the IMU sensor with the WiPy and two micro servos 9g, it is possible to stabilize a camera (tilt/rotate).

To calculate the compensation needed for the stabilisation, I added the umatrix, quaternion and ulinalg libraries to the project to make matrix multiplication and quaternion to Euler conversion. The ahrs library from Madgwick fusions the data of the accelerometer, gyroscope (and magnetometer, only with MPU9255) and allows to calculate the rotation of the IMU in quaternion coordinates. I rewrote (most of) the libraries to be compatible with MicroPython.


Wemos micropython min

Read more

#Tutorial: Getting started with MicroPython: Sensors - Part 1!


One of the most visited articles on my blog is the Getting started with MicroPython! tutorial. If you still don't know what is MicroPython and you want to start programming microcontroller boards (ESP32, ESP8266 etc.) using a small version of Python 3, you should look at that article. Don't expect to use machine learning or/and other big libraries (the available RAM and microcontroller performance is far away for that aim), but you can do some projects like these:

Wipy2.0 Xmas-lights

Read more

#Micropython: Merry Xmas & Happy New Year!


It has been a while since my last post! Sorry, I was a little bit busy and then I was on a business trip in Melbourne for the CDC2017 and then I had a week holiday in Bangkok. I will be posting some photos on the next days!

It's been a year now since I started this blog. It's a hard job to maintain it up-to-date but I still have fun writing and coding for this purpose! So let us start!


The first video that I published a year ago was using the Wipy2.0 and a WS2812b led strip for some Christmas lights (click here). Now, this time I bought a WS2812b panel (100 bits or 10x10 pixels -or leds- see fig. 1) and as we have/had christmas again, so I wrote some code for this panel to make again some Xmas lights! :).

WiPy & Geolocalization

Read more

#MicroPython & #WiPy2.0: Geolocation using WLAN


I was surfing the services that Google offers, I found the Geolocation API. As Google describes the API: it returns a location and accuracy radius based on information about cell towers and WiFi nodes that the mobile client can detect. As I was writing the last post using MicroPython, I thought the WiPy 2.0 could be a nice "mobile client".

To use the API you need to get an API key from Google. As a standard user of the API, you get:

  • 2,500 free requests per day, and
  • 50 requests per second, per user.

I thought I could play with it to test the accuracy of the geolocation.

Python Code: https://github.com/lemariva/uPyGeo

If you’re not up to speed with MicroPython, Wipy see earlier articles in here.

Wemos & Amazon Echo

Read more

#MicroPython: WeMos and Amazon Echo (Alexa) - Switching LED Colors!


I don’t have any Belkin WeMo system or Philips Hue light bulbs. However, I have two ESP32 running MicroPython (see my last article), and a W2812b LED strip, and I thought I should be able to say, "Echo/Alexa, turn on the kitchen light" or "Echo/Alexa, turn on the blue light" and It should work with this setup.

And... it works as you can see in this video!

If you are interesting in only using the code, then click here. Otherwise, you can read the complete story... ;)

Python Code: https://github.com/lemariva/uPyEcho

If you’re not up to speed with MicroPython, Wipy see earlier articles in here.

Wipy2.0 Vu-Meter

Read more

#MicroPython: Vu meter using WS2812B and SPW2430


Hi everyone,

As soon as I saw the WS2812B led strip, I thought: doing a vu-meter with these LEDs would be a nice thing!.

I was looking for economical MEMS microphones with board (I didn't want to solder a board). I found two options: SPH0645LM4H and SPW2430.

The SPH0645LM4H uses an I2S interface and the SPW2430 has an analog output. The second board (SPW2430) has two outputs: AC pin which has a capacitor in series to eliminate the DC output of the IC, and the output of the IC (DC pin).

Python Code: https://goo.gl/eWTCUl

Weather Wipy2.0

Read more

#MicroPython: Weather Report using NEO-M8N


Hi!

I had two busy months, I've been writting my PhD-Thesis, and another publication and yeap... sorry! I forgot to update the blog!

Python Code: https://goo.gl/v7NCkj

Three weeks ago, I received a Ublox NEO-M8N GPS and I tested it with the code that I had. I said it should work, but as you know it always needs some modifications! The NEO-M8N supports GLONASS and GPS, so the $GP changes to $GN, e.g. $GPGGA (GPS) > $GNGGA (GPS+GLONASS).

The following changes were added:

# lines 604-606:
if self.gps_segments[0][2:] in self.supported_sentences:
    # parse the Sentence Based on the message type, return True if parse is clean                        
    if self.supported_sentences[self.gps_segments[0][2:]](self): 

...

# line 798:
# All the currently supported NMEA sentences
supported_sentences = {'RMC': gprmc, 'GGA': gpgga, 'VTG': gpvtg, 'GSA': gpgsa, 'GSV': gpgsv, 'GLL': gpgll} # GPS + GLONASS

I bought it from ebay, here the link:

NEO-M8N Ublox NEO-M8N x 1
The cold start needs a bit more time (estimated), but the module has a battery, then the warm start is much more faster (under 10 second). Please note that the VCC and GND pins are switched w.r.t. the NEO-6M board!

Gearbest tv box promotion promotion

Wipy 2.0 ST7735S Ublox

Read more

#MicroPython: Weather Report Box


Hi again!... First of all:

Happy Chinese New Year!!!

I've just uploaded some code for the Wipy 2.0. I wanted to write some python. That was why I took the Wipy 2.0 and programmed something like a weather report box: In this project the Wipy 2.0 reads the GPS coordinates via UART, then makes a web get request using the API of openweathermap, and after that the results are displayed on a LCD.

If you like this, please leave a comment, share and/or like! It would be very much appreciated!

Python Code: https://goo.gl/v7NCkj