Friday, June 3, 2016

[Chariot Station] Custom made station for Thule Cougar Chariot


Just wanted to share how i built an extremely simple docking station for my Thule Cougar 1 Chariot.

Due to my garage being pretty small, i need to detach the chariot from the bike overnight. The idea is to be able to keep the Chariot while in "Bike mode" (with the bike connecting arm) but detetached from the bike. Without a docking station the bike arm would touch the ground and might be destorded over time.

Here is a view from the bottom of the chariot with all the useful measurements



With those measurements I could then design my docking station. The dock is pretty simple and is made of 4 pieces of mdf wood. The dimensions are so that it fit perfectly with the plastic section on each side of the front of the chariot.

It is made with 2x 11,5 cm x 15 cm and 2x 11,5 cm x 44 cm to fit as following:
Each pieces of wood are connected with wood screws with countersink in order to avoid having the screws scratching the chariot



Here is how it looks like when finished :


And with the chariot docked on it :


Don't hesitate to comment if you have a suggestion or if you like to know anything about the chariot from Thule (great piece of equipment by the way !)

Saturday, October 3, 2015

[Baby Mobile Hanger] How i custom designed a Baby Mobile Hanger for our bathroom


Today i will share something sligthly different from the usual, but this is still about making something !

My baby daugther needed a little entertainment in our bathroom while she is being dressed and changed. I needed to hang a Baby Mobile that my wife made directly above the mirror. The only way i could do so was with the mural lamp that is above the mirror.

First i took precise measurements of how the lamp is and the exact dimensions that my hanger would need to be in order to fit. Here are the initial drawings



Then i went to 123D Design and sketched the item. Kept it simple


My shop printed it for me, not without trouble, i had to redo the part and removed the little hook to that the piece could be printed verticaly and not horizontaly as shown above. I would then glue the small hook back with some epoxy. Here is the final result.


With some close shots of the detail, the hook is made to fit exactly to my bathroom lamp and the little reduction of diameter at the tip is to hang the mobile using a standard key ring !


And here the final result, my little girl loves it !


Sunday, June 21, 2015

[Wireless Room Temperature Monitoring System] 3D Printed enclosure final result !

After so many weeks of inactivy (I have very good reasons i promise) i finally had the time to finish the CAD file for the enclosure and to get it printed at my local store in Alsace :)

Here is the final result. It is far from perfect unfortunately. I didnt plan for the support to get merged with some of the structure i designed. Also some of the structure were too small and had small hanging part, under which support material was still put and unfortunately ... i had to cut the whole thing to make it work. Here are a few thing that i would do differently next time :


On the left, i was too optimistic to have the small bump to guide the arduino mini pro ... unfortunately since there was hanging part over it, the bumps got merged with the support material ... i ended up remove the whole top part. Same issue with the one in the middle ... the support material added by the 3D printing software screwed the print. On the right, i made a different mistake to put the screwing hole for the temperature sensor above a another guide... i didnt plan for the support material for the screwing hole to merge with the structure below ...

Here are the pictures of the final result ! Let me know your thoughts or suggestions !

From aboce
With the components

With the lid
Without the lid 

Sunday, April 19, 2015

[Wireless Room Temperature Monitoring System] Enclosure for wireless temperature sensor 3D Modeling with 123D Design

Now that the components are all designed in 3D i can try an design the enclosure.

I tried to take into account the way the elements are going together, how the cables are connecting the components and all. I am not even sure this could be 3D printed. Here is what i intend to send for printing :



What do you think ? Any suggestions ?

Thursday, April 9, 2015

[Wireless Room Temperature Monitoring System] Enclosure for wireless temperature sensor 3D Modeling with 123D Design

Alright so now that i have a rough idea of how the enclosure should be i can go ahead and design it in CAD. 123D Design seems perfect and easy to use. As a training exercice I decided to reproduce all the components that are involved in my sensor in 123D Design at the exact correct scale. This way i will be able to design the enclosure to take into account. First i took exact measurement of each of the 5 main components that are involved in the sensor.

Here is how it looks :




What do you think ?  Any advice ?

If anyone is interested for their own CAD design (and if you use the same components as me ...) please contact me and i will give you the .stl file

Next, i will make the enclosure using those components to make sure that everything fits together


Saturday, March 28, 2015

[Wireless Room Temperature Monitoring System] Enclosure for wireless temperature sensor prototype

Alright, so now that i have to mess up with the code and make the code work properly, i need to have an easy to handle hardware prototype. To do so i incorporated a switch so i can put the sensor on and off without having to unplug the battery.

There it is :  The switch is available on the front side. I made a hole to have the temperature sensor stick out of the box for more accuracy.

View of the inside... pretty messy but it works


And there it is closed, the antenna is sticking out of the box through  a hole.


Until I design a 3D printed enclosure, that will do the trick. 



Monday, March 23, 2015

[Wireless Room Temperature Monitoring System] Labeling a temperature (DS18B20) from an Arduino Pro Mini to a Raspberry Pi

Back to square 1. Unfortunately the code i have been using since the beginning to send the data from the Arduino to the Raspberry Pi.

Thanks to smart people on the internet i found out there was a way to have an Arduino talk to a Raspberry Pi using the VirtualWire libraries (initially made for only Arduino to Arduino communications).

1) The Arduino part :

Download and Install the VirtualWire library : Information // Dowload Link

I uploaded the following code to my Arduino Pro Mini:
#include <VirtualWire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 3 //DS18B20 Connected to Pin 3

int compteur = 0;

const char *msg = "Temp1 ";
const char *celsius = "C: ";
const char *diese = " #";
char nombre[VW_MAX_MESSAGE_LEN];
char message[VW_MAX_MESSAGE_LEN];
char tempCx100char[VW_MAX_MESSAGE_LEN];
OneWire oneWire(ONE_WIRE_BUS); // For the DS18B20
DallasTemperature sensors(&oneWire);
DeviceAddress Thermometer = { 0x28, 0xFF, 0xED, 0x0F, 0x11, 0x14, 0x00, 0xD2 }; //Obtained using another program
void setup()
{
   Serial.begin(9600);  // Debugging only
   sensors.begin();
   sensors.setResolution(Thermometer, 10);
 
   // Initialise the IO and ISR
   vw_set_tx_pin(10);
   vw_set_ptt_inverted(true); // Required for DR3100
   vw_setup(2000); // Bits per sec
}
void printTemperature(DeviceAddress deviceAddress)
{
  compteur++;

  float tempC = sensors.getTempC(deviceAddress);
  int tempCx100 = (int)(tempC*100); // Multiply the float value to have a full int with 2 digits
  itoa(tempCx100,tempCx100char,10); //Convert int to char
  itoa(compteur,nombre,10); // compteur de message

  strcpy (message,msg);
  strcat (message,tempCx100char);
  strcat (message, diese);
  strcat (message,nombre);

  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
 
  } else {
    digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)message, strlen(message));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
  }
}
void loop()
{
  sensors.requestTemperatures();
  printTemperature(Thermometer);
  Serial.print(message);
  Serial.print("\n\r");
  delay(1000);
}

I basically compiled all the DS18B20 related codes i found out about earlier along with the specific code available to send stuff from VirtualWire library.
The code is sending a message with
    - a string that enables me to identify which temperature sensor sends the message.
    - the temperature as a 4 digit integer (2125 > 21.25C)
    - a message count in order to follow which messages are being lost for prototyping purposes

2) The Raspberry Pi part :

I basically used a python code suggest by this Joan on the raspberry pi forum : Link
You also need the pigpio library to be installed on the RPi : Link
wget abyz.co.uk/rpi/pigpio/pigpio.zipunzip pigpio.zipcd PIGPIOmakemake install
The code (vw.py) is a massive program which allows me to either receive or send using the RF433 Module : Link

I copied the program file in a dedicated folder on the Raspberry Pi along with another python program that will import the vw.py and once started, will only do what i need it to be doing
import timeimport pigpio
import vw
RX=27
BPS=2000pi = pigpio.pi() rx = vw.rx(pi, RX, BPS) start = time.time()print("En attente de la reception des donnees")
while (time.time()-start) < 100: while rx.ready(): print("".join(chr (c) for c in rx.get()))rx.cancel()
pi.stop()
 The result :

The Arduino Pro Mini with DS18B20 + TX433 and the relevant code is plugged in, and i start the program above and here the result :


It works ! :) Thank you to all contributor in the internet for their python programs and other libraries !

Now i can identify each temperature sensor. Next i will probably build another sensor module and try to receive both temperature and see if they don't interact too much and create a mess :)

Sunday, March 1, 2015

[Wireless Room Temperature Monitoring System] Sensor Enclosure Prototyping Part 1

I have been doing some thinking on the enclosure i want to 3D Print myself.

The goal is to have a relatively simple design to store all modules : Arduino, Temperature sensor, 9V Battery enclosure and TX RF 433 Mhz Module.

Here are the first prototype drawings :

 


I am already having second thoughts about the enclosure, specifically about the antenna. My latest test showed that i should have a linear antenna instead of a coiled one...

I will have some more drawing done in the following days.



Friday, February 27, 2015

[Wireless Room Temperature Monitoring System] Sending Temperature values to the Raspberry Pi and store it in a .txt file

Now that each elements are working independently we will have the arduino measuring the temperature, sending it with the TX 433 Mhz module through the air and have the Raspberry Pi pick up the data and collect it in .txt file

I had to modify the Arduino code in order to get the temperature with full details. The device is giving a float value that cannot be sent over RF (basically we loose the numbers after the comma). In order to avoid that we multiply the float value by 100 in order to get full details and send it over RF.

I modified the "printTemperature" class from the Arduino Code :
void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  int tempCx100 = (int)(tempC*100); // Multiply the float value > int with 4 digits

  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
    mySwitch.send(0000, 24);
  } else {
    Serial.print("C: ");
    Serial.print(tempC); //reads the temp value on the serial port
    mySwitch.send(tempCx100, 24); //Temperature x100 with all the accuracy needed
  }
}
On the receiving end, I modified the code in order to modify the received Int into a float and to store the value received in a file.

Modification of the while loop within the RFSniffer.cpp program
 while(1) {
      if (mySwitch.available()) {
        int value = mySwitch.getReceivedValue();
        float valuefloat = (float) (value/100.0); // Divide the received value to get a float
        if (value == 0) {          printf("Unknown encoding");        } else {
          printf("Recu %i\n", mySwitch.getReceivedValue() );
          FILE *f = fopen("/home/pi/recu.txt", "a"); //append the value within the next line of the recu.txt file          fprintf(f,"%i\n",value );
          fclose(f);        }
        mySwitch.resetAvailable();
      }
There you can see the reading directly on the Serial Port reader from the Arduino Software


Then there is the value being sniffed by the Raspberry Pi directly in the Terminal


And finally the content of the file in which we are appending the received file indefinitely

Now that this work, here are the next challenge.

I need to be able to "identify" which Temperature sensor sent this result, basically label the sent value
I need to append those values into a file per day with the time stamp available
Ultimately i should be able to have those values read and plotted in a graph.

Friday, February 13, 2015

[Wireless Room Temperature Monitoring System] Temperature sensing with DS18B20 sensor and Arduino Pro Mini

The goal here is to plug the DS18B20 Temperature sensor to the Arduino Pro Mini.
For my project i decided to go with an already complete module with the sensor as well as the 4,7 kOhms ... less soldering !

The wiring : 

The DS18B20 Module has 3 pins just like the DS18B20 sensor alone.

      DS18B20 Module > Arduino Pro Mini

  • - (Negative) > GND
  • + (Positive) > VCC
  • Data > Pin 3 
























The software :

Once the wiring is all done, the next step is to try finding out what is the address of the sensor in order to get the temperature measure later on.

You need to install the OneWire and the DallasTemperature libraries
- One wire : http://www.hacktronics.com/code/OneWire.zip
- DallasTemperature : http://www.hacktronics.com/code/DallasTemperature.zip

The idea is to upload the following code to the Arduino Pro Mini with the sensor wired :
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire  ds(3);  // Connect your 1-wire device to pin 3
void setup(void) {
  Serial.begin(9600);
  discoverOneWireDevices();
}
void discoverOneWireDevices(void) {
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];

  Serial.print("Looking for 1-Wire devices...\n\r");
  while(ds.search(addr)) {
    Serial.print("\n\rFound \'1-Wire\' device with address:\n\r");
    for( i = 0; i < 8; i++) {
      Serial.print("0x");
      if (addr[i] < 16) {
        Serial.print('0');
      }
      Serial.print(addr[i], HEX);
      if (i < 7) {
        Serial.print(", ");
      }
    }
    if ( OneWire::crc8( addr, 7) != addr[7]) {
        Serial.print("CRC is not valid!\n");
        return;
    }
  }
  Serial.print("\n\r\n\rThat's it.\r\n");
  ds.reset_search();
  return;
}
void loop(void) {
  // nothing to see here
}
code source : http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

Once up and running with the program in the Arduino, go to :

Tool > Serial Monitor.

The sensor address will then show up on the monitor. In my case it was :
0x28, 0xFF, 0xED, 0x0F, 0x11, 0x14, 0x00, 0xD2 
With this address we can move on to the next and final step, measure some temperatures finally !
Upload the following code to the Arduino Pro Mini
#include <OneWire.h>   
#include <DallasTemperature.h>
// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 3
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
// Assign the addresses of your 1-Wire temp sensors.
DeviceAddress Thermometer = { 0x28, 0xFF, 0xED, 0x0F, 0x11, 0x14, 0x00, 0xD2 };
void setup(void)
{
  // start serial port
  Serial.begin(9600);
  // Start up the library
  sensors.begin();
  // set the resolution to 10 bit (good enough?)
  sensors.setResolution(Thermometer, 10);
}
void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
  } else {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}
void loop(void)
{
  delay(2000);
  Serial.print("Getting temperatures...\n\r");
  sensors.requestTemperatures();

  Serial.print("Inside temperature is: ");
  printTemperature(Thermometer);
  Serial.print("\n\r");
}
Code source : http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html

Once the Arduino is running the program, go to the Serial Monitor again.
The temperature should be printed on the screen
















Tada ! Temperature is displayed on screen !

Next step is to try and combine the temperature sensing and to send it via TX 433 Mhz to the Raspberry Pi to sniff !

If anyone has any idea on how to do that ... i am interested !