Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts

Thursday, July 21, 2016

Basic IR remote control for arduino train

Got inspired a while ago and added IR remote support to the train set. Lights can be turned on/off and the train can be fully controlled with the Play/Stop/Pause/FF/RW and Prev/Next track buttons.

  • Play will start the train slowly to a set speed
  • Stop will engage the brakes and stop the train
  • Pause will slowly stop the train
  • FF & RW controls the speed
  • Prev/Next will change train direction (when stopped)
  • Number buttons (1-3) toggles building lights
The remote itself is a random Sony CD player remote I had laying around at home.
A quick video below:


The code is available on github

Thursday, July 02, 2015

More progress with wireless sauna temperature thingy

My original plan was to use a MSP430 based launchpad (cheap!) instead of an Arduino for the sensor part. I had major troubles getting any data to go trough so decided to first try with identical platforms and libraries. That worked so at least I knew that my NRF modules where ok.

I started to look into using the MSP430 based launchpad now, first I had some weird trouble that a simple test worked, then suddenly it didn't and sometimes just a part of the data got trough to the receiver. Digging into the enrf24 and RF24 libraries a bit more I found the reason (enrf24 uses dynamic payload (only!) by default, RF24 doesn't) and connecting my MAX6675 thermocouple amp also made the sending not work if I used a particular pin (I think it was 2.3?) on the launchpad, moving that to 1.4 fixed that issue.

Now it works!


I'm now powering the sensor with a USB power bank and that just wastes energy so next is to make everything as power efficient as I can and power it using a 3V coin-cell.

That should be possible as I can sleep most of the time as the temperature does not change that fast and often anyway.

Perhaps something like:
  • Average temperature, say for 3 samples, does not change much: Sleep 30 seconds
  • If temperature starts to change, sleep less, say 10 seconds
  • If temperature changes rapidly, sleep 5 seconds
  • Send temperature only when temperature changes
Comments ?

Wednesday, June 24, 2015

Arduino based wireless sauna temperature sensor and display

I've been working on this on-and-off (more off than on..) for a couple of years now. The plan is to create a summercottage "automation" system, simply just a bunch of variouse sensors sending information to a base station with a display and perhaps some logging.

I first started with a MSP430 as the sensor board and a Raspberry Pi as the base station, but I never to get NRF24L01 TX/RX to work and forgot all about if again for a while.

Started thinking about it some weeks ago again and decided to try using the exact same NRF24L01 library and exactly the same platform and if that didn't work then either or both of my NRF24L01 boards must be broken.

After fiddling with the various settings I finally got them to talk, everything needs to match exactly or nothing will work.

At midsummer I got to try it out with a proper temperature sensor attached (and inside the sauna) the result can be seen in the video below:


Sunday, November 02, 2014

Late night soldering leads to pain

I'll just quickly solder the connectors... right. Not the best of ideas after a day of moving and sauna.

Can you spot the tiny little mistake in this picture ?

There is something not quite right in this

Wednesday, October 15, 2014

Some Kotibussi progress and backend thoughts

The first Kotibussi demo used the very basic ENC28J60 Ethernet controller based ethernet shield. That means the TCP/IP stack had to be run on the Arduino itself, taking up a lot of precious memory. I'm moving it now over to a WizNet W5200 based shield that takes care of the TCP/IP stack in hardware for me, makes a ton of difference in the amount of memory I now have to play with.

Some ideas are to have an integrated RTC and some way to configure the device without re-flashing, aka some control buttons and menu system, the added memory helps a ton in this.

And the backend. Luckily there is a standard for M2M transport data, Siri, unfortunately it is not well suited for low-bandwidth/low-speed/low-memory devices as it is XML based and extremely verbose. And it is also pull based so I would need to poll the data and that is just stupid.

So a Siri2MQTT gateway needs to be created, some minor progress in there, just a skeleton for now but  getting there.

Then there is the minor issue that Turku does not provide any data yet (no timetable, they hope to get it open in 2015), luckily some cities in Finland aren't that behind in progress so I will use Tampere Public Transport SIRI service for now.


Tuesday, September 30, 2014

KotiBussi, 3 place and shared challenge price

Related to the previous post in Finnish. It is a description of my entry to the regional app4finland competition, a simple home Buss information display concept.

The idea is to have realtime display of buss(es) on a simple display so you know when to run to the buss-stop. The idea came when I started to think about what is the most annoying thing with using public transport here in my home city of Turku. I personally hate to stand at the buss-stop and wonder where the hell is it, or did it go already ? And at this time there are just a handfull of stops with information displays (that don't even display correct information, last time I needed to take a local buss).

Yes, you can get that from an app or web site. But not everyone has a smartphone. And how much time does it take to first dig the from somewhere, start the app, wait for it to load, then find the particular buss/buss-stop, etc (but the backend could be used for a mobile app, so that is not ruled out)

And this could be used not only at home, but for example at the work place, stores and hospitals. Well, you get the picture.

And instead of having the device polling the information, it uses MQTT to passively listen for changes and that means it does not need much of processing power, a basic arduino is just fine.

The backend part is still to be written, basically a SIRI to MQTT gateway.

Oh, the important part, I won! Third place in one category and shared winner of a specific challenge (transport).

Thursday, September 25, 2014

Kotibussi, Apps4Finland demo konsepti



Kotibussi, Apps4Finland innosta sarjaan demokonseptilaite, josta näkee nopeasti seuraavan bussin tiedot kotoa, ilman tarvetta puhelimelle tai tietokoneelle.

Demolaitte on toteutettu Arduino, Ethernet shieldillä ja LCD näyttöllä.

Arduinossa pyörii MQTT client joka kuuntelee MQTT palvelimella olevia pysäkkitietoja ja päivittää realiajassa tiedot tulevasta bussista, sekä sitä seuraavasta.

Oikeassa toteutuksessa MQTT palvelimelle tiedot haettaisiin reaaliaikaisesta SIRI syötteestä, joka Turun seudulla on tulossa 2015.



Näin bussin käyttäjän ei tarvitse juosta pysäkille seisomaan turhan takia vaan voi rauhassa katsoa näytötä ehtiikö vaikka vielä juomaan aamukahvin loppuun vai ei.

BS: Pysäkin numero
L: Linjanumero
N: Nyt tuleva bussin arvioitu min:sec saapumisaika
S: Seuraavan bussin arvioitu min:sec saapumisaika


Demo ohjelman koodi löytyy github:sta.

Friday, October 28, 2011

More Arduino toys

I ordered some stuff from DealExtreme to play with. An Ethernet Shield and a very tiny bluetooth transceiver module. It's going to be a challenge to solder something to it :)

Ethernet Shield and Bluetooth module
It's the cheaper version of the network shield, so no TCP/IP stack included on any chip, just an Ethernet over SPI chip (the ENC28J60), but still an easy to use chip over SPI from the Arduino. And of course there exists a library for it so using it is very easy and there is nice example code available, I made a quick test just to check that the shield works using the DHCP example.

The bluetooth module should be extremely easy to use, after somehow soldering some wires to the tiny thing. I'll let you know how it goes.

Sunday, March 20, 2011

Arduino and GPS

I found a a cheap GPS module from a finnish electronics dealer, Partco, for only 10€. It's a bit old, from 2004 but whatever, it's cheap :) It's a Fastrax uPatch100 with a Sony chipset (CXA3355 and CXD2956). There are four different models, but the only one available is the -C9 with CMOS level serial output. Acctually that is perfect as the Arduino as you can plug it directly into the arduino (well, almost, TX can, RX needs a level conversion as the Arduino I/O pins are 5v).

I did it :)
The module outputs plain NMEA so it's easy to parse. You can also talk to it and set different parameters. Datasheets are available on the net, just google for uPatch100 and you should find them.

Anyway, I'm not very experienced with electronics but I've done my fair share of soldering, but mainly easy stuff like making my own RCA or RS-232 cables. Or easy "high" pitch breadboard.

The pitch of the device was a bit scary at first, but I was able to solder a ribbon cable just fine after some careful soldering.

I used a long flat cable and a IDC for easy attaching for any GPS project. I didn't have a female IDC connector so it cut one from an old motherboard serial port adapter and soldered that to a breadboard. And on the breadboard a pin strip for easy plugging to a solderless breadboard.
I made a very simple arduino sketch to read the serial TXD0 port from the module and output it to the serial port. I used the softserial library and first thought it was the reason for the problem I had. Only the first couple of NMEA messages came trough succesfully and then output stopped. The datasheet mentions for the RS-232 level module that "RXD0 line must be electrically connected in the uPatch100-Rx versions even if it is not used!"
My module was not the -Rx version but I connected RXD0 to ground and that fixed my problems. Clear NMEA messages startet coming!


Next is to make something fun with all this :)

Sunday, March 13, 2011

Arduino and a 16x1 LCD (Displaytech 161A)

Got myself an Arduino last year, unfortunately I didn't have time to get into it that much yet, but I started playing with my LCD display today. You would imagine that the LiquidCrystal library would take care of the 16x1 display but no, it needs a bit on tweaking as you have to address it like a 8x2 display.
Below is my very simple serial monitor testing code. It will just take whatever comes in from the serial line and write it to the display and wrap to the beginning every 16 character.

/* Testing code for using a 16x1 LCD display with Arduino LiquidCrystal library.

   LCD used is a Displaytech 161A 16x1 display.

  See this page for an explanation how it works (161A is a "Type-1"):
  http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html
*/

#include 

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int c=0;
int r=0;

void setup(){
  lcd.begin(8, 2);
  Serial.begin(9600);
  lcd.clear();
  lcd.cursor();
}

void loop()
{
  int i=0;
  if (Serial.available()) {
    while (Serial.available() > 0) {
      i=Serial.read();
      if (i==-1)
        break; 
      lcd.write(i);
      c++;
      if (c==8) {
       r=(r==1 ? 0 : 1);
       c=0;
       lcd.setCursor(c,r);
      }
      Serial.print(c);
      Serial.print("\t");
      Serial.print(r);
      Serial.println("
      ");
    }
  }
}