Microsquirt ECU with bluetooth connectivity

We just helped one of our members with his motorcycle. The plan is to update an older Triumph with a Microsquirt engine control unit to make the bike a bit more adjustable and debuggable. Triumph has designed a pretty complex system with several MAP sensors and two lambdas and such. Now the system will be a lot simpler, as the bike will run only with the bare minimum amount of sensors.

Microsquirt is a small version of Megasquirt, so it suits  motorcycles perfectly. However, during the installation we came to the conclusion that it would be nice if the adjustments for the ECU wouldn’t need a wired serial link. The serial link is already wired on the off-the-shelf wiring harness but having a cable for the serial link with its own connector makes the ECU box harder to hide and might cause some reliability issues later, as the connector is only needed in the adjustment phase, but it will be sitting there getting water and grime in it for the rest of the time.

So, we decided to add Bluetooth connectivity to this ECU unit. The modification was easy enough, but we had to combine several sources of information to succeed, so we decided to write our own instructions here, if someone else would like to do the same. Our main resource was https://www.youtube.com/watch?v=Gk5p7T2CyGE

So, first you need:

  • Microsquirt ECU
  • HC-05/HC-06 Bluetooth module with a breakout board
  • Arduino
  • jumper wires
  • a breadboard
  • soldering stuff + hot glue + shrink tubes + zip ties etc.

Basically, the procedure is really easy. First, we must get the Bluetooth module into AT mode, then change the baud rate, rename the module’s Bluetooth device name and set a PIN. This is also covered in this instructable: https://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/ After the module is set, just solder it to the Microsquirt and you’re done.

First, we set the module to the AT mode. To achieve this, the key pin on the module has to be set up while the module boots. In our case, the module was in a plastic shrink wrap, so it was impossible to make any contact with the key pin. So, locate the key pin on the module, and cut a hole in the wrapping. The key pin is the first pin on the left side of the module, if looking the module from the antenna end with antenna facing upwards.

Next, connect the module to the breadboard, and use jumper wires to give the device. Connect Arduino 3.V and ground to the corresponding pins of the BT module. Connect serial pins so that RX pin of the module goes to pin 11 of the Arduino and TX pin of the module to the pin 10 on the Arduino.

Our setup

Add one jumper wire to the strip that is connected to the 5 volt pin on the Arduino. Now, when you connect the Arduino to the computer so it boots up, simultaneously touch with this wire the exposed key pin and hold. If the module starts blinking in two second cycle, congratulations, you are now in the AT mode.

Next, we need a serial software on the Arduino. Use this modified version of the Serial example:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
    Serial.begin(9600);
    pinMode(9,OUTPUT); digitalWrite(9,HIGH);
    Serial.println("Enter AT commands:");
    mySerial.begin(38400);
}
void loop()
{
    if (mySerial.available())
        Serial.write(mySerial.read());

    if (Serial.available())
        mySerial.write(Serial.read());
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Using Arduino IDE, make sure your board is in Arduino Uno mode, upload the code, boot the Arduino and make sure that the BT module is still in the AT mode. Next, back in the Arduino IDE, use the serial monitor. In the serial monitor window, set baud rate to 38400 baud, and the linefeed to “Both NL & CR”. Now, pressing enter, should see “Enter AT commands:” prompt.

Next, write “AT” to the prompt, and the BT module should answer with “OK”. NExt, issue AT+NAME=<yourdevicename followed with an enter and AT+PIN=<yourpincode> <ENTER> to set the BT device name and the PIN. Both commands should give an OK reply. Then, set the device baud rate to match the Microsquirt. So, issue a command AT+BAUD=19200 <ENTER>. It also should return an OK. Now you’re done with the configuration part.

Next, open up the Microsquirt box. It should be just 8 Philips screws, four on the both sides.

The Microsquirt without a box

Locate the pinheader and the two vias (round holes on the circuit board) just next to the controller in the middle of the board. The pinheader can be used to power up the module, so solder a jumper wire with a suitable end to go with the BT module breakout header to the pins 2 and 6. You can see number 1 printed on the circuit board, so that’s the pin one, one just next to that is 2, the ground pin. Pin number 6 is the last one, so it’s in the same row as the ground pin, but on the other end. That’s where you solder the VCC wire.

Next, the two vias are a bit tricky. You should take two jumper wires and expose their ends, apply a bit of solder and put them on the correct vias and use your solder tip to make a connection. Use the photo below to locate the correct position of the wires.

The location of the RX and TX vias on the PCB

Now it’s a good moment to test if you can connect to the module if the Microsquirt is powered on.

Connections made.

Last, just apply hot glue over the soldering points, put some fresh shrink wrapping over the module and use zip ties to fasten the wires to the connector feet. A good place to put the module is under the big Microsquirt connector, just other side of the connector from where you made the solder points. On that side, the module can be easily glued fast and the possibility of accidental connections is minimized. Just put the cover back on and screw it tight. Now you are done, enjoy!

Raspberry opPi

Our hacklab applied for a grant from FUUG foundation (Finnish Unix Users Group) in their “Linux for homes” themed grant proposal round. Our proposition was to use Raspberry Pi single board computers as a solution for Covid-19 enforced remote learning.

We had noticed that even our members with school children struggled with providing robust-enough devices to their kids to fulfill the requirements of remote learning. Tablets and phones are common enough, but their compliance to the software requirements is sketchy at best and there isn’t usually a good display or keyboard/mouse combinations available for those. Families didn’t have powerful laptops to spare, using a work laptop of a parent can pose its own problems, you wouldn’t like to have a laptop break. So, enter Raspberry Pi, a cheap and robust single board computer. As a cherry on the top, it runs Linux, a free and open-source operating system conceived originally by a Finnish guy.

Raspberry Pi
Raspberry Pi with a power supply

This cute box has a bill of materials in the ballpark of 80 euros and you just need to add a memory card with the operating system and the additional software, a TV or a display with an HDMI connection, basic keyboard and a mouse and you have basically a desktop computer running an open source operating system. So, compared to a tablet or a phone, it’s a computer and it’s much more robust and cheaper than a laptop. However, the real treat is the open source software which could hopefully steer schools towards open source solutions. Most commercial products come with some kind of strings attached, so openness and connectivity of Raspberry Pi hardware powered with an open-source Linux OS is always a plus. Furthermore, it also brings “Linux to the homes”, hopefully familiarizing our next generation of diginatives with ever-so-popular choice of operating system of smart phones, mining equipment, cloud servers and so on.

Our proposition was accepted and the project is already on the way. The Finnish announcement can be read here: https://fuug.fi/2020/etaoppimiseen-vauhtia-linuxista-ja-raspberry-pista/ We have acquired a first batch of devices and are planning to deploy them to a secondary upper school of Kangasala who kindly have promised to help us to gain some insights how RasPis are accepted in the school environment and what would be the best software distribution to go with in that setting.

You can follow the project in Instagram using the hashtag #raspberryoppi

Dahlgren 300 modernisointi, osa 1

Dahlgren 300 system, joka koostuu PC:stä, ohjaustietokoneesta ja kaiverrinpöydästä (lähde: http://www.e-engraving.com/machines/dahlgren/Dahlgren_System_300.htm)

Hankimme labille 2017 lopulla Dahlgren System 300 -kaivertimen. Kyseessä on siis 1980-luvun alussa kalifornialaisen Dahlgren Engravingin valmistama järeähkö CNC-pöytäkaiverrin. Dahgren Engraving oli aikanaan hyvin mielenkiintoinen yritys ja sen perustaja Willie “The Wizard” Dahlgren ilmeisesti melkoinen persoona. Hänen muistokirjoituksensa mainitsee muunmuassa hänen rakennelleen jo 70-luvulla sähkömoottoripyörän. Yrityksen tarinaa voi lukea vaikkapa tästä Engravers Journalin artikkelista.

Laitteisto itsessään koostuu jykevästä 12″ x 24″ kaiverrinpöydästä, jota ohjaa X- ja Y-suunnissa kaksi kuusinapaista NEMA 23-stepperimoottoria (3.4V ja 2.9A). Itse kaiverrinmoottori on yksivaiheinen 100W Groschopp-yleismoottori, jossa optinen kierrosnopeusanturi. Kun kerran amerikkalaisesta systeemistä on kyse, on kaiverrinmoottori luonnollisesti 110V AC. Mielenkiintoisena kuriositeettina pöytää pitää puhtaana paineilmapuhallin, ja samaa painetta käytetään myös Z-akselin mukaisen liikkeen aikaansaamiseksi. Z-liike saadaan siis aikaan vapauttamalla solenoidi pöydässä, jolloin kara laskee kiinni työstökappaleeseen. Tätä koko komeutta ohjaa ohjaintietokone SCU, joka edustaa 1970-luvun huipputekniikkaa. SCU on S-100 -väylään pohjautuva ratkaisu, joka ohjaa lähinnä vain pöytää, käyttäen apuna S-100 -kortteja, jotka saattavat olla Solid State Musicin (SSM) alunperin valmistamia, mutta Dahlgren-brändättyjä. Tässä meidän tapauksessamme ohjaustietokone on kytketty pitkällä lattakaapelilla ISA-korttiin, joka majailee 486-prosessorin vauhdittamassa PC-tietokoneessa. Alun perin Dahlgren ilmeisesti suosi Tandy TRS-80:a. Meidän PC:mme luonnollisestikin ajaa DOS:ia ja kaikki kaivertamiseen liittyvät softat ovat DOS-pohjaisia. Hetken näitä ihmeteltyämme totesimme, että koska kone on niiltä ajoilta kuin Gerber oli ohjausformaattina vasta lastenkengissään, kaikki tiedostot ovat Dahlgrenin omaa formaattia.

Vähän aikaa laitetta ihmeteltyämme totesimme, että DOS-softa on sen verran vihamielinen, että sen käyttö ei tule olemaan helpoimmasta päästä. Lopulta totesimme, että voisi olla parempi modernisoida koko laite. Tämä blogipostaussarja kertoo tästä muutosprosessista. Toivottavasti tästä on apua, jos satut olemaan tekemässä vastaavaa modernisointia tai haluat tietää lisää CNC-kaivertimien saloista ylipäätään. Koko paketti on myös erittäin mielenkiintoinen pala tietotekniikan historiaa. Kun aloitimme oman modernisointiprojektimme, tutkimme luonnollisesti mitä muut olivat tehneet (esim. https://www.inventables.com/projects/dahlgren-system-300-convert), mutta monessa tapauksessa tuntui, että modernisoinnissa ainoa säästynyt osa on pöytä itse. Päätimme yrittää modernisointia käyttäen mahdollisimman paljon alkuperäsiä osia. Näin säästäisimme selvää rahaakin, koska stepperit ja kaiverrinmoottori olivat täysin toimintakuntoisia, eikä niitä sen takia tarvitsisi uusia.

An IoT collaboration exercise between hacklab, University, Upcloud and Agiler

We did a small collaboration with Tampere University students, who were making a coursework for an IoT course. UpCloud has been kind enough to grant us a free server in their cloud infrastructure to play and experiment with. Similar test accounts as used in this project are available to our members, just ask Marko.

The course exercise was to implement a simple IoT device and the students came to Agiler, an RF-focused startup, situated in Nokia to ask for some real world related problems to solve. They were instructed to test a simple radar module for its capabilities. So, Agiler provided the hardware, Uusi Nokia hacklab gave access to the Upcloud servers and Tampere University provided the rest. So pretty cool public-academic-commercial collaboration in a small package. Unfortunately, the Covid-19 posed some obstacles, but in the end, the group delivered a fully working proof of concept.

The device architecture of the coursework

Marko intervieved Haseeb Mustafa from the group about their experiences with Upcloud and its suitability for such IoT-related projects.

Marko: Did you find UpCloud server suitable for your application?

Haseeb: Yes, it was somewhat suitable. The main problem which we faced during this application was that we had to set up a lot of things that made an extra overhead for our application. So if we want to use perfectly for IoT application then there are certain services which provide IoT services like MQTT brokers and data visualization platforms which also come with APIs for communication. Not to mention they have better security that we implemented. However, security was not our main concern anyways. An example of such service is ThingSpeak.

Do you have experience on alternatives? If yes, on which? What were the main differences between UpCloud and the other vendors you know? Would you rather have used them if possible?

No we had no experience on alternatives. We do not have experience with AWS EC2 or Azure which could be compared with up cloud. We would have used some service which is meant for IoT e.g,. ThingSpeak so that we can do it quickly and do proper evaluation of results.

What did you install on the bare bone server for your app? Was it easy enough?

Now we don’t remember all the packages but Nodejs, mosquito and MySQL were the integral parts of our setup. Lamppp/xampp (Dont remember exactly) was also installed initially but then we shifted to Nodejs later. The dependencies of mentioned packages were also installed.

You used the free Basic server version. Did you feel that the performance was good enough? What resources might be the first bottleneck if you continue the development?

For this application it was good enough. There was no hurdle and we did not know the specifications. For bottlenecks, there could be a lot of things which we can consider when we are seriously developing a product instead of school project. The current experience was code, deploy, test anyways.

What were the three best enablers you found helping you to develop your app?

  • SSH
  • Terminal
  • Static IP of server

What were the three main obstacles you found?

  • No proper tutorial
  • Broken API calls
  • Setup difficulties

What improvements you would like to have on the server if you would continue using it?

This was the our first project related to IoT so it was really good for learning but we cannot comment on this one due to lack of experience on such server applications so for this we will have to implement it in more detail and on some other applications as well so that we can see advantages and disadvantages and can compare it with others. Maybe the best thing could be a proper tutorial to use which can guide for proper information would be beneficial for starting to work with it.

Any final comments?

As we told this was our first IoT application and we learnt a lot like how practical things work and how it can be applied in real world so our overall experience was good and from application point of view once somebody think that how to do SSH, the server could be a good idea on how to use the server and how to do complete set up then everything went smoothly and we had no issues in it.

Avoimet ovet

Lauantaina 24.2. Hacklabilla avoimet ovet. Kaikki toiminnasta kiinnostuneet ovat tervetulleita paikan päälle tutustumaan jäseniin ja toimintaan. Paikalla on väkeä klo 15 alkaen aina ilta seitsemään, miksei pidempäänkin jos asiaa riittää.

Jos et ole aiemmin käynyt Hacklabilla, niin tule Nokian Portin pääovelle, opastamme siitä eteenpäin. Tapahtuman FB-sivu täällä: https://www.facebook.com/events/1951321241851994/

Nokian Portti

Toimintaa käynnistellään vähitellen

Kuten varmaan jo moni asioita seurannut tietääkin, saimme vuokrattua lokakuun alusta tilat Nokian Portin kautta. Sopivaksi tilaksi valkkautui entinen bändikämppä alimmassa kerroksessa, jota on vähän kerrallaan ehostettu uuteen käyttöön. Vanhan tehtaan tilat sopivat hyvin myös hengeltään uuteen käyttöön.

Vanha bändikämppä sai uudet vuokralaiset

Äänieristykset ovat saaneet lähteä, ja kätevä Martta maalasi tilat uuteen uskoon. Tehosteväreiksi valkkautui vihreä kuvaamaan kierrättämistä ja korjaamista, jotka kuuluvat perusajatukseen, sekä sininen vertauskuvaksi avoimuudelle. Suurta osaa näytteli tietysti myös teollisuusympäristön olemassaollut värimaailma.

Väriä seiniin

Samaan aikaan kävin myös hakemassa miljoonalaatikon alkua, jossa muun muassa summereita, 7-segmenttinäyttöjä, kondensaattoreita ja regulaattoreita sekä paljon muuta.  Itse toiminnan aloittaminen ei ole siis enää kaukana.

Miljoonalaatikon alku

 

 

 

 

Syyskokous 22.9.2017

Ensimmäinen syyskokous RY:n perustamisen jälkeen pidettiin Nokialla 22.9.

Paikalla Marko, Erno, Roni, Sami, Tuomas ja Susanna.

Yhdistyksen syyskokouksessa käsiteltiin seuraavat asiat:

  1.  kokouksen avaus klo 18:25
  2.  valitaan kokouksen puheenjohtaja, sihteeri, kaksi pöytäkirjantarkastajaa ja tarvittaessa kaksi ääntenlaskijaa.

PJ Erno, Sihteeri Marko, tarkastaja Roni ja Sami.

  1. todetaan kokouksen laillisuus ja päätösvaltaisuus.

Todettiin kutsujen tulleen ajoissa ja kokouksen olevan laillinen ja päätösvaltainen.

  1. hyväksytään kokouksen työjärjestys
  2. vahvistetaan toimintasuunnitelma, tulo- ja menoarvio sekä liittymis- ja jäsenmaksujen suuruudet seuraavalle kalenterivuodelle

Vuokrataan toistaiseksi Pirkkalaistie 1:n tilat (150 €/kk), haettu rahaa Sohlbergin säätiöltä 5000 €, päätös tammikuussa. Koneen säätiöltä haettu 6000 euroa.

Yrityksien kannatusjäsenyys 50 €/kk, jäsenmaksun suuruden päättää hallitus kokouksessaan. Pyritään järjestämään ainakin 2 kurssia jäsenille ja muille kiinnostuneille rahoitusta varten.

Pyritään keräämään laitteistoa, materiaaleja ja tilan kunnostukseen materiaalia sekä muuta avustusta lahjoituksina.

Käynnistetään harrastustoiminta, ja laitetaan verkkomateriaalit kuntoon.

  1. päätetään hallituksen koko, valitaan hallituksen puheenjohtaja ja muut jäsenet

Päätettiin hallituksen kooksi PJ + 3. Suvi saapui paikalle. PJ Marko, Erno, Roni ja Sami.

  1. valitaan yksi tai kaksi toiminnantarkastajaa ja heille varatoiminnantarkastajat

Suvi toiminnantarkastajaksi, varalla Susanna.

  1. käsitellään muut kokouskutsussa mainitut asiat. Mikäli yhdistyksen jäsen haluaa saada jonkin asian yhdistyksen kevät- tai syyskokouksen käsiteltäväksi, on hänen ilmoitettava siitä kirjallisesti hallitukselle niin hyvissä ajoin, että asia voidaan sisällyttää kokouskutsuun.

Esiteltiin verkkosivut. Tehtiin Twitter-tili. Rahaliikenteestä hallitus selvittelee ensisijaisesti Holvin käyttöä.

Pöytäkirja hyväksytty kokouksen päätteeksi 18:59.