ESP8266 WiFi indicator with WS2812 LED

I had some ESP8266 modules and WS2812 LEDs laying around, that were only collecting dust, so I decided to make a little, maybe useless, project.

It simply shows the average WiFi RSSI by scanning for networks continuously, adding up the RSSIs and dividing them by the number of found networks. Since I’ve used the Adafruit WS2812 library together with the ESP8266 libs for Arduino, I had a prebuilt function, that can be fed with 0-255 to set a color. As the function name ‘Wheel();’ already states, it cycles through the colors in a circle, so we only need around half of that range. After some tests, I found that adding 100 and multiplying the value by 2.2 works quite ok.

So, you say, this is quite boring for such a powerful microcontroller? You’re right! I decided to add an interrupt to the ‘flash’-button, that is on the dev-board and can be used as a normal GPIO-button. Once pressed, the LED will blink as often as many networks have been found. Afterwards it will show the color for the strongest and then for the weakest signal. The purpose of the serial output was actually just for debugging, but I left it there, so you I can still check the values at any time.

After testing it at home, I finally went out in the wild to test it at a place with a huge amount of networks (60+). I figured out, while the LED was blinking, the controller got reset after ~17 blinks. This was done by the watchdog, that couldn’t be turned off at that time (maybe the lib got an update now). So I decided to feed the not-so-cute-litte dog every blink with ‘ESP.wdtFeed();’.

Here is an example video:

And of course the code:

 

DIY Arduino APRS Tracker

Since I wanted to have an APRS tracker, that I can use with any radio, but didn’t want to spend a lot of money, I found a project called MicroModem. It uses a R2R resistor ladder for audio output and if you want to add a display, it can even decode AFSK1200 packets. I took the existing APRS library that was developed for this board.

Since I used GPS for another AVR project already, I included the GPS library from Adafruit again.

After putting everything together on a breadboard, i did a first test and realized, that the audio was somehow interrupted by something. When commenting out the GPS part of the code, everything worked perfectly… except having a hard coded position. So it was time to hook up the oscilloscope to the audio out pin and the GPS RX pin.

photo_2016-09-09_15-39-59

yellow: audio | blue: gps serial data

You can see, that the parser for the received NMEA messages is clearly slowing down the audio, when a messaged comes it, even without using interrupts for parsing. The simpliest solution that came to my mind, was to disable the serial port right before TX function and reactivate again afterwards. This only worked for the first message, but if a second message came in before the transmission stopped, it was interrupted there too. Luckily libAPRS uses an LED, that indicates transmission. So i simply wait for the LED to turn of until I activate the serial port again to avoid delay functions.

yellow: audio | blue: gps serial data

yellow: audio | blue: gps serial data

Finally it was working, so I decided to make an Arduino shield for testing it portably, but I want to build a standalone board soon.

img_20160909_151944

I added a jumper to pin 8 to switch between two different APRS SSIDs & symbols for portable and mobile (car) usage. The pinout of the header pins from top to bottom was intended to be audio out, gnd, gnd, PTT, Vin, but sadly my TYT TH-9800 doesn’t provide enough current to power the whole board, so I removed the Vin connection again and power the board over USB, but left the header as it is, in case I need it in the future. The upper left ‘reset’ button was rewired to pin 2 in case i need that too.

I actually wanted to put locationUpdate(); in the ISR, but it doesn’t seem to work inside any ISR, even if I use a timer with a lower priority or disable interrupts while transmitting. However instead of using a delay function or a counter to schedule the transmission, i decided to use the most accurate way – GPS time. Every 30th second of a minute (or any other chosen value) it will transmit audio.

I want to mention, that i slightly modified libAPRS to stop the RX interrupts if the ADC gets some floating values. Just comment out the following line in AFSK.cpp: AFSK_adc_isr(AFSK_modem, ((int16_t)((ADC) >> 2) – 128));

UPDATE: 4 RTL-SDRs with 8.4 MHz bandwidth in gqrx

After I managed to combine 2 dongles for an FFT in gnuradio, I wanted to pipe the output to gqrx and add 2 more dongles to the flowgraph. Due to the cut-off at the edges of each dongle, we get 8.4 MHz bandwidth, but since the rational resampler only supports integer values, our sample rate is 4*2.4e6 = 9.6. Use interpolation=35 and decimation=10 for the true sample rate of 8.4 MHz. I updated the 8.4 MHz flowgraph at the bottom of the page.

You can even listen to analog signals, that are at the overlapping areas!

8.4 MHz sample rate:

8.4_rtlsdr

9.6 MHz sample rate (8.4 MHz bandwidth) with old flowgraph:

9.6_rtlsdr

At first you need to create a fifo file with this command: mkfifo /tmp/fifo_gqrx

Use this settings in gqrx (change ‘freq’ to the value of center_freq in grc): file=/tmp/fifo_gqrx,freq=100e6,rate=9.6e6,repeat=false,throttle=false

Also make sure, that you set the center frequency in gqrx.

You might have to open gqrx some times if it crashes on startup, but it will work!

Here are the grc-files:

4.4 MHz (4.8 MHz sample rate)

8.4 MHz (8.4 MHz sample rate)

Atmega328 Thermo-/Hygrometer mit LCD

Nachdem die Bauteile herumgelegen sind, habe ich mich dazu entschlossen ein Thermo-/Hygrometer mit einem Atmega328 und Nokia 5110 LCD zu bauen, das mir auch Durchschnitts-, Minimal- und Maximalwerte anzeigen soll.

Der Jumper links oben ist zum ein-/ausschalten; der rechts unter der oberen Steckleiste ist für die Hintergrundbeleuchtung. Um die Beleuchtung nur kurzzeitig zu betätigen, habe ich nachträglich noch einen Taster angebracht, der nur dann etwas bewirkt, wenn der Jumper offen ist.

Der Sensor ist ein AM2302 (auch als DHT22 zu finden). Am Datenpin hängt ein 1k Pull-Up Widerstand.

Auf der Rückseite ist ein AM1117-3.3 angebracht, um das ganze mit einer 9V Batterie speisen zu können.

Der Code kann leicht angepasst werden, um statt der Durchschnittswerte z.B. die Minimalwerte anzeigen zu lassen. Für die Durchschnittswerte wird ein Zähler mit Datentyp ‘unsigned long’ verwendet, wodurch das Programm über knappe 680 Jahre den Durchschnitt berechnen kann, wenn alle 5 Sekunden neue Werte kommen ;)

Verwendet wurden folgende Libraries:

https://github.com/adafruit/DHT-sensor-library

https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library

 

Iambic Keyer Morse-Taste mit ATtiny85

Nachdem ich eine Morsetaste bauen wollte, habe ich mir überlegt, wie ich das am einfachsten anstelle und dazu einfach eine alte Maus genommen. Als Microcontroller wird ein ATtiny85 verwendet und der Akku ist ein normaler Li-Ionen Akku.

Um mögliche Probleme zu vermeiden, habe ich von der Platine der Maus alle Teile abgelötet und anstelle des Sensors den μController angebracht.

Durch drücken der linken Maustaste wird repetitiv der Punkt ausgegeben und bei der Rechten der Strich. Mit der mittleren Maustaste kann man die Geschwindigkeit ändern, allerdings (noch) nicht über das Mausrad. Es gibt hier 8 Modi.

Der ausgegebene Ton ist ein Rechteckssignal, das durch HIGH-/LOW-Schalten des Pins erzeugt wird.

 

cw_keyer Untitled Sketch_Steckplatine

Gewitter 7. August 2013

Am Heimweg vom Dienst wieder einmal auf Parkplatzsuche gewesen, wobei ein Gewitter aufkam und ich die Suche ziemlich schnell aufgegeben habe; Location ist der altbekannte Leopoldsberg.

hier gehts zur großen Galerie: thunderstorm aug. 2013