Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsFPGAs and CPLDs are not programmed with a sequence of instructions: you describe circuits that all run at once. This first design divides the board clock down to about 2 Hz and shows a binary count on the LEDs. You build it with the Gowin tools for the Tang Nano 20K and with Quartus for a MAX II CPLD board programmed by a USB Blaster.
Most FPGA pins are 3.3 V; do not connect 5 V signals directly.
Tick anything you already have and the total updates.
Open-source route: build with Yosys and nextpnr
counter.v// Binary LED counter: about 2 counts per second
module counter #(parameter CLK_HZ = 27_000_000, parameter N_LEDS = 6) (
input wire clk,
output wire [N_LEDS-1:0] led
);
localparam DIV = CLK_HZ / 2;
reg [31:0] tick = 0;
reg [N_LEDS-1:0] count = 0;
always @(posedge clk) begin
if (tick == DIV - 1) begin
tick <= 0;
count <= count + 1'b1;
end else
tick <= tick + 1;
end
// many boards light an LED when its pin is LOW: invert here if so
assign led = ~count;
endmodule
Check the pin constraints and whether the LEDs are active low.
CLK_HZ must match the board oscillator.
Install its driver from the Quartus folder.
CPLDs are small, non-volatile and start instantly; FPGAs are much larger and load their design at power-up.
Both work in these tools; Verilog is shorter for beginners.
Yes, soft cores such as a small RISC-V fit in the Tang Nano 20K.
4 parts: Sipeed Tang Nano 20K FPGA Development Board, Altera MAX II EPM240 CPLD Development Board, Altera USB Blaster CPLD/FPGA Programmer and MuseLAB iCESugar FPGA Board ICE40UP5k RISC-V Open Source. On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 3 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (counter.v).
About ₹9,886 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Clock division with a counter; Pin constraints; Synthesis, place and route; FPGA versus CPLD.
Most FPGA pins are 3.3 V; do not connect 5 V signals directly.
Ideas that reuse this build: STM32 first steps. They are listed under Take it further on this page.
Your first MicroPython project: temperature and humidity on an OLED.
A web page with ON and OFF buttons that switches a relay over Wi-Fi.
A warm ring light that fades up at dusk and down at dawn.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Learning project. Check every circuit and the datasheet of each part before you power it up.