IMG_2716

Bluetooth Skateboard Controller Update!


I have successfully produced 4 prototype electric skateboard controllers. Here are the specs:

  • Modes: Car/Boat and Electric Skateboard
  • Sensitivity: 1000 degrees
  • Input Voltage: 4.5~6.5 VDC
  • Max Voltage Measurement: 55 volts
  • Failsafe: Slowly turns off the motor
  • Dimensions: 50.0 x 38 x 12mm

These controllers are almost ready to ship. All that’s left is to waterproof each circuit using epoxy resin, and ensure compatibility across all Android devices.

Read more

IMG_20160119_130837-2

Riverside Weather Station

My personal project for my Drafting and Design 11 class was a solar powered, automatic weather station. The goal was to design a small, compact weather station with the following requirements:

  • Must be solar powered, with a battery for operation at night
  • Must be compact in size, with a non-destructive mounting method
  • Must be able to upload data to the WeatherUnderground network
  • Must be weather-proof
  • Has to measure temperature, humidity, air pressure, and UV radiation

I managed to meet a majority of those requirements; but shortly after I put the weather station up, the barometer stopped working. Currently, the weather station has a thermometer, a hygrometer, and a UV radiation sensor. However, the weather station is still visible on the WeatherUnderground website, where you can view the live weather conditions. By being part of the WeatherUnderground network, the Riverside Weather Station is helping to predict the weather on a hyper-local scale.

Weather Underground PWS IBRITISH466
I greatly improved the design from my old weather station in terms of efficiency. The weather station has an average power consumption of 340 micro-amperes. The backup battery is also far smaller; only a 1000mAh Li-Po battery from an old blackberry, compared to the old weather station’s 5Ah sealed lead-acid battery. I still used the same wireless 433MHz link for the data however, and that limited my range quite a bit.

In the end, I am very happy with the overall design and build-quality of the weather station. It is currently affixed directly above the tech-wing of my school, and is uploading data to WeatherUnderground every 11 minutes.

Prototype circuit:

IMG_1667

I started the project off by building the prototype circuit on a breadboard. I used all new components, except the 433Mhz radio, which I salvaged off the old weather station. But right before I did that, thought of using the ESP8266 Wi-Fi chip instead. I ran some tests on the chip at my school using a USB to UART converter, and I could not connect to the Wi-Fi network. Even though our network had basic WPA encryption, there was an additional login page after you connected. I could not figure out a way to login to that page, so I decided to use the radio link that I was familiar with.

I connected the new sensors to an Atmega328 micro-controller, and powered everything using a MAX604 linear voltage regulator. This regulator was fairly expensive ($7.00), but it had a VERY low dropout voltage in the mV range, which made it very efficient. I used this regulator to bring the 3.7-4.2V of the Li-Po battery, to a perfect 3.3V.

I decided to use an old blackbattery battery for this project because I had one laying around, and because I knew it had voltage protection circuitry, which would turn off the power when the battery got too low. In order to charge the battery, I went with a TP4056 module. This module is very efficient, and it is able to work off a 5v input. I also had a small, 5v solar panel laying around, which was able to charge the battery through the TP4056 board even in low lighting. Here is the full schematic for the Riverside weather station:

Circuit

Making a PCB:

IMG_1716

I decided to make the circuit into a PCB instead of making it on a perfboard. A PCB is more rigid and durable than a perfboard, and I wanted this weather station to be my “legacy” once I graduate from Riverside. I took the breadboard design and transferred it over into an Eagle CAD schematic. I had to search for, and even make libraries for some of the components I used.

Once I had everything in schematic form, I transferred it over to a PCB design. I set the border for the PCB to be a 100mmx75mm rectangle, which was the size of the double sided, copper-clad board that I had. Then came the long and grueling task of laying out the components and making the traces. I laid out the components as simply as I could, and this is how it looked like when I was done:

TopBoard

To physically make the PCB, I decided to use my dad’s homemade CNC machine. I downloaded PCBGcode, a plugin for Eagle CAD, and used the default settings to export the etch and drill g-code files for the top and bottom layer. I then took those files over to a program called Autoleveler (a free version of this program is available somewhere on the internet). It took the etch files, and turned them into files that made use of the CNC machine’s probe tool.

I started up the CNC machine, put in a 0.1mm, 30 degree etching bit, then used two alligator clips to probe the surface of the copper-clad board. This told the machine where the surface was, which enabled the machine to etch the PCB with a uniform depth.

IMG_1698

I started by etching the bottom layer, then I used a homemade wooden jig to perfectly flip the PCB over, then I etched the other side. I did have to move the home position 100mm to the left when I changed sides.

After the etching was complete, I swapped the bit out for a 0.8mm drill bit. The PCBGcode plugin generated separate files for drilling, so I ran the appropriate file. I did not have to probe the surface this time, but I added some break-trough in the settings to make sure the drill bit went all the way through.

IMG_1715

After that, it was time to take the PCB out, and solder all of the components on. I was a bit off center with the holes on the top layer, but that was okay, since I wasn’t going to solder the top layer (except the vias) anyways.

 

Making a 3D printed box:

IMG_2543

One of the things my old weather station lacked was a proper enclosure (which is also why I never put the old weather station outside). With the help of my school’s 3D printer (Makerbot Replicator 2), I managed to build a very nice body for my weather station out of while PLA. I used about a 20% infill, with rafts and supports. I designed the case to accommodate the PCB, and I also made a little stand in the back for zip-tying the weather station to a pipe.

The PCB and battery fit perfectly into the base. However, the case still needed a lid. For some reason the Makerbot always stopped in the middle of printing the lid, so I decided to make it by hand out of some 1/4″ high density foam.

 

Software and downloads:

weatherstation

In order to upload data to the WeatherUndergroun network, I had to write an application for the computer on the receiving end of the 433Mhz radio using the PWS API. The software was written in C# using Visual Studio, and it was quite similar to the old weather station software.

Speaking of receivers, I re-used the same receiver from my old weather station in this project. Mr. Mietzker, my tech teacher, donated an old laptop to function as the receiver for my weather station. I set up the laptop in a place where it should not be disturbed, and made a patch cable to connect it to the internet. I set up my receiver program to run when the computer starts, and set the computer to restart in the event of a power-failure. If nothing catastrophic were to happen to the weather station, it should continue to upload data to WeatherUnderground as long as the laptop has power and internet (both of which happen to go out frequently in my school).

Conclusion:

IMG_2555

In the end, I really liked how this project turned out. I learned a lot about 3D printing, and it inspired me to 3D print more readily in my future projects. I also learned how design a circuit with low power-consumption in mind.

I hope this weather station lasts a long time, and that it helps the students of Riverside to never get caught in the rain without an umbrella.

Read more

Weather Station: Solar Power System

IMG_0040-2

One of the goals for the weather station project is to make it solar powered. This, combined with a medium range transmitter (100 m), should make it environmentally friendly as well.

Choosing a battery and solar panel:

To figure out what type of battery/solar panel I need, I started by researching the climate of Vancouver. I also needed the amp draw of the circuit, which I calculated to be about 10mA.

IMG_0044

Now, we get an average of 5.2 hours of sun per day, per year. However, during December we get only an average of 1.82 hours of sun per day. We want this weather station to survive the winter unaided, so we need to adjust the calculations for December.

To figure out the recommended current of the solar panel (in mA) we need to go (10mA * 24 h) / 1.82 h. We get about 133mA.

IMG_0137

The solar panel I went with is a 9v, 350mA, 3.2 watt solar panel. It’s a bit overkill, but like all solar panels, it can only work in sunlight. Cloudy weather will not do.

On average we go about 2 weeks without a purely sunny day, so I used that to figure out the capacity of the battery. 10 mA * 336 hours = 3360 mAh

IMG_0051

To provide power to the circuit on cloudy days and at night, I got a 6v, 5Ah sealed lead-acid battery. I’m curious to see how it performs in the wintertime.

Charging the battery:

6vchargercircuit

It was a huge struggle to automate the charging of this battery. The current circuit I am using is similar to this one from uncommonprojects.com. I modified it so it can be controlled with the Arduino chip. Basically, this is how it works:

  • The Arduino checks the voltage of a 2-resistor voltmeter connected to the terminals of the battery. I used a 47k and a 10k resistor for this.
  • If the voltage is more than a fully charged battery, the Arduino brings the pin of the transistor low. This activates a rudimentary float charger, which limits the charging current to 20mA.
  • If the voltage is less than a predefined point, the Arduino brings the base of the transistor to high. This bumps the voltage to ~7.2v, and the LM317 charges the battery at full speed.

The actual current output is internally limited by the LM317, which limits current the hotter it gets. Since I was building the circuit and constantly testing it, the battery would often overcharge.

IMG_0042

Lowering power consumption:

Initially, the weather station circuit drew ~30mA when not doing anything, I aimed to get this down to ~10mA:

I started by ordering low quiescent current regulators, specifically 5v and 3.3v regulators. Back when I constructed the circuit I used two resistors to provide the 3.3v needed for the barometer to run, I even calculated the power consumption to be 0.083 watts, or 16mA at 5v! What was I thinking? Replacing this voltage spliter halved my power consumption.

IMG_0047

In my Arduino code I implemented the sleep function of the Low Power Library found at Rocket Scream. Since the max sleep time is 8 seconds (without external wake-up), this little loop makes the Arduino sleep for 10 minutes.

void sleep() {
for (int i = 0; i < 75; i++) {
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}
}

Testing the circuit:

IMG_0134

I think now is the best time to test the circuit, during the dark-dark days of October. Here is the entire assembly on two perfboards, with the solar panel facing West. Notice the plant watering prototype on the right!

The red multi-meter shows the amp use. A positive number indicates the battery is being discharged; a negative number indicates the battery is getting charged. Again, the solar panel only charges the battery when it’s in direct sunlight.

The voltmeter which reads 6.4v is powered separately from the circuit and doesn’t increase power consumption. My plan is to leave this setup for several weeks and in the meanwhile, assemble things like the new transmitter (the old one I got for $3 sucks), and begin designing the other sensors.

Read more